add tax to order

This commit is contained in:
2026-01-24 11:08:54 +03:30
parent e53c574931
commit 49390ce62e
5 changed files with 43 additions and 13 deletions
@@ -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;