cart and coupon
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
} from '@mikro-orm/core';
|
||||
import { BaseEntity } from '../../../common/entities/base.entity';
|
||||
import { PaymentStatusEnum } from '../../payments/interface/payment';
|
||||
import { OrderStatus } from '../interface/order-status';
|
||||
import { OrderCouponDetail, OrderStatus } from '../interface/order-status';
|
||||
import { User } from '../../users/entities/user.entity';
|
||||
import { Restaurant } from '../../restaurants/entities/restaurant.entity';
|
||||
import { UserAddress } from '../../users/entities/user-address.entity';
|
||||
@@ -51,17 +51,7 @@ export class Order extends BaseEntity {
|
||||
couponDiscount: number = 0;
|
||||
|
||||
@Property({ type: 'jsonb', nullable: true })
|
||||
couponDetail: {
|
||||
couponId: string;
|
||||
couponName: string;
|
||||
couponCode: string;
|
||||
type: 'PERCENTAGE' | 'FIXED' | 'DELIVERY' | 'ITEM';
|
||||
value: number;
|
||||
|
||||
maxDiscount?: number;
|
||||
calculatedDiscount: number;
|
||||
ruleVersion?: string;
|
||||
} | null = null;
|
||||
couponDetail?: OrderCouponDetail | null;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0, default: 0 })
|
||||
itemsDiscount: number = 0;
|
||||
@@ -76,7 +66,7 @@ export class Order extends BaseEntity {
|
||||
tax: number = 0;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0, default: 0 })
|
||||
shipmentFee: number = 0;
|
||||
deliveryFee: number = 0;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0 })
|
||||
total!: number;
|
||||
|
||||
Reference in New Issue
Block a user