import type { ArchetypeDefinition, SchedulingDefaults } from "../types";

const HEALTHCARE_SCHEDULING: SchedulingDefaults = {
  schedulingPattern: "slot",
  assignmentMode: "customer-choice",
  defaultOperatingHours: [1, 2, 3, 4, 5].map((day) => ({ day, start: "08:00", end: "17:00" })),
  defaultBeforeBuffer: 5,
  defaultAfterBuffer: 10,
  minimumNoticeHours: 24,
  maxAdvanceDays: 90,
};

const BOOKING_CONTACT_FIELDS = [
  { name: "name", label: "Full name", type: "text" as const, required: true },
  { name: "email", label: "Email", type: "email" as const, required: true },
  { name: "phone", label: "Phone", type: "tel" as const, required: false },
  { name: "notes", label: "Additional notes", type: "textarea" as const, required: false },
];

export const healthcareWellnessArchetypes: ArchetypeDefinition[] = [
  {
    archetypeId: "veterinary-clinic",
    name: "Veterinary Clinic",
    category: "healthcare-wellness",
    ctaType: "booking",
    tags: ["pets", "healthcare", "appointment", "animals"],
    itemTemplates: [
      { name: "General Consultation", description: "Full health check for your pet", priceType: "fixed", bookingDurationMinutes: 30 },
      { name: "Vaccination", description: "Annual or booster vaccinations", priceType: "fixed", bookingDurationMinutes: 20 },
      { name: "Dental Check", description: "Oral health examination", priceType: "fixed", bookingDurationMinutes: 30 },
      { name: "Emergency Consultation", description: "Urgent care when you need it most", priceType: "from", bookingDurationMinutes: 45 },
      { name: "Microchipping", description: "Permanent ID for your pet", priceType: "fixed", bookingDurationMinutes: 15 },
      { name: "Neutering / Spaying", description: "Surgical procedures — contact us for a quote", priceType: "quote" },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "items", title: "Our Services", sortOrder: 1 },
      { type: "about", title: "About Us", sortOrder: 2 },
      { type: "team", title: "Meet the Team", sortOrder: 3 },
      { type: "testimonials", title: "What Pet Owners Say", sortOrder: 4 },
      { type: "contact", title: "Find Us", sortOrder: 5 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "petName", label: "Pet name", type: "text" as const, required: true },
      { name: "species", label: "Species", type: "select" as const, required: true, options: ["Dog", "Cat", "Rabbit", "Bird", "Reptile", "Other"] },
      { name: "breed", label: "Breed (optional)", type: "text" as const, required: false },
    ],
    schedulingDefaults: HEALTHCARE_SCHEDULING,
  },
  {
    archetypeId: "dental-practice",
    name: "Dental Practice",
    category: "healthcare-wellness",
    ctaType: "booking",
    tags: ["dental", "healthcare", "appointment"],
    itemTemplates: [
      { name: "New Patient Examination", description: "Comprehensive first visit for new patients", priceType: "fixed", bookingDurationMinutes: 60 },
      { name: "Check-up & Clean", description: "Routine examination and hygiene clean", priceType: "fixed", bookingDurationMinutes: 45 },
      { name: "Teeth Whitening", description: "Professional whitening treatment", priceType: "from", bookingDurationMinutes: 90 },
      { name: "Fillings", description: "White composite fillings", priceType: "from", bookingDurationMinutes: 45 },
      { name: "Orthodontic Consultation", description: "Assessment for braces or aligners", priceType: "free", bookingDurationMinutes: 30 },
      { name: "Emergency Appointment", description: "Urgent dental care", priceType: "from", bookingDurationMinutes: 30 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "items", title: "Treatments", sortOrder: 1 },
      { type: "about", title: "About the Practice", sortOrder: 2 },
      { type: "team", title: "Our Dentists", sortOrder: 3 },
      { type: "gallery", title: "Our Practice", sortOrder: 4 },
      { type: "contact", title: "Find Us", sortOrder: 5 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "patientType", label: "Patient type", type: "select" as const, required: true, options: ["New patient", "Existing patient"] },
    ],
    schedulingDefaults: HEALTHCARE_SCHEDULING,
  },
  {
    archetypeId: "physiotherapy",
    name: "Physiotherapy",
    category: "healthcare-wellness",
    ctaType: "booking",
    tags: ["physio", "healthcare", "rehabilitation", "appointment"],
    itemTemplates: [
      { name: "Initial Assessment", description: "Full assessment of your condition and treatment plan", priceType: "fixed", bookingDurationMinutes: 60 },
      { name: "Follow-up Session", description: "Ongoing treatment session", priceType: "fixed", bookingDurationMinutes: 45 },
      { name: "Sports Injury Rehab", description: "Specialised sports injury rehabilitation", priceType: "per-session", bookingDurationMinutes: 60 },
      { name: "Post-Surgery Rehab", description: "Recovery support after surgery", priceType: "per-session", bookingDurationMinutes: 60 },
      { name: "Dry Needling", description: "Targeted muscle release treatment", priceType: "fixed", bookingDurationMinutes: 30 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "items", title: "Treatments", sortOrder: 1 },
      { type: "about", title: "About Us", sortOrder: 2 },
      { type: "team", title: "Our Therapists", sortOrder: 3 },
      { type: "contact", title: "Book an Appointment", sortOrder: 4 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "condition", label: "Area of concern", type: "text" as const, required: false, placeholder: "e.g. lower back pain" },
      { name: "referral", label: "Referred by", type: "select" as const, required: false, options: ["GP", "Specialist", "Self-referred", "Employer", "Insurance"] },
    ],
    schedulingDefaults: HEALTHCARE_SCHEDULING,
  },
  {
    archetypeId: "counselling",
    name: "Counselling / Therapy",
    category: "healthcare-wellness",
    ctaType: "booking",
    tags: ["mental health", "therapy", "counselling", "appointment"],
    itemTemplates: [
      { name: "Free Initial Consultation", description: "15-minute call to discuss your needs", priceType: "free", bookingDurationMinutes: 15 },
      { name: "Individual Session", description: "One-to-one therapy session", priceType: "per-session", bookingDurationMinutes: 60 },
      { name: "Couples Session", description: "Session for couples or partners", priceType: "per-session", bookingDurationMinutes: 75 },
      { name: "Group Therapy", description: "Facilitated group session", priceType: "per-session", bookingDurationMinutes: 90 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "about", title: "About", sortOrder: 1 },
      { type: "items", title: "Sessions", sortOrder: 2 },
      { type: "team", title: "Our Therapists", sortOrder: 3 },
      { type: "contact", title: "Get in Touch", sortOrder: 4 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "sessionType", label: "Session type", type: "select" as const, required: true, options: ["Individual", "Couples", "Group"] },
      { name: "preferredContact", label: "Preferred contact method", type: "select" as const, required: false, options: ["Email", "Phone", "Either"] },
    ],
    schedulingDefaults: HEALTHCARE_SCHEDULING,
  },
  {
    archetypeId: "optician",
    name: "Optician",
    category: "healthcare-wellness",
    ctaType: "booking",
    tags: ["vision", "eyes", "healthcare", "appointment"],
    itemTemplates: [
      { name: "Eye Test", description: "Full sight test and eye health examination", priceType: "fixed", bookingDurationMinutes: 30 },
      { name: "Contact Lens Consultation", description: "Assessment and fitting for contact lenses", priceType: "fixed", bookingDurationMinutes: 45 },
      { name: "Glasses Frames", description: "Browse our range of designer and own-brand frames", priceType: "from", ctaType: "purchase" },
      { name: "Prescription Lenses", description: "Single-vision, varifocal, and tinted lenses", priceType: "from", ctaType: "purchase" },
      { name: "Children's Eye Test", description: "NHS-funded sight test for under-16s", priceType: "free", bookingDurationMinutes: 30 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "items", title: "Services & Products", sortOrder: 1 },
      { type: "about", title: "About Us", sortOrder: 2 },
      { type: "gallery", title: "Our Frames", sortOrder: 3 },
      { type: "contact", title: "Visit Us", sortOrder: 4 },
    ],
    formSchema: BOOKING_CONTACT_FIELDS,
    schedulingDefaults: HEALTHCARE_SCHEDULING,
  },
];
