// ── Existing entity shapes (from API response) ─────────────────────────────────
export interface Medicine {
    id: string;
    userId: string;
    name: string;
    type: string;
    dose: string;
    dose_frequency: string;
    meal_time: string;
    qty: string;
    used: number;
    isDeleted: boolean;
    patient_type: string;
    createdAt: string;
    updatedAt: string;
}

export interface Symptom {
    id: string;
    userId: string;
    drLang: string;
    ptLang: string;
    createdAt: string;
    updatedAt: string;
}

export interface DoseFrequency {
    id: string;
    userId: string;
    drLang: string;
    ptLang: string;
    createdAt: string;
    updatedAt: string;
}

export interface Instruction {
    id: string;
    userId: string;
    symptomName: string;
    shouldDo: string;
    shouldNotDo: string;
    extra: string;
    createdAt: string;
    updatedAt: string;
}

export interface Diagnosis {
    id: string;
    userId: string;
    diagnosisDrLang: string;
    diagnosisPtLang: string;
    createdAt: string;
    updatedAt: string;
}

export interface Investigation {
    id: string;
    userId?: string;
    name?: string;
    [key: string]: any;
}

export interface UserPreferences {
    id: string;
    userId: string;
    page_size: string;
    page_height_mm: number;
    page_width_mm: number;
    page_header_size_mm: number;
    page_footer_size_mm: number;
    font_size: number;
    page_horizontal_spacing: number;
    prescription_language: string;
    is_signature_required: boolean;
    page_left_side_spacing: number;
    page_right_side_spacing: number;
    printed_letterhead: boolean;
    is_doctor_info_required: boolean;
    createdAt: string;
    updatedAt: string;
}

export interface MasterData {
    medicines: Medicine[];
    symptoms: Symptom[];
    instructions: Instruction[];
    dose_frequencies: DoseFrequency[];
    diagnoses: Diagnosis[];
    investigations: Investigation[];
    user_preferences: UserPreferences;
}

// ── Payload types for Add / Update APIs ────────────────────────────────────────

export interface AddMedicinePayload {
    type: string;           // "Tablet" | "Capsule" | "Syrup" | "Drops" | "Oint" | "Powder" | "Injection" | "Surg. Items"
    name: string;
    dose: string;           // "½" | "1" | "1½" | "2" ...
    dose_frequency: string; // from saved dose_frequencies
    qty: string;            // "1" | "2" ...
    meal_time: string;      // "Before Meal" | "After Meal" | ""
    patient_type: string;   // "all" | "pediatric" | "adult" | "geriatric"
}

export interface AddSymptomPayload {
    drLang: string;
    ptLang: string;
}

export interface UpdateSymptomPayload {
    id: string;
    drLang: string;
    ptLang: string;
}

export interface AddDoseFrequencyPayload {
    drLang: string;
    ptLang: string;
}

export interface UpdateDoseFrequencyPayload {
    id: string;
    drLang: string;
    ptLang: string;
}

export interface AddDiagnosisPayload {
    diagnosisDrLang: string;
    diagnosisPtLang: string;
}

export interface UpdateDiagnosisPayload {
    id: string;
    diagnosisDrLang: string;
    diagnosisPtLang: string;
}

export interface AddInvestigationPayload {
    // name: string;
    investigationDrLang: string;
    investigationPtLang: string;

}


export interface UpdateInvestigationPayload {
    id: string;
    name: string;
}
export interface AddInstructionPayload {
    symptomName: string;
    shouldDo: string;
    shouldNotDo: string;
    extra: string;
}

export interface UpdateInstructionPayload {
    id: string;
    symptomName: string;
    shouldDo: string;
    shouldNotDo: string;
    extra: string;
}
export interface RemovePayload {
    id: string;
}
export interface AddFeedbackPayload {
    title?: string;
    description: string;
    image?: File;
}
export interface HospitalUser {
    id: string;
    fullname: string;
    email: string;
    avatar?: string;
}

export interface HospitalCreator {
    id: string;
    fullname: string;
    email: string;
}

export interface HospitalMember {
    _id: string;
    hospitalId: string;
    status: string;
    isAdmin: boolean;
    isDefault: boolean;
    user_role: string;

    joinedAt: string;
    createdAt: string;
    updatedAt: string;

    user: HospitalUser;
    invitedBy: HospitalCreator;
}

export interface Hospital {
    _id: string;

    name: string;
    type: string;
    licenseNo: string;

    phone: string;
    email: string;

    address: string;
    city: string;
    state: string;
    country: string;
    pincode: string;

    createdAt: string;
    updatedAt: string;

    isDeleted: boolean;

    createdBy: HospitalCreator;

    members: HospitalMember[];
}
export interface MyHospitalsResponse {
    status: number;
    msg: string;
    data: Hospital[];
}