product module

This commit is contained in:
2026-02-08 15:06:52 +03:30
parent 8aac87add1
commit 92cd7432f5
32 changed files with 359 additions and 259 deletions
@@ -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 })