add subscription id to rest entity

This commit is contained in:
2025-12-24 23:31:37 +03:30
parent d8a98131e7
commit 833043c8e9
4 changed files with 12 additions and 0 deletions
@@ -20,4 +20,8 @@ export class CreateRestaurantDto {
@IsString()
phone?: string;
@ApiProperty({ example: 'sub_1234567890', description: 'شناسه اشتراک' })
@IsString()
subscriptionId!: string;
}
@@ -99,4 +99,7 @@ export class Restaurant extends BaseEntity {
@Enum(() => PlanEnum)
plan: PlanEnum = PlanEnum.Base;
@Property()
subscriptionId!: string;
}
@@ -25,6 +25,7 @@ export class RestaurantsService {
isActive: true,
plan: PlanEnum.Base,
domain: `https://dmenu-plus-front.dev.danakcorp.com/${dto.slug}`,
subscriptionId: dto.subscriptionId,
});
await this.em.persistAndFlush(restaurant);