subscription start and end date
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsString, IsOptional, IsNumber } from 'class-validator';
|
||||
import { IsString, IsOptional, IsNumber, IsDate } from 'class-validator';
|
||||
|
||||
export class CreateRestaurantDto {
|
||||
@ApiProperty({ example: 'کافه ژیوان', description: 'نام رستوران' })
|
||||
@@ -24,4 +24,12 @@ export class CreateRestaurantDto {
|
||||
@IsString()
|
||||
subscriptionId!: string;
|
||||
|
||||
@ApiProperty({ example: '2025-12-26', description: 'تاریخ انقضای اشتراک' })
|
||||
@IsDate()
|
||||
subscriptionEndDate!: Date;
|
||||
|
||||
@ApiProperty({ example: '2025-12-26', description: 'تاریخ شروع اشتراک' })
|
||||
@IsDate()
|
||||
subscriptionStartDate!: Date;
|
||||
|
||||
}
|
||||
|
||||
@@ -102,4 +102,11 @@ export class Restaurant extends BaseEntity {
|
||||
|
||||
@Property({unique: true})
|
||||
subscriptionId!: string;
|
||||
|
||||
@Property()
|
||||
subscriptionEndDate!: Date;
|
||||
|
||||
@Property()
|
||||
subscriptionStartDate!: Date;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ export class RestaurantsService {
|
||||
plan: PlanEnum.Base,
|
||||
domain: `https://dmenu-plus-front.dev.danakcorp.com/${dto.slug}`,
|
||||
subscriptionId: dto.subscriptionId,
|
||||
subscriptionEndDate: dto.subscriptionEndDate,
|
||||
subscriptionStartDate: dto.subscriptionStartDate,
|
||||
});
|
||||
|
||||
await this.em.persistAndFlush(restaurant);
|
||||
|
||||
Reference in New Issue
Block a user