product module
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Entity, Index, ManyToOne, Property, Enum, Unique } from '@mikro-orm/core';
|
||||
import { BaseEntity } from '../../../../common/entities/base.entity';
|
||||
import { Shop } from ../../../shops/entities/shop.entity';
|
||||
import { Shop } from ../../../ shops / entities / shop.entity';
|
||||
import { normalizePhone } from '../../../utils/phone.util';
|
||||
import { CouponType } from '../interface/coupon';
|
||||
|
||||
@@ -25,13 +25,13 @@ export class Coupon extends BaseEntity {
|
||||
@Enum(() => CouponType)
|
||||
type!: CouponType;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 2 })
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0 })
|
||||
value!: number; // Discount amount or percentage
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0, nullable: true })
|
||||
maxDiscount?: number; // Maximum discount for percentage coupons
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0, nullable: true })
|
||||
minOrderAmount?: number; // Minimum order amount to use coupon
|
||||
|
||||
@Property({ type: 'int', nullable: true })
|
||||
|
||||
Reference in New Issue
Block a user