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

const BEAUTY_SCHEDULING: SchedulingDefaults = {
  schedulingPattern: "slot",
  assignmentMode: "customer-choice",
  defaultOperatingHours: [1, 2, 3, 4, 5, 6].map((day) => ({ day, start: "09:00", end: "18:00" })),
  defaultBeforeBuffer: 0,
  defaultAfterBuffer: 10,
  minimumNoticeHours: 2,
  maxAdvanceDays: 60,
};

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 },
];

const BEAUTY_ACTIVATION_PROFILE: ArchetypeDefinition["activationProfile"] = {
  profileType: "standard",
  modules: ["integrations"],
  billingReadinessMode: "none",
  customerGraph: "none",
  estateSeparation: "shared",
  axes: {
    form: "services",
    delivery: "physical",
    primaryConsumer: "individual",
    consumptionChannel: "physical",
    commercialModel: "appointment-checkout",
    provisioning: "account-with-billing",
    platform: "no",
  },
  portfolios: {
    foundational: { scope: "minimal" },
    manufactureAndDeliver: { scope: "minimal" },
    forEmployees: { scope: "minimal" },
    productsAndServicesSold: { scope: "primary" },
  },
};

export const beautyPersonalCareArchetypes: ArchetypeDefinition[] = [
  {
    archetypeId: "hair-salon",
    name: "Hair Salon",
    category: "beauty-personal-care",
    ctaType: "booking",
    tags: ["hair", "beauty", "salon", "appointment"],
    itemTemplates: [
      { name: "Haircut", description: "Precision cut styled to your preference", priceType: "from", bookingDurationMinutes: 45 },
      { name: "Colour", description: "Full head colour treatment", priceType: "from", bookingDurationMinutes: 90 },
      { name: "Highlights", description: "Partial or full highlights", priceType: "from", bookingDurationMinutes: 120 },
      { name: "Blow-dry", description: "Professional blow-dry and style", priceType: "fixed", bookingDurationMinutes: 30 },
      { name: "Treatment", description: "Deep conditioning or keratin treatment", priceType: "from", bookingDurationMinutes: 60 },
      { name: "Children's Cut", description: "Haircut for children under 12", priceType: "fixed", bookingDurationMinutes: 30 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "items", title: "Services", sortOrder: 1 },
      { type: "about", title: "About Us", sortOrder: 2 },
      { type: "gallery", title: "Our Work", sortOrder: 3 },
      { type: "testimonials", title: "What Clients Say", sortOrder: 4 },
      { type: "contact", title: "Book Now", sortOrder: 5 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "preferredStyle", label: "Preferred style", type: "select" as const, required: false, options: ["Classic", "Modern", "Edgy", "Natural", "Not sure"] },
      { name: "stylistPreference", label: "Stylist preference", type: "text" as const, required: false, placeholder: "Leave blank for any available" },
    ],
    schedulingDefaults: BEAUTY_SCHEDULING,
    activationProfile: BEAUTY_ACTIVATION_PROFILE,
  },
  {
    archetypeId: "barber-shop",
    name: "Barber Shop",
    category: "beauty-personal-care",
    ctaType: "booking",
    tags: ["barber", "hair", "men", "grooming"],
    itemTemplates: [
      { name: "Haircut", description: "Classic or modern cut to your style", priceType: "fixed", bookingDurationMinutes: 30 },
      { name: "Beard Trim", description: "Shape and neaten your beard", priceType: "fixed", bookingDurationMinutes: 20 },
      { name: "Hot Towel Shave", description: "Traditional wet shave with hot towel finish", priceType: "fixed", bookingDurationMinutes: 45 },
      { name: "Fade", description: "Precision fade cut", priceType: "fixed", bookingDurationMinutes: 40 },
      { name: "Cut & Beard Combo", description: "Haircut plus beard trim", priceType: "fixed", bookingDurationMinutes: 50 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "items", title: "Services", sortOrder: 1 },
      { type: "about", title: "About the Shop", sortOrder: 2 },
      { type: "gallery", title: "The Cuts", sortOrder: 3 },
      { type: "contact", title: "Find Us", sortOrder: 4 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "barberPreference", label: "Barber preference", type: "text" as const, required: false, placeholder: "Leave blank for next available" },
    ],
    schedulingDefaults: BEAUTY_SCHEDULING,
    activationProfile: BEAUTY_ACTIVATION_PROFILE,
  },
  {
    archetypeId: "nail-salon",
    name: "Nail Salon",
    category: "beauty-personal-care",
    ctaType: "booking",
    tags: ["nails", "beauty", "manicure", "pedicure"],
    itemTemplates: [
      { name: "Manicure", description: "Classic manicure with nail shaping and polish", priceType: "fixed", bookingDurationMinutes: 45 },
      { name: "Pedicure", description: "Foot treatment and toe nail care", priceType: "fixed", bookingDurationMinutes: 60 },
      { name: "Gel Nails", description: "Long-lasting gel polish application", priceType: "from", bookingDurationMinutes: 60 },
      { name: "Nail Art", description: "Custom nail art designs", priceType: "from", bookingDurationMinutes: 75 },
      { name: "Acrylic Nails", description: "Acrylic nail extensions", priceType: "from", bookingDurationMinutes: 90 },
      { name: "Nail Removal", description: "Safe removal of gel or acrylic nails", priceType: "fixed", bookingDurationMinutes: 30 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "items", title: "Services", sortOrder: 1 },
      { type: "gallery", title: "Nail Gallery", sortOrder: 2 },
      { type: "about", title: "About Us", sortOrder: 3 },
      { type: "contact", title: "Book an Appointment", sortOrder: 4 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "nailLength", label: "Nail length preference", type: "select" as const, required: false, options: ["Short", "Medium", "Long", "Extra long"] },
    ],
    schedulingDefaults: BEAUTY_SCHEDULING,
    activationProfile: BEAUTY_ACTIVATION_PROFILE,
  },
  {
    archetypeId: "beauty-spa",
    name: "Beauty Spa",
    category: "beauty-personal-care",
    ctaType: "booking",
    tags: ["spa", "beauty", "relaxation", "wellness"],
    itemTemplates: [
      { name: "Facial", description: "Cleansing and rejuvenating facial treatment", priceType: "from", bookingDurationMinutes: 60 },
      { name: "Massage", description: "Full body relaxation massage", priceType: "from", bookingDurationMinutes: 60 },
      { name: "Waxing", description: "Body waxing — various areas available", priceType: "from", bookingDurationMinutes: 30 },
      { name: "Eyebrow Threading", description: "Precise eyebrow shaping by threading", priceType: "fixed", bookingDurationMinutes: 20 },
      { name: "Lash Extensions", description: "Individual lash extension application", priceType: "from", bookingDurationMinutes: 90 },
      { name: "Spa Day Package", description: "Full day of pampering treatments", priceType: "from", bookingDurationMinutes: 300 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "items", title: "Treatments", sortOrder: 1 },
      { type: "about", title: "About the Spa", sortOrder: 2 },
      { type: "gallery", title: "Our Space", sortOrder: 3 },
      { type: "testimonials", title: "Client Reviews", sortOrder: 4 },
      { type: "contact", title: "Book a Treatment", sortOrder: 5 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "skinType", label: "Skin type", type: "select" as const, required: false, options: ["Normal", "Dry", "Oily", "Combination", "Sensitive"] },
      { name: "allergies", label: "Allergies or sensitivities", type: "textarea" as const, required: false },
    ],
    schedulingDefaults: BEAUTY_SCHEDULING,
    activationProfile: BEAUTY_ACTIVATION_PROFILE,
  },
  {
    archetypeId: "personal-trainer",
    name: "Personal Trainer",
    category: "beauty-personal-care",
    ctaType: "booking",
    tags: ["fitness", "training", "health", "personal trainer"],
    itemTemplates: [
      { name: "Initial Assessment", description: "Full fitness assessment and goal-setting session", priceType: "free", bookingDurationMinutes: 60 },
      { name: "1-Hour PT Session", description: "One-to-one personal training session", priceType: "per-session", bookingDurationMinutes: 60 },
      { name: "Block of 10 Sessions", description: "10 PT sessions at a discounted rate", priceType: "fixed", ctaType: "purchase" },
      { name: "Online Coaching", description: "Remote coaching with custom programme delivery", priceType: "per-session" },
      { name: "Group Bootcamp", description: "Small group outdoor training session", priceType: "per-session", bookingDurationMinutes: 45 },
    ],
    sectionTemplates: [
      { type: "hero", title: "Hero", sortOrder: 0 },
      { type: "about", title: "About", sortOrder: 1 },
      { type: "items", title: "Training Packages", sortOrder: 2 },
      { type: "testimonials", title: "Client Results", sortOrder: 3 },
      { type: "contact", title: "Start Your Journey", sortOrder: 4 },
    ],
    formSchema: [
      ...BOOKING_CONTACT_FIELDS,
      { name: "fitnessGoal", label: "Fitness goal", type: "select" as const, required: true, options: ["Weight loss", "Muscle gain", "Endurance", "General fitness", "Sport-specific", "Rehabilitation"] },
      { name: "experienceLevel", label: "Experience level", type: "select" as const, required: false, options: ["Beginner", "Intermediate", "Advanced"] },
    ],
    schedulingDefaults: BEAUTY_SCHEDULING,
    activationProfile: BEAUTY_ACTIVATION_PROFILE,
  },
];
