import type { PriceUnit } from '@/services/catalog/types';
import type { NurseGender, NurseReviewSnippet } from '../types';

/**
 * Canned discovery fixtures for the client-side mock — real-shaped verified nurses so C1/C2/C3 demo
 * before the backend join/profile endpoints land. Ids align with the sibling mocks so the end-to-end
 * flow works with the geo picker + category grid: `serviceCategoryId` uses the catalog seed
 * (1 = elderly, 2 = post-surgery, 3 = infant, 4 = chronic), `cityId`/`districtId` use the geography
 * seed (Tehran = 101 with districts 1001…1022, Karaj = 801, whole-city = `null`). Mashhad/Isfahan/Shiraz
 * are intentionally left with **no** nurses so the C2 "relax your filters" empty state is reachable.
 *
 * Every nurse here is verified + accepting by construction (the invariant the real index enforces), so
 * the mock never returns an unverified row. `price` is IRR Rials as a digit-string (Toman × 10).
 * Avatars are `null` on purpose (initials fallback) to keep the demo self-contained — no remote images.
 */

/** One priced, bookable offering of a seeded nurse, matched in a covered area. */
export interface SeedVariant {
  variantId: number;
  serviceCategoryId: number;
  displayName: string;
  priceIrr: string;
  priceUnit: PriceUnit;
  sessionCount: number | null;
  cityId: number;
  /** `null` = the nurse covers the whole city. */
  districtId: number | null;
  /** Approximate distance from the searched area (mock-only stand-in for a future geo-distance join). */
  distanceKm: number | null;
}

/** A seeded verified nurse + their offerings and latest review (the mock's source of truth). */
export interface SeedNurse {
  nurseId: number;
  nurseName: string;
  avatarUrl: string | null;
  bio: string;
  yearsExperience: number;
  gender: NurseGender;
  averageRating: number;
  totalReviews: number;
  totalCompletedBookings: number;
  inoMembership: boolean;
  /** Specialty codes → i18n labels (never rendered raw). */
  attributeChips: string[];
  variants: SeedVariant[];
  latestReview: NurseReviewSnippet | null;
}

export const SEED_NURSES: SeedNurse[] = [
  {
    nurseId: 1,
    nurseName: 'مریم رضایی',
    avatarUrl: null,
    bio: 'پرستار سالمند با تمرکز بر مراقبت‌های شبانه‌روزی و پانسمان زخم.',
    yearsExperience: 8,
    gender: 'female',
    averageRating: 4.9,
    totalReviews: 37,
    totalCompletedBookings: 52,
    inoMembership: true,
    attributeChips: ['elderly', 'wound_care'],
    variants: [
      { variantId: 11, serviceCategoryId: 1, displayName: 'مراقبت روزانه سالمند', priceIrr: '2800000', priceUnit: 'per_hour', sessionCount: null, cityId: 101, districtId: 1003, distanceKm: 2.4 },
      { variantId: 12, serviceCategoryId: 1, displayName: 'مراقبت شبانه‌روزی سالمند', priceIrr: '85000000', priceUnit: 'per_24h', sessionCount: null, cityId: 101, districtId: 1003, distanceKm: 2.4 },
    ],
    latestReview: {
      rating: 5,
      body: 'بسیار دلسوز و منظم بودند. مادرم کاملاً راضی بود.',
      authorMasked: 'ز. م.',
      createdAt: '2026-06-20T09:30:00Z',
    },
  },
  {
    nurseId: 2,
    nurseName: 'سارا احمدی',
    avatarUrl: null,
    bio: 'پرستار مراقبت از سالمند و بیماری‌های مزمن، فعال در سراسر شهر تهران.',
    yearsExperience: 6,
    gender: 'female',
    averageRating: 4.7,
    totalReviews: 21,
    totalCompletedBookings: 33,
    inoMembership: true,
    attributeChips: ['elderly', 'icu'],
    variants: [
      { variantId: 21, serviceCategoryId: 1, displayName: 'مراقبت روزانه سالمند', priceIrr: '2500000', priceUnit: 'per_hour', sessionCount: null, cityId: 101, districtId: null, distanceKm: 5.1 },
      { variantId: 22, serviceCategoryId: 4, displayName: 'مدیریت بیماری مزمن', priceIrr: '30000000', priceUnit: 'per_day', sessionCount: null, cityId: 101, districtId: null, distanceKm: 5.1 },
    ],
    latestReview: {
      rating: 5,
      body: 'برخورد حرفه‌ای و به‌موقع. حتماً دوباره درخواست می‌دهم.',
      authorMasked: 'م. ک.',
      createdAt: '2026-06-28T14:10:00Z',
    },
  },
  {
    nurseId: 3,
    nurseName: 'زهرا موسوی',
    avatarUrl: null,
    bio: 'متخصص مراقبت پس از جراحی و پانسمان تخصصی زخم.',
    yearsExperience: 10,
    gender: 'female',
    averageRating: 4.8,
    totalReviews: 44,
    totalCompletedBookings: 61,
    inoMembership: true,
    attributeChips: ['post_surgery', 'wound_care'],
    variants: [
      { variantId: 31, serviceCategoryId: 2, displayName: 'مراقبت پس از جراحی', priceIrr: '3200000', priceUnit: 'per_hour', sessionCount: null, cityId: 101, districtId: 1005, distanceKm: 3.8 },
    ],
    latestReview: {
      rating: 4,
      body: 'مراقبت خوبی داشتند، فقط کمی دیر رسیدند.',
      authorMasked: 'ح. ر.',
      createdAt: '2026-05-30T11:00:00Z',
    },
  },
  {
    nurseId: 4,
    nurseName: 'علی کریمی',
    avatarUrl: null,
    bio: 'پرستار مراقبت‌های ویژه و مدیریت بیماری‌های مزمن.',
    yearsExperience: 7,
    gender: 'male',
    averageRating: 4.6,
    totalReviews: 18,
    totalCompletedBookings: 27,
    inoMembership: false,
    attributeChips: ['icu'],
    variants: [
      { variantId: 41, serviceCategoryId: 4, displayName: 'مدیریت بیماری مزمن', priceIrr: '2900000', priceUnit: 'per_hour', sessionCount: null, cityId: 101, districtId: 1002, distanceKm: 6.7 },
    ],
    latestReview: {
      rating: 5,
      body: 'دقیق و مسئولیت‌پذیر. پیگیری داروها عالی بود.',
      authorMasked: 'ع. ن.',
      createdAt: '2026-06-15T08:45:00Z',
    },
  },
  {
    nurseId: 5,
    nurseName: 'رضا حسینی',
    avatarUrl: null,
    bio: 'پرستار سالمند در کرج، فعال در تمام مناطق شهر.',
    yearsExperience: 5,
    gender: 'male',
    averageRating: 4.5,
    totalReviews: 12,
    totalCompletedBookings: 19,
    inoMembership: false,
    attributeChips: ['elderly'],
    variants: [
      { variantId: 51, serviceCategoryId: 1, displayName: 'مراقبت روزانه سالمند', priceIrr: '2200000', priceUnit: 'per_hour', sessionCount: null, cityId: 801, districtId: null, distanceKm: null },
    ],
    latestReview: null,
  },
  {
    nurseId: 6,
    nurseName: 'فاطمه صادقی',
    avatarUrl: null,
    bio: 'پرستار نوزاد با تجربه در مراقبت روزانه و شبانه.',
    yearsExperience: 9,
    gender: 'female',
    averageRating: 4.9,
    totalReviews: 29,
    totalCompletedBookings: 40,
    inoMembership: true,
    attributeChips: ['pediatric'],
    variants: [
      { variantId: 61, serviceCategoryId: 3, displayName: 'مراقبت روزانه نوزاد', priceIrr: '3000000', priceUnit: 'per_hour', sessionCount: null, cityId: 101, districtId: 1008, distanceKm: 4.2 },
    ],
    latestReview: {
      rating: 5,
      body: 'با نوزاد ما فوق‌العاده مهربان بودند. بسیار حرفه‌ای.',
      authorMasked: 'س. ط.',
      createdAt: '2026-07-01T16:20:00Z',
    },
  },
];
