/** Mirrors the front-end types (src/lib/types.ts in the website). Keep in sync. */
export type Lang = { en: string; bn?: string };
export type Catalogue = 'human' | 'vet' | 'agro';
export type FormIconKey =
  | 'tablet'
  | 'capsule'
  | 'syrup'
  | 'suspension'
  | 'drops'
  | 'injection'
  | 'iv'
  | 'suppository'
  | 'cream'
  | 'powder';
export type InfoKey =
  | 'indications'
  | 'dosage'
  | 'sideEffects'
  | 'precautions'
  | 'pregnancy'
  | 'contraindications'
  | 'interactions'
  | 'pharmacology'
  | 'overdose'
  | 'storage'
  | 'specialPopulations'
  | 'patientCounseling';

export interface ChemicalInfo {
  pubchemCid?: number | null;
  molecularFormula?: string | null;
  molecularWeight?: string | null;
  iupacName?: string | null;
  pubchemUrl?: string | null;
}

export interface GenericFaq {
  q: Lang;
  a: Lang;
}
/** Pharmacist review. `reviewerSlug` / `qualification` come from the reviewers table (SEO Phase 7). */
export type Review = {
  status: 'approved' | 'pending';
  reviewer?: string;
  reviewerSlug?: string;
  qualification?: string;
  date?: string;
};

/** Public profile of a medical reviewer (SEO Phase 7). */
export type Reviewer = {
  slug: string;
  name: string;
  qualification: string;
  registrationNo: string | null;
  bio: string;
  photo: string | null;
};

export interface SiteGeneric {
  id: string;
  slug: string;
  name: string;
  catalogue: Catalogue;
  classSlug: string;
  classLabel?: string;
  classLabelBn?: string;
  tagline?: string;
  structureImageUrl?: string | null;
  chemicalInfo?: ChemicalInfo | null;
  faq?: GenericFaq[];
  conditionSlugs: string[];
  combinations: string[];
  info: Record<InfoKey, Lang>;
  review: Review;
  sources: string[];
  updatedAt: string;
}
export interface SiteBrand {
  id: string;
  slug: string;
  name: string;
  genericSlug: string;
  companySlug: string;
  catalogue: Catalogue;
  form: string;
  formIcon: FormIconKey;
  strength: string;
  siblingSlugs: string[];
  pack: string | null;
  unitPrice: number | null;
  packPrice: number | null;
  priceUpdated: string | null;
  packImage: { url: string; credit: string; date: string } | null;
  formInfo?: Partial<Record<InfoKey, Lang>>;
  addedAt: string;
  popularity: number;
}
export interface SiteCompany {
  id: string;
  slug: string;
  name: string;
  catalogue: Catalogue[];
}
export interface SiteDrugClassGroup {
  slug: string;
  name: string;
  classes: { slug: string; name: string; description: string }[];
}
export interface SiteDosageForm {
  slug: string;
  name: string;
  icon: FormIconKey;
  description: string;
  match: string[];
}
export interface SiteCondition {
  slug: string;
  name: string;
  guidance: string;
  relatedSlugs: string[];
}
export interface SiteProduct {
  slug: string;
  name: string;
  catalogue: 'vet' | 'agro';
  type: string;
  animalsOrCrops: string[];
  form: string;
  formIcon: FormIconKey;
  strength: string;
  genericName: string;
  companySlug: string;
}
