add tax to order
This commit is contained in:
@@ -60,6 +60,9 @@ export class Order extends BaseEntity {
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0 })
|
||||
subTotal!: number;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0 })
|
||||
taxAmount: number;
|
||||
|
||||
|
||||
// @Property({ type: 'decimal', precision: 10, scale: 0, default: 0 })
|
||||
// deliveryFee: number = 0;
|
||||
@@ -75,6 +78,9 @@ export class Order extends BaseEntity {
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0 })
|
||||
balance!: number;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 0, nullable: true })
|
||||
dueDate?: number;
|
||||
// get balance(): number {
|
||||
// return this._balance
|
||||
// }
|
||||
@@ -88,6 +94,12 @@ export class Order extends BaseEntity {
|
||||
@Enum(() => OrderStatusEnum)
|
||||
status!: OrderStatusEnum;
|
||||
|
||||
@Property({ nullable: true, columnType: 'timestamptz' })
|
||||
confirmedAt?: Date;
|
||||
|
||||
@Property({ type: 'json', nullable: true })
|
||||
attachments?: string[]
|
||||
|
||||
@BeforeCreate()
|
||||
async generateOrderNumber(args: EventArgs<Order>) {
|
||||
const em = args.em;
|
||||
|
||||
Reference in New Issue
Block a user