export type PortfolioWorkbookSheet = {
  key: string;
  label: string;
  description: string;
  columns: string[];
  requiredColumns: string[];
  exampleRow: Record<string, string>;
};

export const portfolioWorkbookSheets: PortfolioWorkbookSheet[] = [
  {
    key: 'tenants',
    label: 'tenants',
    description: 'Create or match tenant workspaces first. Tenants can be referenced later by ID, slug, or exact name.',
    columns: ['id', 'name', 'slug', 'legal_name', 'primary_domain', 'timezone', 'default_currency', 'is_active', 'importHash'],
    requiredColumns: ['name'],
    exampleRow: {
      id: '',
      name: 'Corporate Stay Portal',
      slug: 'corporate-stay-portal',
      legal_name: 'Corporate Stay Portal LLC',
      primary_domain: 'corpstay.example.com',
      timezone: 'America/New_York',
      default_currency: 'USD',
      is_active: 'true',
      importHash: 'tenant-csp-001',
    },
  },
  {
    key: 'organizations',
    label: 'organizations',
    description: 'Create customer organizations and link each row to a tenant from the tenants sheet or an already existing tenant.',
    columns: ['id', 'tenant', 'name', 'importHash'],
    requiredColumns: ['tenant', 'name'],
    exampleRow: {
      id: '',
      tenant: 'corporate-stay-portal',
      name: 'Acme Hospitality',
      importHash: 'org-acme-001',
    },
  },
  {
    key: 'properties',
    label: 'properties',
    description: 'Create properties and link them to their tenant and organization. Organization can be referenced by ID or exact name.',
    columns: ['id', 'tenant', 'organization', 'name', 'code', 'address', 'city', 'country', 'timezone', 'description', 'is_active', 'importHash'],
    requiredColumns: ['organization', 'name'],
    exampleRow: {
      id: '',
      tenant: 'corporate-stay-portal',
      organization: 'Acme Hospitality',
      name: 'Sunset Suites San Francisco',
      code: 'SUNSET-SF',
      address: '123 Market Street',
      city: 'San Francisco',
      country: 'USA',
      timezone: 'America/Los_Angeles',
      description: 'Primary Bay Area corporate stay property',
      is_active: 'true',
      importHash: 'property-sunset-sf-001',
    },
  },
  {
    key: 'unit_types',
    label: 'unit_types',
    description: 'Create unit types after properties. Property can be referenced by ID, property code, or exact property name.',
    columns: ['id', 'property', 'name', 'code', 'description', 'max_occupancy', 'bedrooms', 'bathrooms', 'minimum_stay_nights', 'size_sqm', 'base_nightly_rate', 'base_monthly_rate', 'importHash'],
    requiredColumns: ['property', 'name'],
    exampleRow: {
      id: '',
      property: 'SUNSET-SF',
      name: 'Studio Suite',
      code: 'STD-STUDIO',
      description: 'Furnished studio for short-term assignments',
      max_occupancy: '2',
      bedrooms: '1',
      bathrooms: '1',
      minimum_stay_nights: '30',
      size_sqm: '42',
      base_nightly_rate: '185',
      base_monthly_rate: '4200',
      importHash: 'unit-type-studio-001',
    },
  },
  {
    key: 'units',
    label: 'units',
    description: 'Create individual units after unit types. Unit type can be referenced by ID, code, or exact unit type name within the property.',
    columns: ['id', 'property', 'unit_type', 'unit_number', 'floor', 'status', 'max_occupancy_override', 'notes', 'importHash'],
    requiredColumns: ['property', 'unit_type', 'unit_number'],
    exampleRow: {
      id: '',
      property: 'SUNSET-SF',
      unit_type: 'STD-STUDIO',
      unit_number: '1205',
      floor: '12',
      status: 'available',
      max_occupancy_override: '2',
      notes: 'Corner studio with city view',
      importHash: 'unit-1205-001',
    },
  },
];
