Implement medicine library and cabinet

This commit is contained in:
Aerilyn Weber 2026-03-28 08:19:48 +09:00
parent db79af06f7
commit 1f66fab30f
72 changed files with 7642 additions and 319 deletions

View file

@ -49,13 +49,15 @@ export interface Store {
export interface MedicinePriceRecord {
id: string;
householdId: string;
medicineId: string;
medicineProductId: string; // Reference to MedicineProduct (purchasable level)
medicineProductBrand: string; // Denormalized
medicineId: string; // Reference to Medicine (generic level, for cross-brand comparison)
medicineName: string; // Denormalized
storeId: string;
storeName: string; // Denormalized
price: number;
currency: string; // Default from household settings
quantity: number; // How many pills/units for this price
quantity: number; // How many pills/units for this price (package size)
unit: DosageUnit;
pricePerUnit: number; // Computed: price / quantity
date: Date;
@ -139,8 +141,8 @@ export enum RefillListStatus {
{ householdId: 1, tags: 1 }
// MedicinePriceRecord
{ householdId: 1, medicineId: 1, storeId: 1, date: -1 }
{ householdId: 1, medicineId: 1, date: -1 }
{ householdId: 1, medicineProductId: 1, storeId: 1, date: -1 }
{ householdId: 1, medicineId: 1, date: -1 } // Cross-brand comparison
{ householdId: 1, storeId: 1, date: -1 }
// RefillList