product
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user