import type { DosageUnit } from '../enums/medicine.enums.js';

export interface MedicinePriceRecord {
  id: string;
  householdId: string;
  medicineProductId: string;
  medicineProductBrand: string;
  medicineId: string;
  medicineName: string;
  storeId: string;
  storeName: string;
  price: number;
  currency: string;
  quantity: number;
  unit: DosageUnit;
  pricePerUnit: number;
  date: Date;
  isInsurancePrice: boolean;
  notes?: string;
  createdBy: string;
  createdAt: Date;
}

export interface StoreComparison {
  storeId: string;
  storeName: string;
  latestPrice: number;
  latestPricePerUnit: number;
  currency: string;
  date: Date;
  isInsurancePrice: boolean;
}

export interface MedicineSpendingAnalytics {
  spendingOverTime: { period: string; total: number }[];
  topBySpending: {
    medicineId: string;
    medicineName: string;
    totalSpent: number;
    avgPricePerUnit: number;
  }[];
  spendingByStore: {
    storeId: string;
    storeName: string;
    totalSpent: number;
    purchaseCount: number;
  }[];
  priceAlerts: {
    medicineId: string;
    medicineName: string;
    storeName: string;
    previousPrice: number;
    currentPrice: number;
    changePercent: number;
  }[];
}
