AddFirstBookingDiscount

This commit is contained in:
2026-07-16 12:40:52 +03:30
parent 74815cb05c
commit 893035cef2
8 changed files with 326 additions and 3 deletions
+19
View File
@@ -66,6 +66,25 @@ export class BusinessEntity {
@Column({ default: false })
tipsEnabled!: boolean;
/** Owner-defined promotional percentage discount. */
@Column({ default: false })
promoDiscountEnabled!: boolean;
/** Banner / receipt title, e.g. "اولین رزرو شما" or "تخفیف ویژه تابستان". */
@Column({ type: 'varchar', nullable: true, length: 150 })
promoDiscountTitle!: string | null;
@Column({ type: 'int', nullable: true })
promoDiscountPercent!: number | null;
/** Display code on landing (auto-applied; not a separate redeem step). */
@Column({ type: 'varchar', nullable: true, length: 40 })
promoDiscountCode!: string | null;
/** `first_booking` = only first booking of customer at this business; `always` = every booking while enabled. */
@Column({ type: 'varchar', length: 20, default: 'first_booking' })
promoDiscountMode!: 'first_booking' | 'always';
@ManyToOne(() => BusinessCategoryEntity, (category) => category.businesses, {
onDelete: 'RESTRICT',
})