From 7d0df30ee2515d6c8742b9a0f4a114b464e94e46 Mon Sep 17 00:00:00 2001 From: avicenan Date: Thu, 9 Apr 2026 11:19:03 +0700 Subject: [PATCH] fix: store price on column pharmacy order and items --- src/entity/emr/emr_compounding_medicine.ts | 6 ++++-- src/entity/emr/emr_pharmacy_order.ts | 3 ++- src/entity/emr/emr_prescription.ts | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/entity/emr/emr_compounding_medicine.ts b/src/entity/emr/emr_compounding_medicine.ts index 4b6fbf3..b07a5aa 100644 --- a/src/entity/emr/emr_compounding_medicine.ts +++ b/src/entity/emr/emr_compounding_medicine.ts @@ -59,9 +59,11 @@ export class EmrCompoundingMedicine { @OneToMany(() => EmrCompoundingMedicineItem, (item) => item.compounding_medicine, { cascade: true }) items: EmrCompoundingMedicineItem[]; - unit_price?: number; + @Column({ nullable: true, type: "float" }) + unit_price?: number | null; - total_price?: number; + @Column({ nullable: true, type: "float" }) + total_price?: number | null; @Column() @CreateDateColumn() diff --git a/src/entity/emr/emr_pharmacy_order.ts b/src/entity/emr/emr_pharmacy_order.ts index 9655d8a..83ab8a6 100644 --- a/src/entity/emr/emr_pharmacy_order.ts +++ b/src/entity/emr/emr_pharmacy_order.ts @@ -63,7 +63,8 @@ export class EmrPharmacyOrder { @Column({ nullable: true, type: "text" }) status: PharmacyOrderStatus; - subtotal_price?: number + @Column({ nullable: true, type: "float" }) + subtotal_price?: number | null; @OneToMany(() => EmrPharmacyOrderActivity, (activity) => activity.pharmacy_order, { cascade: true }) activities: EmrPharmacyOrderActivity[]; diff --git a/src/entity/emr/emr_prescription.ts b/src/entity/emr/emr_prescription.ts index 7152433..002b552 100644 --- a/src/entity/emr/emr_prescription.ts +++ b/src/entity/emr/emr_prescription.ts @@ -57,9 +57,11 @@ export class EmrPrescription { @JoinColumn({ name: "room_stock_id" }) room_stock: RoomStock; - unit_price?: number; + @Column({ nullable: true, type: "float" }) + unit_price?: number | null; - total_price?: number; + @Column({ nullable: true, type: "float" }) + total_price?: number | null; @Column() @CreateDateColumn()