import type { ServiceCategory, ServiceOptionGroup } from '../types';

/**
 * Canned catalog skeleton for the client-side mock. The **categories mirror the b5 seed exactly**
 * (ids 1–5, `sortOrder` 0–4, `nameFa`/`nameEn` from the contract "Seed" section) so swapping to the
 * live endpoint returns the same set. `iconKey`s map to registered AppIcon names (the tile falls
 * back gracefully for unknown/missing keys, matching real data whose `iconKey` we don't control).
 *
 * **Option groups/values are NOT seeded on a fresh real DB** (an admin authors them per category —
 * see the contract). The mock seeds a representative set anyway so the builder's required/optional
 * validation, cross-category groups, and the duplicate-listing 409 are all demonstrable end-to-end.
 * This is the one place the mock is intentionally *richer* than a fresh backend; recorded in the
 * mock registry. Real data comes from the server; this file is imported nowhere in the production path.
 */

export const SEED_CATEGORIES: ServiceCategory[] = [
  { id: 1, nameFa: 'مراقبت از سالمند', nameEn: 'Elderly Care', descriptionFa: null, descriptionEn: null, iconKey: 'elderly', sortOrder: 0, isActive: true },
  { id: 2, nameFa: 'مراقبت پس از جراحی', nameEn: 'Post-Surgery Recovery', descriptionFa: null, descriptionEn: null, iconKey: 'post_surgery', sortOrder: 1, isActive: true },
  { id: 3, nameFa: 'مراقبت از نوزاد', nameEn: 'Infant Care', descriptionFa: null, descriptionEn: null, iconKey: 'infant', sortOrder: 2, isActive: true },
  { id: 4, nameFa: 'مدیریت بیماری مزمن', nameEn: 'Chronic Illness Management', descriptionFa: null, descriptionEn: null, iconKey: 'chronic', sortOrder: 3, isActive: true },
  { id: 5, nameFa: 'همراهی و مراقبت روزمره', nameEn: 'Companionship', descriptionFa: null, descriptionEn: null, iconKey: 'companionship', sortOrder: 4, isActive: true },
];

/**
 * Option groups keyed to categories, plus one cross-category (`serviceCategoryId: null`) group that
 * applies to every category. Every row is active; the mock never returns inactive rows (the real
 * server filters them). Values carry `isActive` so an inactive value would be dropped downstream.
 */
export const SEED_OPTION_GROUPS: ServiceOptionGroup[] = [
  {
    id: 11,
    serviceCategoryId: 1,
    nameFa: 'نوع شیفت',
    nameEn: 'Shift type',
    isRequired: true,
    sortOrder: 1,
    isActive: true,
    values: [
      { id: 101, nameFa: 'روزانه', nameEn: 'Daytime', sortOrder: 1, isActive: true },
      { id: 102, nameFa: 'شبانه', nameEn: 'Overnight', sortOrder: 2, isActive: true },
      { id: 103, nameFa: 'شبانه‌روزی', nameEn: 'Live-in', sortOrder: 3, isActive: true },
    ],
  },
  {
    id: 12,
    serviceCategoryId: 1,
    nameFa: 'تعداد بیمار',
    nameEn: 'Number of patients',
    isRequired: false,
    sortOrder: 2,
    isActive: true,
    values: [
      { id: 111, nameFa: 'یک نفر', nameEn: 'One', sortOrder: 1, isActive: true },
      { id: 112, nameFa: 'دو نفر', nameEn: 'Two', sortOrder: 2, isActive: true },
    ],
  },
  {
    id: 21,
    serviceCategoryId: 2,
    nameFa: 'نوع مراقبت',
    nameEn: 'Care type',
    isRequired: true,
    sortOrder: 1,
    isActive: true,
    values: [
      { id: 201, nameFa: 'پانسمان و مراقبت زخم', nameEn: 'Wound care & dressing', sortOrder: 1, isActive: true },
      { id: 202, nameFa: 'تزریقات و سرم', nameEn: 'Injections & IV', sortOrder: 2, isActive: true },
      { id: 203, nameFa: 'فیزیوتراپی سبک', nameEn: 'Light physiotherapy', sortOrder: 3, isActive: true },
    ],
  },
  {
    id: 31,
    serviceCategoryId: 3,
    nameFa: 'نوع خدمت',
    nameEn: 'Service type',
    isRequired: true,
    sortOrder: 1,
    isActive: true,
    values: [
      { id: 301, nameFa: 'مراقبت روزانه نوزاد', nameEn: 'Daytime infant care', sortOrder: 1, isActive: true },
      { id: 302, nameFa: 'مراقبت شبانه نوزاد', nameEn: 'Overnight infant care', sortOrder: 2, isActive: true },
    ],
  },
  {
    // Cross-category: applies to every category (Chronic Illness & Companionship have only this one).
    id: 90,
    serviceCategoryId: null,
    nameFa: 'محل ارائه خدمت',
    nameEn: 'Service location',
    isRequired: false,
    sortOrder: 5,
    isActive: true,
    values: [
      { id: 901, nameFa: 'منزل', nameEn: 'Home', sortOrder: 1, isActive: true },
      { id: 902, nameFa: 'بیمارستان', nameEn: 'Hospital', sortOrder: 2, isActive: true },
    ],
  },
];
