This commit is contained in:
2026-01-25 12:36:56 +03:30
parent 2449ac447d
commit a7bd26c7ca
9 changed files with 197 additions and 24 deletions
@@ -26,14 +26,16 @@ export class OrderItem extends BaseEntity {
@Property({ type: 'decimal', precision: 10, scale: 0 })
unitPrice!: number;
@Property({ type: 'decimal', precision: 10, scale: 0 })
subTotal!: number;
get subTotal(): number {
return Number(this.unitPrice) * (this.quantity)
}
@Property({ type: 'decimal', precision: 10, scale: 0, default: 0 })
discount: number = 0;
@Property({ type: 'decimal', precision: 10, scale: 0 })
total!: number;
get total(): number {
return Number(this.subTotal) - Number(this.discount || 0)
}
@Property({ nullable: true })
description?: string;