{"version":3,"sources":["../src/common/Country.ts","../src/common/Media.ts","../src/common/Currency.ts","../src/common/Date.ts","../src/account/types.ts","../src/ai/types.ts","../src/accountBranch/types.ts","../src/accountDeliveryOption/types.ts","../src/accountDomain/types.ts","../src/accountEmailDomain/types.ts","../src/accountIntegration/types.ts","../src/accountPaymentMethod/types.ts","../src/accountPaymentMethod/helpers.ts","../src/accountPaymentMethod/resolveChargeCurrency.ts","../src/cart/types.ts","../src/cart/dto.ts","../src/customer/types.ts","../src/integration/types.ts","../src/integration/helpers.ts","../src/order/types.ts","../src/fulfillment/types.ts","../src/order/helpers.ts","../src/payment/types.ts","../src/payment/helpers.ts","../src/payment/supportedPaymentMethodsOrder.ts","../src/product/types.ts","../src/product/helpers.ts","../src/promotion/types.ts","../src/productAttribute/types.ts","../src/productCategory/types.ts","../src/sizeGuide/types.ts","../src/collection/types.ts","../src/campaign/types.ts","../src/standardCategory/types.ts","../src/storeBanner/types.ts","../src/storePage/types.ts","../src/pubsub/types.ts","../src/supportConversation/types.ts","../src/fulfillment/helpers.ts","../src/storeCustomization/types.ts","../src/storeCustomization/revisionTypes.ts","../src/storeCustomization/normalizeLayout.ts","../src/geoZone/types.ts","../src/integrationDeliveryZone/types.ts","../src/accountExchangeRate/types.ts","../src/storeTemplate/portable.ts","../src/analytics/types.ts","../src/notificationSettings.ts","../src/serviceBilling/types.ts","../src/serviceBilling/billingSchedule.ts","../src/holiday/types.ts","../src/lead/types.ts","../src/gestionUser/types.ts","../src/chatbot/tone.ts"],"sourcesContent":["// shared-types/src/common/Country.ts - Supported country codes and default config per country\n\nexport const SUPPORTED_COUNTRIES = ['UY', 'AR'] as const\nexport type SupportedCountryCode = (typeof SUPPORTED_COUNTRIES)[number]\n\nexport function isSupportedCountry(code: string): code is SupportedCountryCode {\n    return SUPPORTED_COUNTRIES.includes(code as SupportedCountryCode)\n}\n\nexport interface CountryDefaultBranchAddress {\n    country: string\n    department: string\n    locality: string\n    street: string\n    number: string\n    mapPosition: { lat: number; lng: number }\n}\n\nexport interface CountryDefaultTax {\n    name: string\n    rate: number\n    rateType: string\n}\n\nexport interface CountryDefaultConfig {\n    /** Display name for the country (e.g. for select options). */\n    name: string\n    timezone: string\n    currency: string\n    phoneCountryCode: string\n    locale: string\n    defaultBranchAddress: CountryDefaultBranchAddress\n    defaultTaxes: CountryDefaultTax[]\n}\n\n/** Default configurations for enabled countries. Only countries with defaults are listed. */\nexport const COUNTRY_DEFAULTS: Record<string, CountryDefaultConfig> = {\n    UY: {\n        name: 'Uruguay',\n        timezone: 'America/Montevideo',\n        currency: 'UYU',\n        phoneCountryCode: '+598',\n        locale: 'es-UY',\n        defaultBranchAddress: {\n            country: 'Uruguay',\n            department: 'Montevideo',\n            locality: 'Centro',\n            street: 'Calle 123',\n            number: '123',\n            mapPosition: { lat: -34.9211269, lng: -56.161656 },\n        },\n        defaultTaxes: [{ name: 'IVA', rate: 22, rateType: 'PERCENTAGE' }],\n    },\n    AR: {\n        name: 'Argentina',\n        timezone: 'America/Argentina/Buenos_Aires',\n        currency: 'ARS',\n        phoneCountryCode: '+54',\n        locale: 'es-AR',\n        defaultBranchAddress: {\n            country: 'Argentina',\n            department: 'Buenos Aires',\n            locality: 'CABA',\n            street: 'Calle ejemplo',\n            number: '123',\n            mapPosition: { lat: -34.6037, lng: -58.3816 },\n        },\n        defaultTaxes: [{ name: 'IVA', rate: 21, rateType: 'PERCENTAGE' }],\n    },\n}\n\nexport function getCountryDefaults(code: string): CountryDefaultConfig | null {\n    if (!code || code.length !== 2) return null\n    const key = code.toUpperCase()\n    return COUNTRY_DEFAULTS[key] ?? null\n}\n","/**\n * Entidad Media\n * Se utiliza para almacenar y gestionar archivos y recursos multimedia.\n */\n\nexport interface Media {\n  id: string;\n  accountId: string;\n  filename: string;\n  url: string;\n  thumbnailUrl: string;\n  mimeType: string;\n  extension: string;\n  size: number;\n  type: MediaType;\n  altText: string;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n}\n\nexport enum MediaType {\n  IMAGE = 'IMAGE',\n  VIDEO = 'VIDEO',\n  FAVICON = 'FAVICON',\n  DOCUMENT = 'DOCUMENT',\n  AUDIO = 'AUDIO',\n  ARCHIVE = 'ARCHIVE',\n  OTHER = 'OTHER',\n}\n\n\n","export enum Currency {\n  ARS = 'ARS', // Peso argentino\n  BRL = 'BRL', // Real brasileño\n  CLP = 'CLP', // Peso chileno\n  COP = 'COP', // Peso colombiano\n  EUR = 'EUR', // Euro\n  MXN = 'MXN', // Peso mexicano\n  PEN = 'PEN', // Sol peruano\n  PYG = 'PYG', // Guaraní paraguayo\n  USD = 'USD', // Dólar estadounidense\n  UYU = 'UYU', // Peso uruguayo\n}\n\n\n\nexport function getCurrencySymbol(currencyCode: Currency): string {\n  const currencySymbols: { [key: string]: string } = {\n      [Currency.USD]: 'U$S',\n      [Currency.EUR]: '€',\n      [Currency.UYU]: '$',\n      [Currency.ARS]: '$',\n      [Currency.BRL]: 'R$',\n  };\n  \n  return currencySymbols[currencyCode] || currencyCode.toString();\n} \n\n\n/**\n * Analiza un patrón de formato de precio y extrae la configuración necesaria\n * @param pattern - Patrón de ejemplo como '1,000.12', '1.000,12', '1000.12', '1000'\n * @returns Configuración de formato de precio para Intl.NumberFormat\n * \n * Patrones soportados:\n * - '1.000,12' → es-ES (punto para miles, coma para decimales)\n * - '1,000.12' → en-US (coma para miles, punto para decimales)\n * - '1000,12'  → sin separador de miles, coma para decimales\n * - '1000.12'  → sin separador de miles, punto para decimales\n * - '1.000'    → punto para miles, sin decimales\n * - '1,000'    → coma para miles, sin decimales\n * - '1000'     → sin separadores, sin decimales\n */\nexport function parsePriceFormatPattern(pattern: string): {\n  locale: string;\n  useGrouping: boolean;\n  minimumFractionDigits: number;\n  maximumFractionDigits: number;\n} {\n  // Detectar separador de miles y decimales\n  const hasComma = pattern.includes(',');\n  const hasPeriod = pattern.includes('.');\n  \n  let locale = 'es-UY'; // Por defecto\n  let useGrouping = false;\n  let minimumFractionDigits = 0;\n  let maximumFractionDigits = 0;\n  \n  // Caso 1: Tiene coma y punto → determinar cuál es miles y cuál decimales\n  if (hasComma && hasPeriod) {\n      const commaIndex = pattern.indexOf(',');\n      const periodIndex = pattern.indexOf('.');\n      \n      if (commaIndex < periodIndex) {\n          // '1,000.12' → coma es miles, punto es decimales (formato en-US)\n          locale = 'en-US';\n          useGrouping = true;\n          const decimalPart = pattern.split('.')[1];\n          minimumFractionDigits = decimalPart ? decimalPart.length : 0;\n          maximumFractionDigits = decimalPart ? decimalPart.length : 2;\n      } else {\n          // '1.000,12' → punto es miles, coma es decimales (formato es-ES)\n          locale = 'es-ES';\n          useGrouping = true;\n          const decimalPart = pattern.split(',')[1];\n          minimumFractionDigits = decimalPart ? decimalPart.length : 0;\n          maximumFractionDigits = decimalPart ? decimalPart.length : 2;\n      }\n  }\n  // Caso 2: Solo tiene coma\n  else if (hasComma && !hasPeriod) {\n      const parts = pattern.split(',');\n      const integerPart = parts[0];\n      const decimalPart = parts[1];\n      \n      // Si la parte después de la coma tiene más de 2 dígitos, es separador de miles\n      // Ejemplo: '1,000' → miles\n      // Ejemplo: '1000,12' → decimales\n      if (decimalPart && decimalPart.length <= 2 && integerPart.length <= 4) {\n          // Es separador decimal\n          locale = 'es-ES';\n          useGrouping = false;\n          minimumFractionDigits = decimalPart.length;\n          maximumFractionDigits = decimalPart.length;\n      } else if (decimalPart && decimalPart.length === 3) {\n          // Es separador de miles\n          locale = 'en-US';\n          useGrouping = true;\n          minimumFractionDigits = 0;\n          maximumFractionDigits = 0;\n      } else if (!decimalPart) {\n          // Solo una coma sin parte decimal, asumir formato internacional con miles\n          locale = 'en-US';\n          useGrouping = true;\n          minimumFractionDigits = 0;\n          maximumFractionDigits = 0;\n      }\n  }\n  // Caso 3: Solo tiene punto\n  else if (hasPeriod && !hasComma) {\n      const parts = pattern.split('.');\n      const integerPart = parts[0];\n      const decimalPart = parts[1];\n      \n      // Si la parte después del punto tiene más de 2 dígitos, es separador de miles\n      // Ejemplo: '1.000' → miles\n      // Ejemplo: '1000.12' → decimales\n      if (decimalPart && decimalPart.length <= 2 && integerPart.length <= 4) {\n          // Es separador decimal\n          locale = 'en-US';\n          useGrouping = false;\n          minimumFractionDigits = decimalPart.length;\n          maximumFractionDigits = decimalPart.length;\n      } else if (decimalPart && decimalPart.length === 3) {\n          // Es separador de miles\n          locale = 'es-ES';\n          useGrouping = true;\n          minimumFractionDigits = 0;\n          maximumFractionDigits = 0;\n      } else if (!decimalPart) {\n          // Solo un punto sin parte decimal\n          locale = 'es-ES';\n          useGrouping = true;\n          minimumFractionDigits = 0;\n          maximumFractionDigits = 0;\n      }\n  }\n  // Caso 4: Sin separadores\n  else {\n      // '1000' → sin separadores\n      locale = 'es-UY';\n      useGrouping = false;\n      minimumFractionDigits = 0;\n      maximumFractionDigits = 0;\n  }\n  \n  return {\n      locale,\n      useGrouping,\n      minimumFractionDigits,\n      maximumFractionDigits\n  };\n} \n\n\n","export enum DayOfWeek {\n    MONDAY = 'MONDAY',\n    TUESDAY = 'TUESDAY',\n    WEDNESDAY = 'WEDNESDAY',\n    THURSDAY = 'THURSDAY',\n    FRIDAY = 'FRIDAY',\n    SATURDAY = 'SATURDAY',\n    SUNDAY = 'SUNDAY',\n}","// shared-types/src/account/types.ts - Account entity types\nimport { AccountDomain } from '../accountDomain'\nimport { Seller } from '../seller'\n\n/** Billing data for Retaila service invoices (tenant / legal entity). Stored as JSON on `account.billingProfile`. */\nexport interface AccountBillingProfile {\n    legalName?: string | null\n    /** Tax id (e.g. RUT in UY/PY). */\n    taxId?: string | null\n    address?: string | null\n    billingContactEmail?: string | null\n    /**\n     * Whether VAT (IVA) is charged/invoiced on top of service amounts.\n     * Service plan amounts in the system are always stored net (sin IVA); this flag is for documents and UI.\n     */\n    invoiceVat?: boolean | null\n    /** VAT rate when `invoiceVat` is true (e.g. 22 for Uruguay). Percent 0–100. */\n    vatPercent?: number | null\n}\n\nexport interface Account {\n    id: string\n    name: string\n    slug: string\n    logoId?: string\n    currency: string\n    email: string\n    timezone: string\n    status: AccountStatus\n    country: string\n    themeConfig?: ThemeConfig\n    privateKey?: string\n    demo: boolean\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date\n    sellerId?: string\n    seller?: Seller\n    accountDomains?: AccountDomain[]\n    billingProfile?: AccountBillingProfile | null\n    /** Set when the backoffice onboarding wizard was finished successfully. */\n    onboardingWizardCompletedAt?: Date | null\n    /** Set when the merchant chose to skip the onboarding wizard. */\n    onboardingWizardSkippedAt?: Date | null\n    /** True until the wizard is completed or skipped (backoffice gate). */\n    needsOnboardingWizard?: boolean\n}\n\nexport enum AccountStatus {\n    ACTIVE = 'ACTIVE',\n    INACTIVE = 'INACTIVE',\n    PENDING = 'PENDING',\n    SUSPENDED = 'SUSPENDED',\n}\n\nexport interface ThemeConfig {\n    backgroundColor: string\n    textColor: string\n    primaryColor: string\n    secondaryColor: string\n}\n","// shared-types/src/ai/types.ts - AI credits entity types\n\nexport enum AiCreditType {\n    IMAGE = 'IMAGE',\n    TEXT = 'TEXT',\n}\n\nexport enum AiCreditSource {\n    FREE = 'FREE',\n    PAID = 'PAID',\n}\n\nexport enum AiCreditTransactionReason {\n    GENERATION = 'generation',\n    MONTHLY_REFILL = 'monthly_refill',\n    PURCHASE = 'purchase',\n    MANUAL_ADJUSTMENT = 'manual_adjustment',\n}\n\nexport interface AccountAiCredits {\n    accountId: string\n    monthlyFreeImageCredits: number\n    paidImageCredits: number\n    monthlyFreeTextCredits: number\n    paidTextCredits: number\n    lastMonthlyRefill: Date | null\n    updatedAt: Date\n}\n\nexport interface AccountAiCreditTransaction {\n    id: string\n    accountId: string\n    type: AiCreditType\n    amount: number\n    source: AiCreditSource\n    reason: AiCreditTransactionReason\n    createdAt: Date\n}\n\nexport interface AiCreditsBalance {\n    imageCredits: number\n    textCredits: number\n}\n","import { AccountDeliveryOption } from \"../accountDeliveryOption/types\";\nimport { Address, MapPosition, Phone } from \"../common\";\n\n/**\n * Entidad AccountBranch\n * Representa una sucursal de una cuenta.\n */\n\nexport interface AccountBranch {\n  id: string;\n  accountId: string;\n  name: string;\n  address?: Address;  \n  addressInstructions?: string;\n  isAddressPublic?: boolean;\n  phone?: Phone | null;\n  email?: string | null;\n  demo:boolean;\n  status: AccountBranchStatus; \n  isOpen?: boolean;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n\n  schedule: AccountBranchSchedule[];\n  deliveryOptions: AccountDeliveryOption[];\n}\n\nexport enum AccountBranchStatus {\n  ACTIVE = \"ACTIVE\",\n  INACTIVE = \"INACTIVE\"\n}\n\n \nexport interface AccountBranchSchedule {\n  id: string;\n  accountBranchId: string;\n  day: AccountBranchScheduleDay;\n  start: number;\n  end: number;\n  status: AccountBranchScheduleStatus;\n  demo:boolean;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n}\n\nexport enum AccountBranchScheduleStatus {\n  ACTIVE = \"ACTIVE\",\n  INACTIVE = \"INACTIVE\"\n}\n\nexport enum AccountBranchScheduleDay {\n  MONDAY = \"MONDAY\",\n  TUESDAY = \"TUESDAY\",\n  WEDNESDAY = \"WEDNESDAY\",\n  THURSDAY = \"THURSDAY\",\n  FRIDAY = \"FRIDAY\",\n  SATURDAY = \"SATURDAY\",\n  SUNDAY = \"SUNDAY\"\n}","import { MapPosition } from '../common'\nimport { AccountIntegration } from '../accountIntegration/types'\nimport { AccountBranch } from '../accountBranch/types'\nimport { GeoZone } from '../geoZone'\n\n/**\n * Delivery types to distinguish between shipping and pickup options\n */\nexport enum DeliveryType {\n    SHIPPING = 'SHIPPING',\n    PICKUP = 'PICKUP',\n}\n\n/**\n * Entidad AccountDeliveryOption\n * Representa una opción de envío de una cuenta.\n */\n\nexport interface AccountDeliveryOption {\n    id: string\n    accountId: string\n    accountBranchId: string\n    name: string\n    accountIntegrationId?: string\n    isScheduled: boolean\n    priceLogic: AccountDeliveryOptionPriceLogic\n    status: AccountDeliveryOptionStatus\n    deliveryType: DeliveryType\n    demo: boolean\n    hideAccountBranchAddress: boolean // Si true, no se muestra la direccion de la sucursal en el checkout.\n    /** When true, estimated delivery times are calculated by AI and shown to customers at checkout */\n    showEstimatedDeliveryTime: boolean\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n    data?: Record<string, unknown>\n\n    deliveryZones: AccountDeliveryOptionZone[]\n    integration?: AccountIntegration | null\n    price?: number | null\n    accountBranch?: AccountBranch | null\n    /** Computed by api-public when listing delivery options; ISO date strings */\n    estimatedDelivery?: {\n        start: string\n        end: string\n    }\n}\n\nexport enum AccountDeliveryOptionPriceLogic {\n    FIXED = 'FIXED',\n    BY_ZONE = 'BY_ZONE',\n    PROVIDER = 'PROVIDER',\n    /** @deprecated Use BY_ZONE instead */\n    CALCULATED = 'CALCULATED',\n}\n\nexport enum AccountDeliveryOptionStatus {\n    ACTIVE = 'ACTIVE',\n    INACTIVE = 'INACTIVE',\n}\n\nexport interface AccountDeliveryOptionCalculatedCost {\n    basePrice: number\n    distanceKm: number\n    finalPrice: number\n    priceLogic: AccountDeliveryOptionPriceLogic\n    currency: string\n}\n\nexport interface AccountDeliveryOptionZone {\n    id: string\n    accountId: string\n    accountDeliveryOptionId: string\n    geoZoneId: string\n    price?: number | null\n    status: AccountDeliveryOptionZoneStatus\n    demo: boolean\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n\n    // Relations\n    geoZone?: GeoZone\n}\n\nexport enum AccountDeliveryOptionZoneStatus {\n    ACTIVE = 'ACTIVE',\n    INACTIVE = 'INACTIVE',\n}\n\n// DTO Types for API operations\nexport interface DeliveryZoneInput {\n    geoZoneId?: string\n    geoZone?: GeoZoneInput\n    price?: number | null\n}\n\nexport interface GeoZoneInput {\n    name: string\n    area: MapPosition[]\n    description?: string\n}\n\nexport interface CreateAccountDeliveryOptionDTO {\n    accountId: string\n    accountBranchId: string\n    name: string\n    accountIntegrationId?: string | null\n    isScheduled?: boolean\n    priceLogic?: AccountDeliveryOptionPriceLogic\n    price?: number\n    status?: AccountDeliveryOptionStatus\n    deliveryType: DeliveryType\n    deliveryZones?: DeliveryZoneInput[]\n    data?: Record<string, unknown>\n    showEstimatedDeliveryTime?: boolean\n}\n\nexport interface UpdateAccountDeliveryOptionDTO {\n    accountBranchId: string\n    name?: string\n    accountIntegrationId?: string | null\n    isScheduled?: boolean\n    priceLogic?: AccountDeliveryOptionPriceLogic\n    status?: AccountDeliveryOptionStatus\n    deliveryType?: DeliveryType\n    deliveryZones?: DeliveryZoneInput[]\n    data?: Record<string, unknown>\n    showEstimatedDeliveryTime?: boolean\n}\n\n/** Rule types for estimated delivery calculation */\nexport enum DeliveryOptionRuleType {\n    PROCESSING_DAYS = 'PROCESSING_DAYS',\n    SAME_DAY_CUTOFF = 'SAME_DAY_CUTOFF',\n    DELIVERY_DAYS = 'DELIVERY_DAYS',\n    PICKUP_READY_HOURS = 'PICKUP_READY_HOURS',\n    FIXED_OFFSET_DAYS = 'FIXED_OFFSET_DAYS',\n    /** ISO weekday numbers (1=Mon..7=Sun) that count as operating days */\n    BUSINESS_DAYS = 'BUSINESS_DAYS',\n    /** Delivery time-of-day window inferred by AI from historical orders */\n    DELIVERY_HOURS = 'DELIVERY_HOURS',\n    /** Extra days added to the pessimistic end when volume is high */\n    BUFFER_SAFETY_MARGIN = 'BUFFER_SAFETY_MARGIN',\n}\n\nexport interface AccountDeliveryOptionRule {\n    id: string\n    accountId: string\n    accountDeliveryOptionId: string\n    ruleType: DeliveryOptionRuleType\n    params?: Record<string, unknown>\n    priority: number\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\nexport interface CreateDeliveryOptionRuleDTO {\n    ruleType: DeliveryOptionRuleType\n    params?: Record<string, unknown>\n    priority?: number\n}\n\nexport interface UpdateDeliveryOptionRuleDTO {\n    ruleType?: DeliveryOptionRuleType\n    params?: Record<string, unknown>\n    priority?: number\n}\n\n/** Params per rule type for estimation */\nexport interface ProcessingDaysParams {\n    minDays: number\n    maxDays?: number\n}\n\nexport interface SameDayCutoffParams {\n    cutoffTime: string // \"HH:mm\"\n}\n\nexport interface DeliveryDaysParams {\n    minDays: number\n    maxDays: number\n}\n\nexport interface PickupReadyHoursParams {\n    hours?: number\n    minHours?: number\n    maxHours?: number\n}\n\nexport interface FixedOffsetDaysParams {\n    minDays: number\n    maxDays?: number\n}\n\nexport interface BusinessDaysParams {\n    /** ISO weekday numbers: 1=Monday … 7=Sunday */\n    days: number[]\n}\n\nexport interface DeliveryHoursParams {\n    /** Start of delivery window \"HH:mm\" */\n    start: string\n    /** End of delivery window \"HH:mm\" */\n    end: string\n}\n\nexport interface BufferSafetyMarginParams {\n    /** Extra days added to the pessimistic (end) delivery date */\n    extraDays: number\n}\n\n/** Unified delivery config shape used by the backoffice form */\nexport interface UnifiedDeliveryConfig {\n    businessDays: number[]\n    cutoffEnabled: boolean\n    cutoffTime: string\n    processingMinDays: number\n    processingMaxDays: number\n    deliveryMinDays: number\n    deliveryMaxDays: number\n    pickupHours: number\n}\n","/**\n * Entidad AccountDomain\n * Representa un dominio personalizado asociado a una cuenta.\n * Permite dominios completos y subdominios, con control de estado y verificación.\n */\n\nexport interface AccountDomain {\n  id: string;\n  accountId: string;\n  domain: string; /** Dominio completo (ej: example.com) */\n  subdomain?: string;/** Subdominio opcional (ej: shop, blog) */\n  isPrimary: boolean; /** Indica si este es el dominio principal de la cuenta */\n  preferWww: boolean; /** Preferencia de dominio: true = www.example.com, false = example.com */\n  status: AccountDomainStatus; /** Estado del dominio: PENDING, ACTIVE, INACTIVE */\n  verifiedAt?: Date; /** Fecha de verificación del dominio */\n  \n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n}\n\nexport enum AccountDomainStatus {\n  PENDING = \"PENDING\",\n  ACTIVE = \"ACTIVE\",\n  INACTIVE = \"INACTIVE\"\n}\n\n ","// shared-types/src/accountEmailDomain/types.ts\n\nexport enum AccountEmailDomainStatus {\n  PENDING = 'PENDING',\n  DNS_PENDING = 'DNS_PENDING',\n  ACTIVE = 'ACTIVE',\n  INACTIVE = 'INACTIVE',\n}\n\nexport interface AccountEmailDomain {\n  id: string;\n  accountId: string;\n  accountDomainId: string;\n  domain: string;\n  status: AccountEmailDomainStatus;\n  activatedAt: Date | null;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt: Date | null;\n}\n","import { Integration } from \"../integration\";\n/**\n * Entidad AccountIntegration\n * Contiene información de la integración y sus credenciales.\n */\n\nexport enum AccountIntegrationStatus {\n\tACTIVE = 'ACTIVE',\n\tINACTIVE = 'INACTIVE',\n\tBETA = 'BETA',\n\tDEPRECATED = 'DEPRECATED',\n}\nexport enum AccountIntegrationConnectionStatus {\n\tCONNECTED = 'CONNECTED',\n\tDISCONNECTED = 'DISCONNECTED',\n\tERROR = 'ERROR',\n\tWARNING = 'WARNING',\n}\n\nexport enum AccountIntegrationEnvironment {\n\tPRODUCTION = 'PRODUCTION',\n\tDEVELOPMENT = 'DEVELOPMENT',\n}\n\nexport interface AccountIntegration {\n\tid: string;\n\taccountId: string;\n\tintegrationId: string;\n\tsettingsProduction: Object | null;\n\tsettingsDevelopment: Object | null;\n\tenvironment: AccountIntegrationEnvironment;\n\tproductionStatus: AccountIntegrationConnectionStatus;\n\tdevelopmentStatus: AccountIntegrationConnectionStatus;\n\tstatus: AccountIntegrationStatus;\n\tdemo: boolean;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\n\tintegration: Integration;\n\n\tsettings: Record<string, any>; // settings for requested environment\n}","// shared-types/src/accountPaymentMethod/types.ts\n\nimport { Account } from \"../account\";\nimport { AccountIntegration } from \"../accountIntegration\";\nimport { Currency } from \"../common/Currency\";\nimport { StatusInfo } from \"../common/Status\";\nimport { EffectiveExchangeRate } from \"../accountExchangeRate/types\";\n\nexport enum AccountPaymentMethodStatus {\n  ACTIVE = 'ACTIVE', // Active\n  INACTIVE = 'INACTIVE', // Disabled\n}\n\nexport interface AccountPaymentMethod {\n  id: string;\n  accountId: string;\n  accountIntegrationId?: string;\n  name: string;\n  description?: string;\n  customerInstructions?: string;\n  order: number;\n  availableForWeb?: boolean;\n  \n  status: AccountPaymentMethodStatus;\n  demo: boolean;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date;\n\n  accountIntegration?: AccountIntegration;\n  account?: Account;\n  statusInfo?: StatusInfo;\n  typeName?: string;\n  /** Currency the gateway will charge in (API-resolved; do not infer from provider in UI). */\n  chargeCurrency?: Currency;\n  /** Present when account store currency differs from chargeCurrency and a rate exists. */\n  exchangeRate?: EffectiveExchangeRate;\n}","import { StatusInfo } from \"../common/Status\";\nimport { AccountPaymentMethodStatus } from \"./types\";\n\nexport function getAccountPaymentMethodStatusInfo(status: AccountPaymentMethodStatus): StatusInfo {\n\tconst map: Record<AccountPaymentMethodStatus, StatusInfo> = {\n\t\tACTIVE: { text: 'Activo', class: 'success', actionText: '' },\n\t\tINACTIVE: { text: 'Inactivo', class: 'danger', actionText: '' },\n\t};\n\n\treturn map[status] ?? { text: String(status), class: 'secondary' };\n}","// shared-types/src/accountPaymentMethod/resolveChargeCurrency.ts\nimport { Currency } from '../common/Currency'\n\nfunction normalizedAccountCurrency(accountCurrency?: string | null): Currency | undefined {\n    const t = accountCurrency?.trim()\n    if (!t) return undefined\n    return t as Currency\n}\n\n/**\n * Currency in which the payment gateway will settle the charge for checkout.\n * Centralizes provider-specific rules; consumers (e.g. storefront) should use\n * {@link AccountPaymentMethod.chargeCurrency} from the API instead of branching on providerKey.\n */\nexport function resolveChargeCurrency(params: {\n    providerKey?: string | null\n    settingsCurrency?: string | null\n    /** Store / account currency; used when settings omit currency or for MANUAL_PAYMENT. */\n    accountCurrency?: string | null\n}): Currency | undefined {\n    const pk = params.providerKey?.toUpperCase()\n    if (pk === 'PAYPAL') {\n        return Currency.USD\n    }\n    const accountCur = normalizedAccountCurrency(params.accountCurrency)\n    if (pk === 'MANUAL_PAYMENT') {\n        return accountCur\n    }\n    const raw = params.settingsCurrency?.trim()\n    if (!raw) {\n        return accountCur\n    }\n    return raw as Currency\n}\n","import { CartItemValidation } from './dto'\nimport { Customer } from '../customer'\nimport { AccountDomain } from '../accountDomain'\nimport { CartDeliveryMethod } from '../cartDeliveryMethod'\nimport { CartLineItemAdjustment } from '../promotion'\n\n/**\n * Entidad Cart\n * Define el carrito de compras de un cliente en el sitio web.\n */\n\nexport interface Cart {\n    id: string\n    code: string\n    customerId?: string\n    sessionId?: string\n    items: CartItem[]\n    currency: string\n    subtotal: number\n    total: number\n    deliveryType: CartDeliveryType\n    deliveryFirstName?: string\n    deliveryLastName?: string\n    deliveryAddress?: string\n    deliveryPhone?: string\n    pickupBranchId?: string\n    accountPaymentMethodId?: string\n    itemCount: number\n    createdAt: Date\n    updatedAt: Date\n    status: CartStatus\n    source: CartSource\n    sourceAccountDomainId?: string\n    recoveryToken?: string\n    customerNote?: string\n    hasIssues: boolean // Indica si el carrito tiene problemas que resolver\n    issuesCount: number // Número de items con problemas\n    // Nuevos campos de precios\n    subtotalPrice?: number\n    totalDiscounts?: number\n    totalShippingPrice?: number\n    totalTax?: number\n    totalPrice?: number\n    taxDetails?: any\n    /** BIN de la tarjeta (primeros 6–8 dígitos) cuando se escribe en el checkout; usado para promociones por BIN. */\n    cardBin?: string | null\n\n    customer?: Partial<Customer> | null\n    accountDomain?: Partial<AccountDomain> | null\n    deliveryMethod?: CartDeliveryMethod | null\n    promotions: {\n        code: string\n        amount: number\n        name?: string\n        description?: string\n        isAutomatic?: boolean\n    }[]\n    freeShippingProgress?: {\n        threshold: number\n        currentSubtotal: number\n        remaining: number\n        qualified: boolean\n    } | null\n}\n\nexport interface CartItem {\n    id: string\n    productId: string\n    productVariantId: string\n    name: string\n    unitPrice: number // Precio cuando se agregó al carrito\n    quantity: number\n    image?: string\n    thumbnailUrl?: string // URL del thumbnail de la variante\n    sku?: string\n    attributeDetails: CartItemAttributeDetail[] // Detalles legibles de atributos\n\n    validation?: CartItemValidation // Información de validación del item en dto\n    adjustments?: CartLineItemAdjustment[]\n}\n\nexport interface CartItemAttributeDetail {\n    name: string // Nombre del atributo (ej: \"Talle\", \"Color\")\n    alias: string // Alias del atributo (ej: \"size\", \"color\")\n    value: string // Valor del atributo (ej: \"M\", \"Rojo\")\n    type?: string // Tipo del atributo (opcional)\n}\n\nexport enum CartStatus {\n    ACTIVE = 'ACTIVE',\n    LOCKED = 'LOCKED',\n    EXPIRED = 'EXPIRED',\n    CONVERTED = 'CONVERTED',\n    ABANDONED = 'ABANDONED',\n    MERGED = 'MERGED',\n}\n\nexport enum CartSource {\n    WEB = 'WEB',\n    POS = 'POS',\n    API = 'API',\n}\n\nexport enum CartDeliveryType {\n    SHIPPING = 'SHIPPING',\n    PICKUP = 'PICKUP',\n}\n","import { OrderSource } from \"../order\";\n\n/**\n * Add an item to the cart\n*/\nexport interface CartItemAddDto {\n    cartId: string;\n    productId: string;\n    variantId?: string;\n    quantity: number;\n    attributes?: { [key: string]: string | number; };\n    userEmail?: string;\n    userId?: string;\n}\n\n/**\n * Update an item in the cart\n */\nexport interface CartItemUpdateDto {\n    cartId: string;\n    itemId: string;\n    quantity: number;\n}\n\n/**\n * Remove an item from the cart\n */\nexport interface CartItemRemoveDto {\n    cartId: string;\n    itemId: string;\n}\n\nexport interface CartUpdateDto {\n    cartId: string;\n    source: OrderSource;\n    accountDomainId?: string;\n    customer: {\n        email: string;\n    };\n    delivery: {\n        type: 'SHIPPING' | 'PICKUP';\n        pickupBranchId?: string;\n        firstname: string;\n        lastname: string;\n        phone: {\n            countryCode: string;\n            national: string;\n            international: string;\n            type: string;\n            validated: boolean;\n        };\n        address: {\n            country: string;\n            department: string;\n            locality: string;\n            street: string;\n            complement?: string;\n            notes?: string;\n            postalCode: string;\n            mapPosition: {\n                lat: number;\n                lng: number;\n            };\n        };\n    };\n    billing: {\n        name: string;\n        address: string;\n        city: string;\n        department: string;\n    };\n    accountPaymentMethodId?: string;\n    customerNote?: string | null;\n}\n\n/**\n * Confirm a cart\n */\nexport interface CartConfirmDto {\n    cartId: string;\n}\n\n/**\n * Validation information for a cart item\n */\nexport interface CartItemValidation {\n    hasIssues: boolean;              // Indica si hay problemas con este item\n    issues: string[];                // Lista de problemas encontrados (mensajes legibles)\n    errorCode?: CartItemErrorCode;   // Código específico del error principal\n    currentPrice?: number;           // Precio actual del producto (si cambió)\n    availableStock?: number;         // Stock disponible actual\n    isProductActive?: boolean;       // Si el producto está activo\n}\n\n/**\n * Error codes for cart items\n */\nexport enum CartItemErrorCode {\n    PRICE_INCREASED = 'PRICE_INCREASED',           // Precio aumentó\n    PRICE_DECREASED = 'PRICE_DECREASED',           // Precio disminuyó  \n    PRODUCT_INACTIVE = 'PRODUCT_INACTIVE',         // Producto ya no está disponible\n    STOCK_INSUFFICIENT = 'STOCK_INSUFFICIENT',     // Stock insuficiente (hay algo disponible)\n    STOCK_UNAVAILABLE = 'STOCK_UNAVAILABLE',       // Sin stock (0 disponible)\n    VALIDATION_ERROR = 'VALIDATION_ERROR'          // Error general de validación\n}\n","/**\n * Entidad Customer\n * Cliente de la tienda\n*/\nimport { Phone } from \"../common/Phone\";\n\nexport interface Customer {\n  id: string;\n  accountId: string;\n  firstName?: string;\n  lastName?: string;\n  email: string;\n    phone?: Phone;\n    newsletter: boolean;\n    status: CustomerStatus;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n}\n\nexport enum CustomerStatus {\n  ACTIVE = 'ACTIVE',\n  INACTIVE = 'INACTIVE',\n  BLACKLISTED = 'BLACKLISTED', // e.g., for fraudulent activity\n  PENDING = 'PENDING', // e.g., email verification needed\n}","import { AccountIntegration } from \"../accountIntegration\";\n/**\n * Entidad Integration\n * Define las integraciones de terceros disponibles en la plataforma (ej. pasarelas de pago, transportistas).\n * Almacena información sobre el proveedor, categoría y esquema de parámetros requeridos.\n */\n\nexport enum IntegrationCategory {\n\tPAYMENT_GATEWAY = 'PAYMENT_GATEWAY',\n\tSHIPPING_CARRIER = 'SHIPPING_CARRIER',\n\tMARKETPLACE = 'MARKETPLACE',\n\tEMAIL_MARKETING = 'EMAIL_MARKETING',\n\tANALYTICS = 'ANALYTICS',\n\tACCOUNTING = 'ACCOUNTING',\n\tSOCIAL_MEDIA = 'SOCIAL_MEDIA',\n\tOTHER = 'OTHER',\n}\n\nexport enum IntegrationStatus {\n\tACTIVE = 'ACTIVE',\n\tINACTIVE = 'INACTIVE',\n\tBETA = 'BETA',\n\tDEPRECATED = 'DEPRECATED',\n}\n\nexport interface Integration {\n\tid: string;\n\tcategory: IntegrationCategory;\n\tproviderKey: string; // Unique identifier key (e.g., 'stripe', 'mercadopago-marketplace')\n\tname: string; // Human-readable name (e.g., \"Stripe\", \"Mercado Pago Marketplace\")\n\tslug: string;\n\tdescription?: string;\n\tsetupInstructions?: string; // General instructions or link to docs\n\tlogoUrl?: string; // URL to the integration's logo\n\trequiredParamsSchema?: any; // Define required parameters/credentials structure\n\tsupportedPaymentMethods?: string[]; // List of supported payment methods (e.g., 'visa', 'mastercard', 'american_express', 'bank_transfer', 'cash')\n\tpaymentCanRecapture?: boolean; // Can the payment be recaptured by the provider?\n\tpaymentCanRefund?: boolean; // Can the payment be refunded by the provider?\n\tstatus: IntegrationStatus;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\torder: number;\n\t/** ISO country codes where this integration is available. Null or empty = all countries. */\n\tcountries?: string[] | null;\n\n\taccountIntegration: AccountIntegration | null;\n}","\nimport { IntegrationCategory } from \"./types\";\n\nexport function getIntegrationCategoryName(category: IntegrationCategory): string {\n\tconst map: Record<IntegrationCategory, string> = {\n\t\tPAYMENT_GATEWAY: 'Pasarelas de pago',\n\t\tSHIPPING_CARRIER: 'Envíos',\n\t\tMARKETPLACE: 'Marketplaces',\n\t\tEMAIL_MARKETING: 'Email marketing',\n\t\tANALYTICS: 'Medición y análisis',\n\t\tACCOUNTING: 'Contabilidad',\n\t\tSOCIAL_MEDIA: 'Redes sociales',\n\t\tOTHER: 'Otros',\n\t};\n\n\treturn map[category] ?? 'Otro';\n}","import { Currency, Media } from '../common'\nimport { Customer } from '../customer'\nimport { AccountIntegration } from '../accountIntegration'\nimport { AccountDomain } from '../accountDomain'\nimport { Product } from '../product'\nimport { FulfillmentStatus } from '../fulfillment/types'\nimport { StatusInfo } from '../common/Status'\nimport { Payment, PaymentStatus } from '../payment'\nimport { OrderDeliveryMethod } from '../orderDeliveryMethod'\nimport { Account } from '../account'\nimport { AccountPaymentMethod } from '../accountPaymentMethod'\n\n/**\n * Entidad Order\n * Define la orden de compra de un cliente en el sitio web.\n */\n\nexport interface Order {\n    id: string\n    accountId: string\n    customerId: string\n    cartId?: string\n    code: string\n    deliveryType: OrderDeliveryType\n    deliveryFirstName?: string\n    deliveryLastName?: string\n    deliveryAddress?: any\n    deliveryPhone?: any\n    pickupBranchId?: string\n    accountPaymentMethodId?: string\n    paymentMethodIntegrationId?: string\n    billingInformation?: any\n    currency: Currency\n    currencySymbol?: string\n    subtotalPrice: number\n    totalDiscounts: number\n    totalShippingPrice: number\n    totalTax: number\n    taxDetails?: any\n    totalPrice: number\n    totalRefunded: number\n    status: OrderStatus\n    statusInfo?: StatusInfo\n    paymentStatus: OrderPaymentStatus\n    paymentStatusInfo?: StatusInfo\n    fulfillmentStatus: FulfillmentStatus\n    statusHistory?: StatusChangeHistory[]\n    customerNote?: string\n    internalNote?: string\n    source: OrderSource\n    sourceAccountDomainId?: string\n    demo: boolean\n    createdAt: Date\n    updatedAt: Date\n    cancelledAt?: Date\n    cancelReason?: string\n    deletedAt?: Date\n    /** Estimated delivery window start (from delivery option rules) */\n    estimatedDeliveryStart?: Date\n    /** Estimated delivery window end (from delivery option rules) */\n    estimatedDeliveryEnd?: Date\n    items?: OrderItem[]\n    /** Applied promotions snapshot at order creation (checkout promos with name/code/amount). */\n    promotions?: OrderAppliedPromotion[]\n\n    customer?: Customer | null\n    paymentMethodIntegration?: AccountIntegration | null\n    accountDomain?: AccountDomain\n    deliveryMethod?: OrderDeliveryMethod | null\n    account?: Account\n    accountPaymentMethod?: Partial<AccountPaymentMethod> | null\n    payments?: Payment[]\n\n    statusFlow?: StatusFlow[]\n    // Estados permitidos para cambiar el estado de la orden\n    statusChangeAllowed?: OrderStatus[]\n    hasShipment?: boolean\n}\n\nexport interface OrderItem {\n    id: string\n    accountId: string\n    orderId: string\n    productId: string\n    productVariantId: string\n    sku?: string\n    productName: string\n    variantName?: string\n    currency: Currency\n    currencySymbol?: string\n    unitPrice: number\n    totalDiscount: number\n    totalPrice: number\n    quantity: number\n    quantityFulfilled: number\n    quantityRefunded: number\n    quantityReturned: number\n    totalTax: number\n    taxName?: string\n    createdAt: Date\n    updatedAt: Date\n\n    // Snapshot del producto en el momento de la compra\n    productSnapshot?: OrderItemSnapshot\n\n    product?: Product\n}\n\nexport enum OrderStatus {\n    PENDING = 'PENDING', // Order placed, awaiting payment confirmation\n    CONFIRMED = 'CONFIRMED', // Payment received, order confirmed\n    PROCESSING = 'PROCESSING', // Order being prepared\n    PROCESSED = 'PROCESSED', // Order ready to be shipped\n    ON_HOLD = 'ON_HOLD', // Order temporarily paused\n    COMPLETED = 'COMPLETED', // Order finished (e.g., after return period)\n    CANCELLED = 'CANCELLED', // Order cancelled before fulfillment\n    FAILED = 'FAILED', // Order failed (e.g., payment failed irrecoverably)\n}\n\nexport enum OrderPaymentStatus {\n    PENDING = 'PENDING',\n    PARTIAL = 'PARTIAL',\n    PAID = 'PAID',\n    OVERPAID = 'OVERPAID',\n    REFUNDED = 'REFUNDED',\n    PARTIALLY_REFUNDED = 'PARTIALLY_REFUNDED',\n}\n\nexport enum OrderSource {\n    WEB = 'WEB',\n    POS = 'POS',\n    API = 'API',\n}\n\nexport enum OrderDeliveryType {\n    SHIPPING = 'SHIPPING',\n    PICKUP = 'PICKUP',\n}\n\n/**\n * Pseudo-estado amigable para la vista/filtro de órdenes en backoffice.\n * Cada valor se deriva de combinaciones de status, paymentStatus, fulfillmentStatus y deliveryType.\n */\nexport enum DisplayOrderStatus {\n    PENDIENTES_DE_PAGO = 'PENDIENTES_DE_PAGO',\n    EN_PROCESO = 'EN_PROCESO',\n    LISTAS_PARA_ENVIAR = 'LISTAS_PARA_ENVIAR',\n    LISTAS_PARA_RETIRAR = 'LISTAS_PARA_RETIRAR',\n    ENVIADAS = 'ENVIADAS',\n    ENTREGADAS = 'ENTREGADAS',\n    EN_ESPERA = 'EN_ESPERA',\n    CON_PROBLEMAS = 'CON_PROBLEMAS',\n    CANCELADAS = 'CANCELADAS',\n    REEMBOLSADAS = 'REEMBOLSADAS',\n}\n\nexport interface StatusChangeHistory {\n    type: 'order' | 'fulfillment' | 'payment'\n    status: OrderStatus | FulfillmentStatus | PaymentStatus\n    timestamp: Date\n    reason?: string\n    userId?: string\n    metadata?: Record<string, any>\n}\n\nexport interface OrderItemSnapshot {\n    sku?: string\n    productName: string\n    variantName?: string\n    media?: Media[]\n}\n\n/** Promotion applied to an order (snapshot at checkout time). */\nexport interface OrderAppliedPromotion {\n    code: string\n    amount: number\n    name?: string\n    description?: string\n    isAutomatic?: boolean\n}\n\ntype StatusByType = {\n    order: OrderStatus\n    fulfillment: FulfillmentStatus\n    payment: PaymentStatus\n}\n\nexport type StatusFlow<T extends keyof StatusByType = keyof StatusByType> = {\n    type: T\n    status: StatusByType[T]\n    text?: string\n    doneAt: Date | null\n}\n\nexport type NextStatusAction<T extends keyof StatusByType = keyof StatusByType> = {\n    type: T\n    status: StatusByType[T]\n    text: string\n    fulfillmentId?: string // for fulfillment status updates\n}\n","import { Webhook } from '../common/Webhook'\nimport { Address } from '../common/Address'\nimport { FulfillmentItem } from '../fulfillmentItem'\nimport { FulfillmentLabel } from '../fulfillmentLabel'\nimport { Order } from '../order'\nimport { WebhookPayload } from '../payment'\n\nexport enum FulfillmentStatus {\n    PENDING = 'pending',\n    SHIPPED = 'shipped',\n    DELIVERED = 'delivered',\n    CANCELLED = 'cancelled',\n}\n\nexport type FulfillmentTrackingEvent = {\n    providerStatus: string\n    providerStatusLabel?: string\n    retailaStatus: FulfillmentStatus\n    at: string\n    raw?: Record<string, unknown>\n}\n\nexport type Fulfillment = {\n    id: string\n    code: string\n    accountId: string\n    orderId: string\n    accountBranchId: string\n    deliveryOptionId: string\n    items: FulfillmentItem[]\n    labels: FulfillmentLabel[]\n    status: FulfillmentStatus\n    data: Record<string, unknown> | null\n    trackingEvents?: FulfillmentTrackingEvent[]\n    shippedAt: Date | null\n    deliveredAt: Date | null\n    cancelledAt: Date | null\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date\n}\n\n// Fulfillment Provider types\nexport type FulfillmentDeliveryOption = {\n    // useful to store the fulfillment option id, to later interact with that service level\n    id: string\n    // Name to show to the admin when creating the delivery option (could also be used in the storefront)\n    name: string\n    // Delivery type (SHIPPING or PICKUP) to filter options based on user selection\n    deliveryType?: 'SHIPPING' | 'PICKUP'\n    // Pickup locations for PICKUP delivery type options\n    pickupLocations?: PickupLocation[]\n    [key: string]: unknown\n}\n\n// Pickup Location: same address structure as orders and branches (Address) for consistency and no format conversion.\nexport interface PickupLocation {\n    id: string\n    name: string\n    address: Address\n    hours?: string\n    phone?: string\n    additionalInfo?: Record<string, unknown>\n}\n\n// Recollection specific types\nexport type FulfillmentRecollectionMode = 'RECOLLECTION' | 'DROP_OFF'\n\n// Simplified scheduling - just define when recollections are possible\nexport type FulfillmentRecollectionSchedule = {\n    dayOfWeek: number // 0-6 (Sun-Sat)\n    startHour: number // 9 (for 9:00 AM)\n    endHour: number // 17 (for 5:00 PM)\n    intervalMinutes?: number // Optional: 30, 60, etc. Default could be 60\n}\n\nexport type FulfillmentRecollectionCapabilities = {\n    supportsRecollection: boolean\n    supportsDropOff: boolean\n    allowsScheduling: boolean\n    recollectionSchedule?: FulfillmentRecollectionSchedule[]\n    leadTimeHours: number // Minimum hours before recollection\n    maxAdvanceDays: number // Maximum days in advance to schedule\n    dropOffLocationsUrl?: string // Link to provider's page showing drop-off locations\n}\n\n// Recollection configuration for a specific fulfillment request.\n// recollectionAddress uses the same structure as order and branch addresses (Address) so no format conversion or geocoding is needed.\nexport type FulfillmentRecollectionConfig = {\n    mode: FulfillmentRecollectionMode\n    scheduledDateTime?: Date // Required when allowsScheduling=true and mode includes recollection\n    recollectionAddress?: Address\n    contactInfo?: {\n        name: string\n        phone: string\n        email?: string\n    }\n    specialInstructions?: string\n}\n\n// Input for creating a fulfillment with third-party provider\nexport type FulfillmentProviderCreateInput = {\n    data: Record<string, unknown> // Order delivery method data\n    items: FulfillmentItem[]\n    order: Order\n    fulfillment: Fulfillment\n    recollectionConfig?: FulfillmentRecollectionConfig\n    /** ISO 3166-1 alpha-2 country code (e.g. 'UY', 'AR') for provider defaults (e.g. phone fallback). */\n    accountCountryCode?: string\n}\n\n// Output from creating a fulfillment with third-party provider\nexport type FulfillmentProviderCreateOutput = {\n    // Provider-specific data to store in fulfillment entity\n    data?: Record<string, unknown>\n    // Array of shipping labels/tracking information\n    labels: {\n        trackingNumber: string\n        trackingUrl?: string\n        label?: {\n            url?: string\n            base64?: string\n            format?: 'pdf' | 'png' | 'zpl' // Label format\n        }\n    }[]\n}\n\nexport type FulfillmentProviderProcessWebhookInput = WebhookPayload & {\n    // TODO: Put the actual service type once we move it from /api to here\n    fulfillmentService: any\n}\n\nexport type FulfillmentProviderProcessWebhookOutput = {\n    fulfillmentId: string\n    fulfillmentStatus: FulfillmentStatus\n    data: Record<string, any>\n    trackingEvent?: FulfillmentTrackingEvent\n}\n\n// Provider-level types (entity-agnostic, reusable across projects)\nexport type FulfillmentProviderKey = 'MANUAL_FULFILLMENT' | 'DAC' | 'PEDIDOSYA'\n\n// Provider context for initialization\nexport type FulfillmentProviderContext = {\n    data: Record<string, any>\n}\n\n// Base adapter interface that all fulfillment providers must implement\nexport interface FulfillmentProviderAdapter {\n    readonly key: FulfillmentProviderKey\n    listDeliveryOptions(): Promise<FulfillmentDeliveryOption[]>\n    // Useful to execute when trying to calculate a delivery option price in the checkout,\n    // to validate it can be calculated\n    canCalculate(data: Record<string, unknown>): Promise<boolean>\n    calculatePrice(data: Record<string, unknown>): Promise<number>\n    getRecollectionCapabilities(): Promise<FulfillmentRecollectionCapabilities>\n    // Create fulfillment with third-party provider\n    createFulfillment(input: FulfillmentProviderCreateInput): Promise<FulfillmentProviderCreateOutput>\n    processWebhook(\n        input: FulfillmentProviderProcessWebhookInput\n    ): Promise<FulfillmentProviderProcessWebhookOutput | null>\n    /** Optional: cancel the fulfillment with the provider (e.g. cancel shipping label). */\n    cancelFulfillment?(fulfillment: Fulfillment): Promise<void>\n}\n","import { StatusInfo } from '../common/Status'\nimport {\n    OrderStatus,\n    OrderPaymentStatus,\n    OrderDeliveryType,\n    DisplayOrderStatus,\n    type Order,\n} from './types'\nimport { FulfillmentStatus } from '../fulfillment/types'\n\nexport function getOrderStatusInfo(status: OrderStatus): StatusInfo {\n    const map: Record<OrderStatus, StatusInfo> = {\n        PENDING: { text: 'Pendiente', class: 'secondary', actionText: '' },\n        CONFIRMED: { text: 'Confirmada', class: 'info', actionText: 'Confirmar orden' },\n        PROCESSING: { text: 'En proceso', class: 'warning', actionText: 'Procesar orden' },\n        PROCESSED: { text: 'Procesada', class: 'primary', actionText: 'Orden procesada' },\n        ON_HOLD: { text: 'En espera', class: 'secondary', actionText: 'Orden en espera' },\n        COMPLETED: { text: 'Completada', class: 'success', actionText: 'Completar orden' },\n        CANCELLED: { text: 'Cancelada', class: 'danger', actionText: 'Cancelar orden' },\n        FAILED: { text: 'Fallida', class: 'danger', actionText: '' },\n    }\n\n    return map[status] ?? { text: String(status), class: 'secondary' }\n}\n\nexport function getOrderPaymentStatusInfo(status: OrderPaymentStatus): StatusInfo {\n    const map: Record<OrderPaymentStatus, StatusInfo> = {\n        PENDING: { text: 'Pago pendiente', class: 'warning', actionText: '' },\n        PARTIAL: { text: 'Pago parcial', class: 'info', actionText: '' },\n        PAID: { text: 'Pago completo', class: 'success', actionText: '' },\n        OVERPAID: { text: 'Pago excedido', class: 'info', actionText: '' },\n        REFUNDED: { text: 'Reembolsado', class: 'success', actionText: '' },\n        PARTIALLY_REFUNDED: { text: 'Parcialmente reembolsado', class: 'warning', actionText: '' },\n    }\n\n    return map[status] ?? { text: String(status), class: 'secondary' }\n}\n\nconst DISPLAY_ORDER_STATUS_INFO: Record<DisplayOrderStatus, StatusInfo> = {\n    [DisplayOrderStatus.PENDIENTES_DE_PAGO]: { text: 'Pendientes de pago', class: 'warning', actionText: '' },\n    [DisplayOrderStatus.EN_PROCESO]: { text: 'En proceso', class: 'info', actionText: '' },\n    [DisplayOrderStatus.LISTAS_PARA_ENVIAR]: { text: 'Listas para enviar', class: 'primary', actionText: '' },\n    [DisplayOrderStatus.LISTAS_PARA_RETIRAR]: { text: 'Listas para retirar', class: 'primary', actionText: '' },\n    [DisplayOrderStatus.ENVIADAS]: { text: 'Enviadas', class: 'warning', actionText: '' },\n    [DisplayOrderStatus.ENTREGADAS]: { text: 'Entregadas', class: 'success', actionText: '' },\n    [DisplayOrderStatus.EN_ESPERA]: { text: 'En espera', class: 'secondary', actionText: '' },\n    [DisplayOrderStatus.CON_PROBLEMAS]: { text: 'Con problemas', class: 'danger', actionText: '' },\n    [DisplayOrderStatus.CANCELADAS]: { text: 'Canceladas', class: 'danger', actionText: '' },\n    [DisplayOrderStatus.REEMBOLSADAS]: { text: 'Reembolsadas', class: 'success', actionText: '' },\n}\n\nexport function getDisplayOrderStatusInfo(displayStatus: DisplayOrderStatus): StatusInfo {\n    return DISPLAY_ORDER_STATUS_INFO[displayStatus] ?? { text: String(displayStatus), class: 'secondary' }\n}\n\n/** Order-like minimal shape for computing display status */\ntype OrderForDisplayStatus = Pick<Order, 'status' | 'paymentStatus' | 'deliveryType'> & {\n    fulfillmentStatus?: FulfillmentStatus | null\n}\n\n/**\n * Derives the display (pseudo) status for an order from real status, paymentStatus, fulfillmentStatus and deliveryType.\n * Evaluation order matters: Canceladas and Reembolsadas are mutually exclusive (Canceladas wins).\n */\nexport function getDisplayOrderStatus(order: OrderForDisplayStatus): DisplayOrderStatus {\n    const status = order.status as OrderStatus\n    const paymentStatus = order.paymentStatus as OrderPaymentStatus\n    const fulfillmentStatus = order.fulfillmentStatus ?? FulfillmentStatus.PENDING\n    const deliveryType = order.deliveryType\n\n    if (status === OrderStatus.CANCELLED) return DisplayOrderStatus.CANCELADAS\n    if (\n        paymentStatus === OrderPaymentStatus.REFUNDED ||\n        paymentStatus === OrderPaymentStatus.PARTIALLY_REFUNDED\n    ) {\n        return DisplayOrderStatus.REEMBOLSADAS\n    }\n    if (status === OrderStatus.FAILED) return DisplayOrderStatus.CON_PROBLEMAS\n    if (status === OrderStatus.ON_HOLD) return DisplayOrderStatus.EN_ESPERA\n    if (status === OrderStatus.COMPLETED || fulfillmentStatus === FulfillmentStatus.DELIVERED) {\n        return DisplayOrderStatus.ENTREGADAS\n    }\n    if (fulfillmentStatus === FulfillmentStatus.SHIPPED) return DisplayOrderStatus.ENVIADAS\n    if (\n        status === OrderStatus.PROCESSED &&\n        deliveryType === OrderDeliveryType.SHIPPING &&\n        fulfillmentStatus === FulfillmentStatus.PENDING\n    ) {\n        return DisplayOrderStatus.LISTAS_PARA_ENVIAR\n    }\n    if (status === OrderStatus.PROCESSED && deliveryType === OrderDeliveryType.PICKUP) {\n        return DisplayOrderStatus.LISTAS_PARA_RETIRAR\n    }\n    if (\n        (status === OrderStatus.CONFIRMED || status === OrderStatus.PROCESSING) &&\n        (paymentStatus === OrderPaymentStatus.PAID || paymentStatus === OrderPaymentStatus.OVERPAID)\n    ) {\n        return DisplayOrderStatus.EN_PROCESO\n    }\n    if (\n        status === OrderStatus.PENDING &&\n        (paymentStatus === OrderPaymentStatus.PENDING || paymentStatus === OrderPaymentStatus.PARTIAL)\n    ) {\n        return DisplayOrderStatus.PENDIENTES_DE_PAGO\n    }\n\n    return DisplayOrderStatus.PENDIENTES_DE_PAGO\n}\n","// shared-types/src/payment/types.ts\n\nimport { Currency } from '../common'\nimport { AccountPaymentMethod } from '../accountPaymentMethod'\nimport { Order } from '../order'\nimport { StatusInfo } from '../common/Status'\n\nexport enum PaymentStatus {\n    PENDING = 'PENDING', // Pendiente\n    PREAUTHORIZED = 'PREAUTHORIZED',\n    APPROVED = 'APPROVED', // Pago aprobado online\n    PAID = 'PAID', // Pago realizado por redes fisicas\n    REJECTED = 'REJECTED', // Pago rechazado\n    REFUND_IN_PROCESS = 'REFUND_IN_PROCESS', // En proceso de reembolso con la plataforma de pagos\n    PARTIAL_REFUND = 'PARTIAL_REFUND', // Pago parcialmente reembolsado\n    REFUNDED = 'REFUNDED', // Pago reembolsado\n    ERROR = 'ERROR', // Represents an error in porcessing the payment. Ex: a webhook comes without an esternal reference, so we can't match in our system\n}\n\nexport enum PaymentMethodType {\n    BANK_TRANSFER = 'BANK_TRANSFER',\n    CREDIT_CARD = 'CREDIT_CARD',\n    DEBIT_CARD = 'DEBIT_CARD',\n    MERCADOPAGO = 'MERCADOPAGO',\n    MERCADOPAGO_MARKETPLACE = 'MERCADOPAGO_MARKETPLACE',\n    PHYSICAL = 'PHYSICAL',\n    INTERNATIONAL = 'INTERNATIONAL',\n    PAYPAL = 'PAYPAL',\n    AKUA = 'AKUA',\n    CASH = 'CASH',\n    OTHER = 'OTHER', // Added for flexibility\n}\nexport interface PaymentConversion {\n    fromCurrency: Currency // Moneda de la cuenta/orden (ej: UYU)\n    toCurrency: Currency // Moneda del cobro real (ej: USD)\n    rate: number // Tasa aplicada (1 Base = X Target)\n    originalAmount: number // Monto en moneda de la cuenta\n    finalAmount: number // Monto que se envió al procesador\n}\n\nexport interface Payment {\n    id: string\n    accountId: string\n    orderId: string\n    invoiceId?: string\n    accountPaymentMethodId?: string\n    accountIntegrationId?: string\n    referenceCode?: string\n    paymentMethodType?: PaymentMethodType\n    currency: Currency\n    amount: number\n    amountReceived: number\n    amountRefunded: number\n    paidAt?: string | Date\n    refundedAt?: string | Date\n    status: PaymentStatus\n    statusInfo?: StatusInfo\n    cardBrand?: string\n    cardBrandInfo?: PaymentCardBrand\n    cardLast4?: string\n    data?: Record<string, any>\n    conversion?: PaymentConversion\n    metadata?: Record<string, any>\n    internalComment?: string\n    demo: boolean\n    createdAt: string | Date\n    updatedAt: string | Date\n    deletedAt?: string | Date\n\n    accountPaymentMethod?: Partial<AccountPaymentMethod> | null\n    order?: Order\n\n    allowedActions?: {\n        canCopyLink: boolean\n        canMarkAsPaid: boolean\n        canRecapture: boolean\n        canRefund: boolean\n    }\n}\n\n// Provider-level types (entity-agnostic, reusable across projects)\nexport type PaymentProviderKey =\n    | 'MERCADOPAGO'\n    | 'MERCADOPAGO_MARKETPLACE'\n    | 'PLEXO'\n    | 'MANUAL_PAYMENT'\n    | 'PAYPAL'\n    | 'AKUA'\n\n// TODO: Eventually refactor what is passed to the payment provider constructor, as it most likely just need\nexport interface PaymentProviderContext {\n    data: Record<string, unknown>\n}\n\nexport interface PaymentProviderInitInput {\n    // Arbitrary provider input. Caller builds this from their domain data\n    data: Record<string, any>\n}\n\nexport interface PaymentProviderInitOutput {\n    data: Record<string, any>\n    status: PaymentStatus\n}\n\nexport interface PaymentProviderCaptureInput {\n    data: Record<string, any>\n}\n\nexport interface PaymentProviderCaptureOutput {\n    data: Record<string, any>\n}\n\nexport interface PaymentProviderRefundInput {\n    amount: number\n    data: Record<string, any>\n}\n\nexport interface PaymentProviderRefundOutput {\n    data: Record<string, any>\n}\n\nexport interface PaymentProviderWebhookResult {\n    //TODO: Ideally, if later an order can have multiple payments, the way to link thrid party payments with our own payment entity, should be throu something like a\n    // payment session in our system, that would be set as the external reference in the third party payment\n    paymentId: string | null\n    status: PaymentStatus\n    data: Record<string, unknown>\n    // TODO: Ideally i think this should live inside the data field, not have separate columns and just let the consumer know what\n    // attributes to query to resolve them\n    paymentDetails: {\n        referenceCode?: string\n        method?: string\n        last4?: string\n    }\n}\n\nexport interface WebhookPayload {\n    // Id of payment provider webhook belongs to, to pass data for processing\n    provider: string\n    accountId: string\n    payload: {\n        query: Record<string, unknown>\n        body: Record<string, unknown>\n        headers: Record<string, unknown>\n    }\n}\n\nexport enum PaymentCardBrandKey {\n    mp_account_money = 'mp_account_money',\n    master = 'master',\n    debmaster = 'debmaster',\n    visa = 'visa',\n    debvisa = 'debvisa',\n    diners = 'diners',\n    oca = 'oca',\n    lider = 'lider',\n    amex = 'amex',\n    redpagos = 'redpagos',\n    abitab = 'abitab',\n}\n\nexport interface PaymentCardBrand {\n    key: string\n    name: string\n    image: string\n    icon: string\n}\n\nexport function getPaymentCardBrand(key: PaymentCardBrandKey): PaymentCardBrand {\n    const map: Record<PaymentCardBrandKey, PaymentCardBrand> = {\n        mp_account_money: {\n            key: PaymentCardBrandKey.mp_account_money,\n            name: 'Dinero en cuenta Mercado Pago',\n            image: 'https://assets.retai.la/payments/mercadopago.png',\n            icon: 'https://assets.retai.la/payments/mercadopago-ico.png',\n        },\n        master: {\n            key: PaymentCardBrandKey.master,\n            name: 'Mastercard',\n            image: 'https://assets.retai.la/payments/master.png',\n            icon: 'https://assets.retai.la/payments/master-ico.png',\n        },\n        debmaster: {\n            key: PaymentCardBrandKey.master,\n            name: 'Mastercard Débito',\n            image: 'https://assets.retai.la/payments/master.png',\n            icon: 'https://assets.retai.la/payments/master-ico.png',\n        },\n        visa: {\n            key: PaymentCardBrandKey.visa,\n            name: 'Visa',\n            image: 'https://assets.retai.la/payments/visa.png',\n            icon: 'https://assets.retai.la/payments/visa-ico.png',\n        },\n        debvisa: {\n            key: PaymentCardBrandKey.visa,\n            name: 'Visa Débito',\n            image: 'https://assets.retai.la/payments/visa.png',\n            icon: 'https://assets.retai.la/payments/visa-ico.png',\n        },\n        diners: {\n            key: PaymentCardBrandKey.diners,\n            name: 'Diners',\n            image: 'https://assets.retai.la/payments/diners.png',\n            icon: 'https://assets.retai.la/payments/diners-ico.png',\n        },\n        oca: {\n            key: PaymentCardBrandKey.oca,\n            name: 'Oca',\n            image: 'https://assets.retai.la/payments/oca.png',\n            icon: 'https://assets.retai.la/payments/oca-ico.png',\n        },\n        lider: {\n            key: PaymentCardBrandKey.lider,\n            name: 'Lider',\n            image: 'https://assets.retai.la/payments/lider.png',\n            icon: 'https://assets.retai.la/payments/lider-ico.png',\n        },\n        amex: {\n            key: PaymentCardBrandKey.amex,\n            name: 'American Express',\n            image: 'https://assets.retai.la/payments/amex.png',\n            icon: 'https://assets.retai.la/payments/amex-ico.png',\n        },\n        redpagos: {\n            key: PaymentCardBrandKey.redpagos,\n            name: 'Redpagos',\n            image: 'https://assets.retai.la/payments/redpagos.png',\n            icon: 'https://assets.retai.la/payments/redpagos-ico.png',\n        },\n        abitab: {\n            key: PaymentCardBrandKey.abitab,\n            name: 'Abitab',\n            image: 'https://assets.retai.la/payments/abitab.png',\n            icon: 'https://assets.retai.la/payments/abitab-ico.png',\n        },\n    }\n    return (\n        map[key] || {\n            key,\n            name: '',\n            image: null,\n        }\n    )\n}\n\nexport interface PaymentProviderAdapter {\n    readonly key: PaymentProviderKey\n    initPayment(input: PaymentProviderInitInput): Promise<PaymentProviderInitOutput>\n    capture(input: PaymentProviderCaptureInput): Promise<PaymentProviderCaptureOutput>\n    refund(input: PaymentProviderRefundInput): Promise<PaymentProviderRefundOutput>\n    processWebhook(input: WebhookPayload['payload']): Promise<PaymentProviderWebhookResult>\n}\n","import { StatusInfo } from '../common/Status'\nimport { PaymentStatus } from './types'\n\nexport function getPaymentStatusInfo(status: PaymentStatus): StatusInfo {\n    const map: Record<PaymentStatus, StatusInfo> = {\n        PENDING: { text: 'Pago pendiente', class: 'warning', actionText: '' },\n        PREAUTHORIZED: { text: 'Pago preautorizado', class: 'info', actionText: 'Preautorizar pago' },\n        APPROVED: { text: 'Pago aprobado', class: 'success', actionText: 'Aprobar pago' },\n        PAID: { text: 'Pago realizado', class: 'success', actionText: 'Pago realizado' },\n        REJECTED: { text: 'Pago rechazado', class: 'danger', actionText: 'Rechazar pago' },\n        REFUND_IN_PROCESS: { text: 'Pago en proceso de reembolso', class: 'warning', actionText: 'Reembolsar pago' },\n        PARTIAL_REFUND: { text: 'Pago parcialmente reembolsado', class: 'warning', actionText: 'Reembolsar pago' },\n        REFUNDED: { text: 'Pago reembolsado', class: 'success', actionText: 'Reembolsado' },\n        ERROR: { text: 'Error en pago', class: 'danger', actionText: 'Error en pago' },\n    }\n\n    return map[status] ?? { text: String(status), class: 'secondary' }\n}\n","// shared-types/src/payment/supportedPaymentMethodsOrder.ts\nimport { IntegrationCategory } from '../integration/types'\n\n/** Item en el JSON integration.supportedPaymentMethods (íconos de medios). */\nexport interface SupportedPaymentMethodIconRow {\n\tid: string\n\tname?: string\n\tthumbnail?: string\n\ticon?: string\n\t[key: string]: unknown\n}\n\n/** Parsea supportedPaymentMethods desde fila integration (simple-json / array / string JSON). */\nexport function parseIntegrationSupportedPaymentMethodsArray(raw: unknown): SupportedPaymentMethodIconRow[] {\n\tif (raw == null) return []\n\tif (Array.isArray(raw)) return raw as SupportedPaymentMethodIconRow[]\n\tif (typeof raw === 'string') {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(raw)\n\t\t\treturn Array.isArray(parsed) ? (parsed as SupportedPaymentMethodIconRow[]) : []\n\t\t} catch {\n\t\t\treturn []\n\t\t}\n\t}\n\treturn []\n}\n\n/**\n * Lista única de medios de pago en el orden canónico:\n * 1) Integraciones PAYMENT_GATEWAY ordenadas por integration.order ASC, providerKey ASC\n * 2) Dentro de cada una, el orden del array integration.supportedPaymentMethods\n * 3) Deduplicación por id conservando la primera aparición\n */\nexport function flattenSupportedPaymentMethodsFromAccountIntegrations(\n\taccountIntegrations: Array<{ integration?: { category?: string; order?: number; providerKey?: string; supportedPaymentMethods?: unknown } | null }>\n): SupportedPaymentMethodIconRow[] {\n\tconst gateways = (Array.isArray(accountIntegrations) ? accountIntegrations : []).filter(\n\t\t(ai) => ai?.integration?.category === IntegrationCategory.PAYMENT_GATEWAY\n\t)\n\n\tgateways.sort((a, b) => {\n\t\tconst ao = Number(a?.integration?.order ?? 0)\n\t\tconst bo = Number(b?.integration?.order ?? 0)\n\t\tif (ao !== bo) return ao - bo\n\t\tconst ap = String(a?.integration?.providerKey ?? '')\n\t\tconst bp = String(b?.integration?.providerKey ?? '')\n\t\treturn ap.localeCompare(bp)\n\t})\n\n\tconst flat = gateways.flatMap((ai) =>\n\t\tparseIntegrationSupportedPaymentMethodsArray(ai?.integration?.supportedPaymentMethods)\n\t)\n\n\tconst seen = new Set<string>()\n\tconst out: SupportedPaymentMethodIconRow[] = []\n\tfor (const row of flat) {\n\t\tconst id = row?.id != null ? String(row.id).trim() : ''\n\t\tif (!id) continue\n\t\tif (seen.has(id)) continue\n\t\tseen.add(id)\n\t\tout.push(row)\n\t}\n\treturn out\n}\n","import { Media } from \"../common\";\nimport { StatusInfo } from \"../common/Status\";\nimport type { ProductSizeGuidePayload } from \"../sizeGuide/types\";\nimport { ProductCategory } from \"../productCategory\";\n\n/**\n * Entidad Product\n * Representa un producto vendible en la tienda. Es la entidad base que puede tener múltiples variantes.\n */\n\nexport interface Product {\n  id: string;\n  accountId: string;\n  code: string;\n  brandId?: string | null;\n  supplierId?: string | null;\n  /** When set, storefront uses this size guide instead of category rules. */\n  sizeGuideId?: string | null;\n  productType: ProductType;\n  sku?: string | null;\n  barcode?: string | null;\n  name: string;  // e.g., \"Zapatos\", \"Pantalones\", \"Camisas\"\n  slug: string;\n  description?: string | null;\n  isFeatured: boolean;\n\n  // Inventory & Shipping\n  allowBackorder: boolean;  // Permite realizar pedidos aunque no haya stock disponible. Se aplica a las variantes si no está definido allí\n  weight?: number | null;\n  weightUnit?: string | null; // e.g., \"kg\"\n  height?: number | null;\n  width?: number | null;\n  depth?: number | null; \n  dimensionUnit?: string | null; // e.g., \"cm\"\n  shippingLeadTime?: string | null;  // e.g., \"1-3 days\"\n\n  status: ProductStatus; // ACTIVE, INACTIVE\n  statusInfo?: StatusInfo;\n  \n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n\n  media?: Media[]\n\n  variants?: ProductVariant[];\n  categories?: ProductCategory[];\n\n  /** Present on storefront product detail after server-side resolution. */\n  sizeGuide?: ProductSizeGuidePayload | null;\n}\n\nexport enum ProductStatus {\n  ACTIVE = 'ACTIVE', // Available for sale\n  INACTIVE = 'INACTIVE', // Not visible/purchasable\n  ARCHIVED = 'ARCHIVED', // Not visible, kept for records\n  DRAFT = 'DRAFT', // Incomplete product setup\n}\n\nexport enum ProductType {\n    SIMPLE = 'SIMPLE', // Product without variants (may have a default hidden variant)\n    VARIABLE = 'VARIABLE', // Product with distinct variants (color, size, etc.)\n    BUNDLE = 'BUNDLE', // A package of other products/variants\n    GIFT_CARD = 'GIFT_CARD', // Virtual or physical gift card\n}\n\n\nexport interface ProductVariant {\n  id: string;\n  accountId: string;\n  productId: string;\n\n  sku?: string | null;\n  barcode?: string | null; // EAN, UPC, etc.\n\n  // Pricing\n  currency: string; // ISO 4217 currency code\n  price: number;\n  compareAtPrice?: number;\n  allowBackorder?: boolean;\n  \n  // Inventory & Shipping\n  stock: number;\n  status: ProductVariantStatus;\n  weight?: number | null;\n  weightUnit?: string | null;\n  height?: number | null;\n  width?: number | null;\n  depth?: number | null;\n  dimensionUnit?: string | null;\n  shippingLeadTime?: string | null; // e.g., \"1-3 days\"\n  \n  order: number;\n\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date;\n\n}\n\nexport enum ProductVariantStatus {\n  ACTIVE = 'ACTIVE',\n  OUT_OF_STOCK = 'OUT_OF_STOCK',\n  COMING_SOON = 'COMING_SOON',\n}","import { StatusInfo } from \"../common/Status\";\nimport { ProductStatus } from \"./types\";\n\nexport function getProductStatusInfo(status: ProductStatus): StatusInfo {\n\tconst map: Record<ProductStatus, StatusInfo> = {\n\t\tACTIVE: { text: 'Activo', class: 'success' },\n\t\tINACTIVE: { text: 'Inactivo', class: 'danger' },\n\t\tARCHIVED: { text: 'Archivado', class: 'secondary' },\n\t\tDRAFT: { text: 'Borrador', class: 'secondary' },\n\t};\n\n\treturn map[status] ?? { text: String(status), class: 'secondary' };\n}","/**\n * Promotion Module Types\n * Types for the promotion system including promotions, rules, application methods, and adjustments\n */\n\n// ============================================================================\n// Promotion Core Types\n// ============================================================================\n\n/**\n * Main promotion entity that defines discount rules and metadata\n */\nexport interface Promotion {\n    id: string\n    accountId: string\n    code: string // Unique identifier within account, also serves as coupon code\n    type: PromotionType\n    isAutomatic: boolean // true = auto-apply, false = requires code\n    isStackable: boolean // true = can be combined with other stackable promotions, false = cannot be combined\n    campaignId?: string | null // Optional: Group promotions under campaigns\n    name: string\n    description?: string | null\n    /** Public URL for badge/icon on storefront (e.g. GCS media) */\n    badgeImageUrl?: string | null\n    /** When true, storefront may show badge image on product cards */\n    badgeShowOnProductCard?: boolean\n    /** When true, storefront may show badge image on product detail */\n    badgeShowOnProductDetail?: boolean\n    status: PromotionStatus\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\nexport enum PromotionType {\n    STANDARD = 'standard',\n}\n\nexport enum PromotionStatus {\n    ACTIVE = 'active',\n    INACTIVE = 'inactive',\n}\n\n// ============================================================================\n// Promotion Rule Types\n// ============================================================================\n\n/**\n * Reusable rule entity that can be attached to either Promotions (cart/order level)\n * or ApplicationMethods (target level)\n */\nexport interface PromotionRule {\n    id: string\n    accountId: string\n    ruleAttribute: string // e.g., \"subtotal\", \"item_count\", \"customer_id\", \"product_id\", \"category_id\"\n    ruleOperator: PromotionRuleOperator\n    createdAt: Date\n    updatedAt: Date\n}\n\nexport enum PromotionRuleOperator {\n    GT = 'gt', // greater than\n    GTE = 'gte', // greater than or equal\n    LT = 'lt', // less than\n    LTE = 'lte', // less than or equal\n    EQ = 'eq', // equals\n    IN = 'in', // in array\n    NIN = 'nin', // not in array\n}\n\n/**\n * Stores the values that a PromotionRule is evaluated against\n */\nexport interface PromotionRuleValue {\n    id: string\n    promotionRuleId: string\n    value: string // Flexible string value (can represent numbers, UUIDs, etc.)\n    createdAt: Date\n    updatedAt: Date\n}\n\n// ============================================================================\n// Pivot Tables - Promotion Rules\n// ============================================================================\n\n/**\n * Many-to-many relationship between Promotion and PromotionRule for cart/order-level rules\n */\nexport interface PromotionPromotionRule {\n    promotionId: string\n    promotionRuleId: string\n}\n\n/**\n * Many-to-many relationship between PromotionApplicationMethod and PromotionRule for target-level rules\n */\nexport interface PromotionApplicationMethodPromotionRule {\n    applicationMethodId: string\n    promotionRuleId: string\n}\n\n// ============================================================================\n// Application Method Types\n// ============================================================================\n\n/**\n * Defines how the promotion discount is applied\n */\nexport interface PromotionApplicationMethod {\n    id: string\n    accountId: string\n    promotionId: string // 1-to-1 relationship with Promotion\n    targetType: PromotionTargetType\n    applicationType: PromotionApplicationType\n    value: number // Discount value (for percentage/fixed)\n    /** For N_FOR_M: number of units to buy (e.g. 2 for 2x1, 3 for 3x2) */\n    buyQuantity?: number | null\n    /** For N_FOR_M: number of units to pay (e.g. 1 for 2x1, 2 for 3x2) */\n    payQuantity?: number | null\n    /** Optional: label for badge (e.g. \"2x1\", \"20% OFF\") */\n    badgeLabel?: string | null\n    /** Optional: badge type for preview (e.g. \"n_for_m\", \"percentage\") */\n    badgeType?: string | null\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\nexport enum PromotionTargetType {\n    ITEMS = 'items', // apply to cart/order line items\n    SHIPPING = 'shipping', // apply to cart/order delivery methods\n    ORDER = 'order', // apply to order total\n}\n\nexport enum PromotionApplicationType {\n    PERCENTAGE = 'percentage', // e.g., 10% off\n    FIXED = 'fixed', // e.g., $5 off\n    N_FOR_M = 'n_for_m', // e.g., 2x1 (buy 2 pay 1), 3x2 (buy 3 pay 2)\n}\n\n// ============================================================================\n// Cart Adjustment Types\n// ============================================================================\n\n/**\n * Tracks promotion adjustments applied to individual cart items\n */\nexport interface CartLineItemAdjustment {\n    id: string\n    accountId: string\n    cartItemId: string\n    promotionId?: string | null\n    description: string // e.g., \"10% off Summer Sale\"\n    code?: string | null // Promotion code if applicable\n    amount: number // Discount amount (always positive)\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\n/**\n * Tracks promotion adjustments applied to cart delivery methods\n */\nexport interface CartDeliveryMethodAdjustment {\n    id: string\n    accountId: string\n    cartDeliveryMethodId: string\n    promotionId?: string | null\n    description: string\n    code?: string | null\n    amount: number\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\n/**\n * Links carts to applied promotions for easy querying (pivot table)\n */\nexport interface CartPromotion {\n    cartId: string\n    promotionId: string\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\n// ============================================================================\n// Order Adjustment Types\n// ============================================================================\n\n/**\n * Tracks promotion adjustments on order items (snapshot from cart)\n */\nexport interface OrderLineItemAdjustment {\n    id: string\n    accountId: string\n    orderItemId: string\n    promotionId?: string | null\n    description: string\n    code?: string | null\n    amount: number\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\n/**\n * Tracks promotion adjustments on order delivery methods\n */\nexport interface OrderDeliveryMethodAdjustment {\n    id: string\n    accountId: string\n    orderDeliveryMethodId: string\n    promotionId?: string | null\n    description: string\n    code?: string | null\n    amount: number\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\n/**\n * Links orders to applied promotions for easy querying (pivot table, snapshot from cart)\n */\nexport interface OrderPromotion {\n    id: string\n    orderId: string\n    accountId: string\n    promotionId: string\n    code?: string | null\n    name?: string | null\n    amount: number\n    isAutomatic: boolean\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\n// ============================================================================\n// DTOs y contratos de API/Front\n// ============================================================================\n\nexport interface PromotionRuleInput {\n    ruleAttribute: string\n    ruleOperator: PromotionRuleOperator\n    values: string[]\n}\n\nexport interface PromotionApplicationMethodInput {\n    targetType: PromotionTargetType\n    applicationType: PromotionApplicationType\n    value: number\n    /** Required when applicationType is N_FOR_M: units to buy (e.g. 2 for 2x1) */\n    buyQuantity?: number | null\n    /** Required when applicationType is N_FOR_M: units to pay (e.g. 1 for 2x1) */\n    payQuantity?: number | null\n}\n\nexport interface CreatePromotionDTO {\n    name: string\n    description?: string | null\n    code?: string | null\n    isAutomatic: boolean\n    isStackable?: boolean\n    status: PromotionStatus\n    type?: PromotionType\n    campaignId?: string | null\n    promotionRules?: PromotionRuleInput[]\n    targetRules?: PromotionRuleInput[]\n    applicationMethod: PromotionApplicationMethodInput\n}\n\nexport interface UpdatePromotionDTO extends Partial<CreatePromotionDTO> {\n    id: string\n}\n\nexport interface PromotionListFilters {\n    page?: number\n    limit?: number\n    search?: string | null\n    status?: PromotionStatus | null\n    isAutomatic?: boolean | null\n}\n","/**\n * Entidad ProductAttribute\n * Define los atributos disponibles que se pueden asignar a las variantes de producto (ej. Color, Talla).\n * Especifica el nombre y tipo del atributo para ayudar en la representación y filtrado.\n */\n\nimport { ProductCategory } from \"../productCategory/types\";\n\nexport interface ProductAttribute {\n  id: string;\n  accountId: string;\n  name: string;  // e.g., \"Color de zapatos\", \"Talle de pantalones\", \"Material\"\n  alias: string; // e.g., \"Color\", \"Talla\", \"Material\"\n  slug: string;\n  type: ProductAttributeType; // Helps frontend render appropriate controls\n  isRequired: boolean; // isRequired for product variant\n  suffix: string; // suffix for number type\n  status: ProductAttributeStatus; // ACTIVE, INACTIVE\n  \n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n\n  // dejo las categorias planas y los links de la tabla pivot por si necesito acceder a ellas\n  productCategories: ProductCategory[]; // conveniente\n  productCategoryLinks: Array<{ categoryId: string; isRequired: boolean; displayOrder: number }>;\n\n  options: ProductAttributeOption[];\n  displayOrder: number; // order to display the attribute in the frontend\n}\n\nexport enum ProductAttributeStatus {\n  ACTIVE = 'ACTIVE',\n  INACTIVE = 'INACTIVE',\n}\n\n\nexport enum ProductAttributeType {\n    TEXT = 'TEXT', // text input\n    NUMBER = 'NUMBER', // number input\n    COLOR = 'COLOR', // Special type for color swatches\n    SELECT = 'SELECT', // Dropdown list\n    BOOLEAN = 'BOOLEAN', // checkbox input\n}\n\n/**\n * Una opción específica para un atributo (ej. \"Talle 42\" para el atributo \"Talle\").\n */\nexport interface ProductAttributeOption {\n  id: string;\n  accountId: string;\n  productAttributeId: string;\n  value: string;\n  imageId?: string | null;\n  order: number;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n\n  count: number; // number of options\n}","import { StandardCategory } from \"../standardCategory\";\n\n/**\n * Entidad ProductCategory\n * Define las categorías de productos.\n * Soporta una estructura jerárquica (categorías y subcategorías) mediante el campo parentId.\n * Cada categoría debe estar asociada a una categoría estándar del sistema.\n */\n\nexport interface ProductCategory {\n  id: string;\n  accountId: string;\n  parentId?: string;\n  standardCategoryId: string | null;\n  name: string;  // e.g., \"Zapatos\", \"Pantalones\", \"Camisas\"\n  slug: string;\n  description?: string;\n  imageId?: string | null;\n  order: number;\n  isFeatured: boolean;\n  status: ProductCategoryStatus; // ACTIVE, INACTIVE\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n\n  children: ProductCategory[];\n  parent: ProductCategory | null;\n  standardCategory: StandardCategory;\n}\n\n\nexport enum ProductCategoryStatus {\n  ACTIVE = 'ACTIVE',\n  INACTIVE = 'INACTIVE',\n}\n\n","/**\n * Size guides: reusable measurement tables and optional \"how to measure\" content.\n * Used by admin API, storefront payload (ProductSizeGuidePayload), and DB alignment.\n */\n\nexport enum SizeGuideStatus {\n  DRAFT = \"DRAFT\",\n  PUBLIC = \"PUBLIC\",\n}\n\nexport enum SizeGuideUnitBase {\n  CM = \"cm\",\n  IN = \"in\",\n}\n\nexport enum SizeGuideUnitDisplayPolicy {\n  AUTO = \"AUTO\",\n  FIXED = \"FIXED\",\n}\n\nexport interface SizeGuideTableColumn {\n  id: string;\n  label: string;\n  order: number;\n}\n\nexport interface SizeGuideTableRow {\n  id: string;\n  /** Maps column id -> cell display value (may include ranges or *literal* markers). */\n  cells: Record<string, string>;\n  order: number;\n}\n\nexport interface SizeGuideTableJson {\n  columns: SizeGuideTableColumn[];\n  rows: SizeGuideTableRow[];\n}\n\nexport interface SizeGuide {\n  id: string;\n  accountId: string;\n  name: string;\n  status: SizeGuideStatus;\n  tableJson: SizeGuideTableJson;\n  infoTitle?: string | null;\n  infoBody?: string | null;\n  infoMediaId?: string | null;\n  unitBase: SizeGuideUnitBase;\n  unitDisplayPolicy?: SizeGuideUnitDisplayPolicy | null;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n}\n\n/** Row in size_guide_category (category-scoped rule with priority). */\nexport interface SizeGuideCategoryRule {\n  sizeGuideId: string;\n  categoryId: string;\n  priority: number;\n}\n\n/** Assignment returned by admin API (without repeating sizeGuideId on each row). */\nexport interface SizeGuideCategoryAssignment {\n  categoryId: string;\n  priority: number;\n}\n\nexport type SizeGuideDetail = SizeGuide & {\n  categoryRules?: SizeGuideCategoryAssignment[];\n};\n\nexport interface CreateSizeGuideDTO {\n  accountId: string;\n  name: string;\n  status?: SizeGuideStatus;\n  tableJson: SizeGuideTableJson;\n  infoTitle?: string | null;\n  infoBody?: string | null;\n  infoMediaId?: string | null;\n  unitBase?: SizeGuideUnitBase;\n  unitDisplayPolicy?: SizeGuideUnitDisplayPolicy | null;\n}\n\nexport interface UpdateSizeGuideDTO {\n  name?: string;\n  status?: SizeGuideStatus;\n  tableJson?: SizeGuideTableJson;\n  infoTitle?: string | null;\n  infoBody?: string | null;\n  infoMediaId?: string | null;\n  unitBase?: SizeGuideUnitBase;\n  unitDisplayPolicy?: SizeGuideUnitDisplayPolicy | null;\n}\n\nexport interface SizeGuideCategoryRuleInput {\n  categoryId: string;\n  priority: number;\n}\n\n/** Resolved size guide on product detail (api-public / storefront). */\nexport interface ProductSizeGuidePayload {\n  id: string;\n  name: string;\n  table: SizeGuideTableJson;\n  unitBase: SizeGuideUnitBase;\n  unitDisplayPolicy?: SizeGuideUnitDisplayPolicy | null;\n  infoTitle?: string | null;\n  infoBody?: string | null;\n  infoImageUrl?: string | null;\n}\n","// shared-types/src/collection/types.ts\n\n/**\n * Entidad Collection\n * Define colecciones de productos para merchandising y agrupaciones flexibles.\n * Similar al modelo de Shopify Collections.\n */\n\nexport enum CollectionType {\n  MANUAL = 'MANUAL',\n  AUTOMATIC = 'AUTOMATIC',\n}\n\nexport enum CollectionStatus {\n  ACTIVE = 'ACTIVE',\n  INACTIVE = 'INACTIVE',\n  SCHEDULED = 'SCHEDULED',\n}\n\nexport enum CollectionRulesLogic {\n  ALL = 'ALL',\n  ANY = 'ANY',\n}\n\nexport enum CollectionRuleField {\n  TAG = 'TAG',\n  PRICE = 'PRICE',\n  CATEGORY = 'CATEGORY',\n  BRAND = 'BRAND',\n  TITLE = 'TITLE',\n  STATUS = 'STATUS',\n  INVENTORY = 'INVENTORY',\n  CREATED_AT = 'CREATED_AT',\n}\n\nexport enum CollectionRuleOperator {\n  EQUALS = 'EQUALS',\n  NOT_EQUALS = 'NOT_EQUALS',\n  CONTAINS = 'CONTAINS',\n  GREATER_THAN = 'GREATER_THAN',\n  LESS_THAN = 'LESS_THAN',\n  IS_SET = 'IS_SET',\n  IS_NOT_SET = 'IS_NOT_SET',\n}\n\nexport interface CollectionRule {\n  field: CollectionRuleField;\n  operator: CollectionRuleOperator;\n  value: string | number | boolean | null;\n}\n\nexport interface CollectionMedia {\n  id: string;\n  url: string;\n  name?: string;\n}\n\nexport interface Collection {\n  id: string;\n  accountId: string;\n  name: string;\n  slug: string;\n  description?: string;\n  imageId?: string;\n  image?: CollectionMedia | null;\n  collectionType: CollectionType;\n  status: CollectionStatus;\n  isFeatured: boolean;\n  rules?: CollectionRule[];\n  rulesLogic: CollectionRulesLogic;\n  publishAt?: Date;\n  unpublishAt?: Date;\n  order: number;\n  productCount?: number;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date;\n}\n\nexport interface CollectionProductLink {\n  collectionId: string;\n  productId: string;\n  accountId: string;\n  displayOrder: number;\n  addedAt: Date;\n}\n\nexport interface CreateCollectionDTO {\n  accountId: string;\n  name: string;\n  description?: string;\n  imageId?: string;\n  collectionType: CollectionType;\n  status?: CollectionStatus;\n  isFeatured?: boolean;\n  rules?: CollectionRule[];\n  rulesLogic?: CollectionRulesLogic;\n  publishAt?: Date;\n  unpublishAt?: Date;\n  order?: number;\n  products?: string[];\n}\n\nexport interface UpdateCollectionDTO {\n  name?: string;\n  description?: string;\n  imageId?: string | null;\n  collectionType?: CollectionType;\n  status?: CollectionStatus;\n  isFeatured?: boolean;\n  rules?: CollectionRule[];\n  rulesLogic?: CollectionRulesLogic;\n  publishAt?: Date | null;\n  unpublishAt?: Date | null;\n  order?: number;\n}\n\nexport const CollectionRuleFieldLabels: Record<CollectionRuleField, string> = {\n  [CollectionRuleField.TAG]: 'Etiqueta',\n  [CollectionRuleField.PRICE]: 'Precio',\n  [CollectionRuleField.CATEGORY]: 'Categoría',\n  [CollectionRuleField.BRAND]: 'Marca',\n  [CollectionRuleField.TITLE]: 'Nombre del producto',\n  [CollectionRuleField.STATUS]: 'Estado',\n  [CollectionRuleField.INVENTORY]: 'Inventario',\n  [CollectionRuleField.CREATED_AT]: 'Fecha de creación',\n};\n\nexport const CollectionRuleOperatorLabels: Record<CollectionRuleOperator, string> = {\n  [CollectionRuleOperator.EQUALS]: 'Es igual a',\n  [CollectionRuleOperator.NOT_EQUALS]: 'No es igual a',\n  [CollectionRuleOperator.CONTAINS]: 'Contiene',\n  [CollectionRuleOperator.GREATER_THAN]: 'Mayor que',\n  [CollectionRuleOperator.LESS_THAN]: 'Menor que',\n  [CollectionRuleOperator.IS_SET]: 'Está definido',\n  [CollectionRuleOperator.IS_NOT_SET]: 'No está definido',\n};\n\nexport const CollectionTypeLabels: Record<CollectionType, string> = {\n  [CollectionType.MANUAL]: 'Manual',\n  [CollectionType.AUTOMATIC]: 'Automática',\n};\n\nexport const CollectionStatusLabels: Record<CollectionStatus, string> = {\n  [CollectionStatus.ACTIVE]: 'Activa',\n  [CollectionStatus.INACTIVE]: 'Inactiva',\n  [CollectionStatus.SCHEDULED]: 'Programada',\n};\n","// shared-types/src/campaign/types.ts\n// Campaign core types aligned with DB entities\n\nexport enum CampaignStatus {\n    ACTIVE = 'active',\n    INACTIVE = 'inactive',\n}\n\nexport interface Campaign {\n    id: string\n    accountId: string\n    name: string\n    description?: string | null\n    startDate?: Date | null\n    endDate?: Date | null\n    status: CampaignStatus\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\nexport enum CampaignBudgetType {\n    USAGE = 'usage',\n    SPEND = 'spend',\n    USAGE_BY_ATTRIBUTE = 'usage_by_attribute',\n    SPEND_BY_ATTRIBUTE = 'spend_by_attribute',\n}\n\nexport interface CampaignBudget {\n    id: string\n    accountId: string\n    campaignId: string\n    type: CampaignBudgetType\n    limit?: number | null\n    used: number\n    attribute?: string | null\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n\nexport interface CampaignBudgetUsage {\n    id: string\n    campaignBudgetId: string\n    attributeValue: string\n    used: number\n    createdAt: Date\n    updatedAt: Date\n}\n\n","/**\n * Entidad StandardCategory\n * Define las categorías estándar de productos.\n * Estas categorías estan pensadas para unificar o agrupar productos de diferentes cuentas.\n */\n\nexport interface StandardCategory {\n  id: string;\n  parentId?: string;\n  name: string;  // e.g., \"Zapatos\", \"Pantalones\", \"Camisas\"\n  slug: string;\n  description?: string;\n  imageId?: string | null;\n  order: number;\n  status: StandardCategoryStatus; // ACTIVE, INACTIVE\n  metadata?: {\n    icon?: string;\n    displayInMenu?: boolean;\n    seoTitle?: string;\n    seoDescription?: string;\n    attributes?: string[];\n  };\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n\n  children: StandardCategory[];\n  parent: StandardCategory | null;\n}\n\nexport enum StandardCategoryStatus {\n  ACTIVE = 'ACTIVE',\n  INACTIVE = 'INACTIVE'\n}\n\n","/**\n * Entidad StoreBanner\n * Banners para la portada de la web de la tienda\n */\n\nimport { Media } from \"../common\";\n\nexport interface StoreBanner {\n  id: string;\n  accountId: string;\n  title: string;\n  desktopMediaId: string;\n  mobileMediaId?: string | null;\n  linkUrl?: string | null;\n  altText?: string | null;\n  displayOrder: number;\n  startDate?: Date | null;\n  endDate?: Date | null;\n  status: StoreBannerStatus;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n\n  // Relationships\n  desktopMedia?: Partial<Media> | null;\n  mobileMedia?: Partial<Media> | null;\n}\n\nexport enum StoreBannerStatus {\n  ACTIVE = \"ACTIVE\",\n  INACTIVE = \"INACTIVE\"\n}\n\n ","/**\n * Entidad StorePage\n * Páginas de la web de la tienda\n */\n\nexport interface StorePage {\n  id: string;\n  accountId: string;\n  type: StorePageType;\n  title: string;\n  slug: string;\n  content?: string | null;\n  seoTitle?: string | null;\n  seoDescription?: string | null;\n  \n  status: StorePageStatus;\n  canDelete: boolean;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n}\n\nexport enum StorePageStatus {\n  PUBLISHED = 'PUBLISHED',\n  DRAFT = 'DRAFT',\n  ARCHIVED = 'ARCHIVED',\n}\n\nexport enum StorePageType {\n  ABOUT_US = 'ABOUT_US',\n  CONTACT = 'CONTACT',\n  FAQ = 'FAQ',\n  TERMS_AND_CONDITIONS = 'TERMS_AND_CONDITIONS',\n  PRIVACY_POLICY = 'PRIVACY_POLICY',\n  RETURN_POLICY = 'RETURN_POLICY',\n  SHIPPING_POLICY = 'SHIPPING_POLICY',\n  BRANCHES = 'BRANCHES',\n  JOBS = 'JOBS',\n  OTHER = 'OTHER',\n}\n\n\n ","export enum PubSubTopics {\n    ORDER_PLACED = 'order-placed',\n    ORDER_CONFIRMED = 'order-confirmed',\n    ORDER_PROCESSING = 'order-processing',\n    ORDER_PROCESSED = 'order-processed',\n    ORDER_SHIPPED = 'order-shipped',\n    ORDER_DELIVERED = 'order-delivered',\n    ORDER_COMPLETED = 'order-completed',\n    ORDER_CANCELLED = 'order-cancelled',\n    PAYMENT_PAID = 'payment-paid',\n    NOTIFICATION_CREATED = 'notification-created',\n    CONTACT_FORM_SUBMITTED = 'contact-form-submitted',\n  }","import { Account } from '../account/types'\nimport { Customer } from '../customer/types'\n\n// origen principal del hilo de conversación (widget chat tienda → CHATBOT; formulario/contacto web genérico → WEB)\nexport enum SupportConversationChannel {\n    WEB = 'WEB',\n    CHATBOT = 'CHATBOT',\n    EMAIL = 'EMAIL',\n    WHATSAPP = 'WHATSAPP',\n}\n\n// quién puede ver el hilo en el tenant\nexport enum SupportConversationVisibility {\n    INTERNAL = 'INTERNAL',\n    MERCHANT = 'MERCHANT',\n}\n\nexport enum SupportConversationPriority {\n    LOW = 'LOW',\n    MEDIUM = 'MEDIUM',\n    HIGH = 'HIGH',\n    URGENT = 'URGENT',\n}\n\nexport enum SupportConversationStatus {\n    OPEN = 'OPEN',\n    CLOSED = 'CLOSED',\n    PENDING = 'PENDING',\n}\n\nexport enum SupportConversationMessageDeliveryStatus {\n    QUEUED = 'QUEUED',\n    SENT = 'SENT',\n    DELIVERED = 'DELIVERED',\n    READ = 'READ',\n    FAILED = 'FAILED',\n}\n\nexport enum SupportConversationMessageAiAnalysisStatus {\n    PENDING = 'PENDING',\n    PROCESSING = 'PROCESSING',\n    COMPLETED = 'COMPLETED',\n    FAILED = 'FAILED',\n}\n\n// Dirección del mensaje con respecto al sistema: entrante o saliente\nexport enum SupportConversationMessageDirection {\n    INBOUND = 'INBOUND',\n    OUTBOUND = 'OUTBOUND',\n}\n\n// Tipo de emisor del mensaje\nexport enum SupportConversationMessageSenderType {\n    CUSTOMER = 'CUSTOMER',\n    ACCOUNT_USER = 'ACCOUNT_USER',\n    ANONYMOUS = 'ANONYMOUS',\n    SYSTEM = 'SYSTEM',\n    AI = 'AI',\n}\n\nexport interface SupportConversation {\n    id: string\n    accountId: string\n    subject?: string | null // Asunto opcional del hilo (para email o contacto web)\n    channel: SupportConversationChannel // Canal principal de la conversación (email/whatsapp/web, etc.)\n    assigneeId?: string | null // Asignación interna (agente/usuario de la cuenta que atiende la conversación)\n    visibility: SupportConversationVisibility\n    priority: SupportConversationPriority // Priorización operativa\n    requiresMerchantAction: boolean // Indica si el comercio debe responder o tomar acción\n    requiresInternalAction: boolean // Indica si el equipo interno debe intervenir (respuesta, etc.)\n    customerId?: string | null // Identificador del cliente si está registrado en el sistema\n    customerName?: string | null // Nombre del contacto (snapshot, no necesariamente el del Customer)\n    customerLastname?: string | null // Apellido del contacto (snapshot)\n    customerEmail?: string | null // Email del contacto (snapshot)\n    customerPhone?: string | null // Teléfono del contacto (snapshot)\n    status: SupportConversationStatus // Estado simple (string para mantenerlo liviano)\n    lastMessageAt?: Date | null\n    unreadForAgent: number // Mensajes no leídos por el agente interno\n    unreadForCustomer: number // Mensajes no leídos por el cliente/comercio\n    metadata?: Object | null // Metadatos flexibles (headers email, ids de chat, etc.)\n    aiSuggestion?: Object | null // Sugerencias/Resumen asistidos por IA\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n\n    account: Account\n    // assignee: AccountUser | null;\n    customer: Customer | null\n    messages: SupportConversationMessage[]\n}\n\nexport interface SupportConversationMessage {\n    id: string\n    accountId: string\n    conversationId: string\n    direction: SupportConversationMessageDirection // Dirección simple (entrante/saliente)\n    senderType: SupportConversationMessageSenderType // Tipo de emisor del mensaje (cliente, usuario interno, anónimo, sistema o IA)\n    senderId?: string | null // Identificador del emisor cuando aplica (Customer o AccountUser). Puede ser null para anónimos, sistema o IA\n    body: string\n    isAiGenerated: boolean\n    isSystem: boolean\n    deliveryStatus: SupportConversationMessageDeliveryStatus // Estado de entrega (para OUTBOUND). Por defecto QUEUED para ser enviado por el canal.\n    requiresAiAnalysis: boolean\n    aiAnalysisStatus: SupportConversationMessageAiAnalysisStatus\n    aiAnalyzedAt?: Date | null\n    externalMessageId?: string | null // Identificadores de proveedor externo (messageId, threadId)\n    externalThreadId?: string | null\n    attachments?: Array<{\n        url: string\n        type?: string\n        name?: string\n        sizeBytes?: number\n    }> // Adjuntos simples (urls o descriptores livianos)\n    metadata?: Object | null // Metadatos flexibles (headers, payloads originales, etc.)\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n","import { StatusInfo } from \"../common/Status\";\nimport { FulfillmentStatus } from \"./types\";\n\nexport function getFulfillmentStatusInfo(status: FulfillmentStatus): StatusInfo {\n\tconst map: Record<FulfillmentStatus, StatusInfo> = {\n\t\tpending: { text: 'Paquete listo', class: 'warning', actionText: '' },\n\t\tshipped: { text: 'Enviado', class: 'warning', actionText: 'Enviado' },\n\t\tdelivered: { text: 'Entregado', class: 'success', actionText: 'Entregado' },\n\t\tcancelled: { text: 'Cancelado', class: 'danger', actionText: 'Cancelado' },\n\t};\n\n\treturn map[status] ?? { text: String(status), class: 'secondary' };\n}","/**\n * Entidad StoreCustomization\n * Configuración de la tienda\n */\n\nimport { Media } from \"../common\";\n\n/**\n * Tipos para la navegación personalizable del menú\n */\nexport enum NavigationItemType {\n  HOME = 'HOME',\n  CATALOG = 'CATALOG',\n  CATEGORY = 'CATEGORY',\n  COLLECTION = 'COLLECTION',\n  PAGE = 'PAGE',\n  CUSTOM = 'CUSTOM',\n}\n\nexport interface NavigationMenuItem {\n  id: string;\n  label: string;\n  itemType: NavigationItemType;\n  referenceId?: string;\n  customUrl?: string;\n  order: number;\n  includeChildren?: boolean;\n  highlight?: boolean;\n  highlightColor?: string;\n  openInNewTab?: boolean;\n}\n\nexport interface NavigationMenuConfig {\n  items: NavigationMenuItem[];\n  autoFallback?: boolean;\n}\n\n/**\n * Zona del Header: componentes antes y después del header principal\n */\nexport interface StoreCustomizationHeaderZone {\n  header: StoreCustomizationLayoutComponent;\n  preComponents: StoreCustomizationLayoutComponent[];\n  postComponents: StoreCustomizationLayoutComponent[];\n}\n\n/**\n * Zona del Footer: componentes antes y después del footer principal\n */\nexport interface StoreCustomizationFooterZone {\n  footer: StoreCustomizationLayoutComponent;\n  preComponents: StoreCustomizationLayoutComponent[];\n  postComponents: StoreCustomizationLayoutComponent[];\n}\n\n/**\n * Nueva estructura de layout con zonas\n */\nexport interface StoreCustomizationLayout {\n  headerZone: StoreCustomizationHeaderZone;\n  footerZone: StoreCustomizationFooterZone;\n}\n\nexport function isZonedLayout(layout: unknown): layout is StoreCustomizationLayout {\n  return !!(\n    layout &&\n    typeof layout === 'object' &&\n    'headerZone' in layout &&\n    'footerZone' in layout\n  );\n}\n\nexport interface StoreCustomization {\n  id: string;\n  accountId: string;\n  layout: StoreCustomizationLayout;\n  pages: StoreCustomizationPage[];\n  theme: {\n    colors: StoreCustomizationThemeColors;\n    typography: StoreCustomizationThemeTypography;\n    buttons: StoreCustomizationThemeButtons;\n    designTokens?: DesignTokens;\n  };\n  seo: StoreCustomizationSeo;\n  createdAt: Date;\n  updatedAt: Date;\n  deletedAt?: Date | null;\n}\n\nexport interface StoreCustomizationLayoutComponent {\n  id: string;\n  type: string;\n  name: string;\n  version: string;\n  settings: StoreCustomizationComponentSettings;\n}\n\nexport interface StoreCustomizationPageComponent {\n  id: string;\n  type: string;\n  name: string;\n  version: string;\n  settings: StoreCustomizationComponentSettings;\n}\n\n/** Builder page entry. For CMS pages (store_page type OTHER), id matches store_page.id. */\nexport interface StoreCustomizationPage {\n  id: string;\n  name: string;\n  path: string;\n  components: StoreCustomizationPageComponent[];\n}\n\nexport interface StoreCustomizationComponentSettings {\n  [key: string]: any;\n}\n\nexport interface StoreCustomizationThemeColors {\n  background: {\n      backgroundColor: string;\n  };\n  text: {\n      titleTextColor: string;\n      bodyTextColor: string;\n  };\n  theme: {\n      primaryColor: string;\n      secondaryColor: string;\n  };\n}\n\nexport interface StoreCustomizationThemeTypography {\n  headings: {\n      fontFamily: string;\n      fontSizeBase: number;\n      fontUppercase: boolean;\n  };\n  body: {\n      fontFamily: string;\n      fontSizeBase: number;\n      fontUppercase: boolean;\n  };\n\n}\n\nexport interface ButtonStyle {\n  backgroundColor: string;\n  textColor: string;\n  borderColor: string;\n  /** CSS string e.g. \"6px 6px 6px 6px\" */\n  borderRadius: string;\n  shadow: string;\n  hoverBackgroundColor: string;\n  hoverTextColor: string;\n  hoverBorderColor: string;\n  hoverEffect: string;\n}\n\nexport interface LinkButtonStyle extends ButtonStyle {\n  textDecoration?: string;\n  hoverTextDecoration?: string;\n}\n\nexport interface StoreCustomizationThemeButtons {\n  primary: ButtonStyle;\n  secondary: ButtonStyle;\n  outline: ButtonStyle;\n  link: LinkButtonStyle;\n  success: ButtonStyle;\n  warning: ButtonStyle;\n  danger: ButtonStyle;\n}\n\n// ============================================\n// DESIGN TOKENS - Sistema de Theme expandido\n// ============================================\n\n/**\n * Variante de color con sus estados\n */\nexport interface ColorVariant {\n  default: string;\n  light: string;\n  dark: string;\n  contrast: string;\n}\n\n/**\n * Escala de colores neutrales (50-900)\n */\nexport interface NeutralColorScale {\n  50: string;\n  100: string;\n  200: string;\n  300: string;\n  400: string;\n  500: string;\n  600: string;\n  700: string;\n  800: string;\n  900: string;\n}\n\n/**\n * Colores de superficie (fondos)\n */\nexport interface SurfaceColors {\n  background: string;\n  card: string;\n  overlay: string;\n}\n\n/**\n * Paleta de colores completa del theme\n */\nexport interface ThemeColorPalette {\n  primary: ColorVariant;\n  secondary: ColorVariant;\n  accent: ColorVariant;\n  neutral: NeutralColorScale;\n  success: ColorVariant;\n  warning: ColorVariant;\n  error: ColorVariant;\n  info: ColorVariant;\n  surface: SurfaceColors;\n}\n\n/**\n * Estilo de tipografía predefinido\n */\nexport interface TypographyStyle {\n  size: string;\n  weight: string;\n  lineHeight: number;\n  letterSpacing?: string;\n}\n\n/**\n * Estilos de tipografía disponibles\n */\nexport interface ThemeTypographyStyles {\n  display: TypographyStyle;\n  'heading-1': TypographyStyle;\n  'heading-2': TypographyStyle;\n  'heading-3': TypographyStyle;\n  'heading-4': TypographyStyle;\n  'body-large': TypographyStyle;\n  body: TypographyStyle;\n  'body-small': TypographyStyle;\n  caption: TypographyStyle;\n  label: TypographyStyle;\n}\n\n/**\n * Escala de tamaños de tipografía\n */\nexport interface ThemeTypographySizes {\n  xs: string;\n  sm: string;\n  base: string;\n  lg: string;\n  xl: string;\n  '2xl': string;\n  '3xl': string;\n  '4xl': string;\n  '5xl': string;\n}\n\n/**\n * Fuentes del theme\n */\nexport interface ThemeFonts {\n  heading: string;\n  body: string;\n}\n\n/**\n * Configuración completa de tipografía\n */\nexport interface ThemeTypography {\n  styles: ThemeTypographyStyles;\n  sizes: ThemeTypographySizes;\n  fonts: ThemeFonts;\n}\n\n/**\n * Estilo de variante de botón\n */\nexport interface ThemeButtonVariant {\n  background: string;\n  text: string;\n  border: string;\n  hoverBackground: string;\n  hoverText?: string;\n  hoverBorder?: string;\n}\n\n/**\n * Tamaño de botón\n */\nexport interface ThemeButtonSize {\n  padding: string;\n  fontSize: string;\n  borderRadius: string;\n}\n\n/**\n * Variantes de botones disponibles\n */\nexport interface ThemeButtonVariants {\n  primary: ThemeButtonVariant;\n  secondary: ThemeButtonVariant;\n  outline: ThemeButtonVariant;\n  ghost: ThemeButtonVariant;\n  danger: ThemeButtonVariant;\n  success: ThemeButtonVariant;\n}\n\n/**\n * Tamaños de botones disponibles\n */\nexport interface ThemeButtonSizes {\n  sm: ThemeButtonSize;\n  md: ThemeButtonSize;\n  lg: ThemeButtonSize;\n}\n\n/**\n * Configuración completa de botones\n */\nexport interface ThemeButtons {\n  variants: ThemeButtonVariants;\n  sizes: ThemeButtonSizes;\n}\n\n/**\n * Escala de espaciado\n */\nexport interface ThemeSpacing {\n  none: string;\n  xs: string;\n  sm: string;\n  md: string;\n  lg: string;\n  xl: string;\n  '2xl': string;\n  '3xl': string;\n  '4xl': string;\n}\n\n/**\n * Escala de border radius\n */\nexport interface ThemeBorderRadius {\n  none: string;\n  sm: string;\n  md: string;\n  lg: string;\n  xl: string;\n  '2xl': string;\n  full: string;\n}\n\n/**\n * Escala de border width\n */\nexport interface ThemeBorderWidth {\n  none: string;\n  thin: string;\n  medium: string;\n  thick: string;\n}\n\n/**\n * Configuración completa de bordes\n */\nexport interface ThemeBorders {\n  radius: ThemeBorderRadius;\n  width: ThemeBorderWidth;\n}\n\n/**\n * Escala de sombras\n */\nexport interface ThemeShadows {\n  none: string;\n  sm: string;\n  md: string;\n  lg: string;\n  xl: string;\n}\n\n/**\n * Configuración de Product Cards\n */\nexport interface ThemeProductCard {\n  borderRadius: string;\n  shadow: string;\n  padding: string;\n  imageAspectRatio: string;\n  showBorder: boolean;\n  borderColor: string;\n  hoverEffect: string;\n  titleSize: string;\n  titleWeight: string;\n  priceSize: string;\n  priceWeight: string;\n}\n\n/**\n * Design Tokens completo\n */\nexport interface DesignTokens {\n  colors: ThemeColorPalette;\n  typography: ThemeTypography;\n  buttons: ThemeButtons;\n  spacing: ThemeSpacing;\n  borders: ThemeBorders;\n  shadows: ThemeShadows;\n  productCard: ThemeProductCard;\n}\n\n\nexport interface StoreCustomizationSeo {\n  pageTitle: string;\n  pageSlogan: string;\n  pageDescription: string;\n  pageKeywords: string;\n  \n  pageImageId?: string | null;\n  pageImage?: Media | null;\n  faviconId?: string | null;\n  favicon?: Media | null;\n}\n\n ","/**\n * Store customization revision types\n * Historical snapshots and draft workspace for store_customization changes.\n */\n\nexport enum StoreCustomizationRevisionSource {\n  BUILDER = 'builder',\n  RESTORE = 'restore',\n  INITIAL = 'initial',\n  TEMPLATE = 'template',\n  SEO = 'seo',\n  CMS = 'cms',\n  PUBLISH = 'publish',\n}\n\nexport enum StoreCustomizationRevisionStatus {\n  DRAFT = 'draft',\n  ARCHIVED = 'archived',\n}\n\nexport interface StoreCustomizationRevisionSummary {\n  id: string;\n  accountId: string;\n  customizationId: string;\n  version: number | null;\n  source: StoreCustomizationRevisionSource;\n  status: StoreCustomizationRevisionStatus;\n  createdAt: Date;\n}\n\nexport interface StoreCustomizationRevisionSnapshot extends StoreCustomizationRevisionSummary {\n  layout: unknown;\n  pages: unknown;\n  theme: unknown;\n  seo: unknown | null;\n}\n\nexport interface StoreCustomizationDraftResponse {\n  id: string;\n  accountId: string;\n  layout: unknown;\n  pages: unknown;\n  theme: unknown;\n  seo: unknown | null;\n  previewToken: string;\n  previewUrl: string;\n  hasUnpublishedChanges: boolean;\n  updatedAt: Date;\n  createdAt: Date;\n}\n\nexport interface PublishCustomizationDraftResponse {\n  id: string;\n  accountId: string;\n  revisionVersion: number;\n  hasUnpublishedChanges: boolean;\n  updatedAt: Date;\n}\n\nexport interface StoreCustomizationPublishedCurrentSummary {\n  updatedAt: Date;\n  /** True when the builder draft already matches the live storefront. */\n  matchesDraft: boolean;\n}\n\nexport interface StoreCustomizationRevisionListResponse {\n  items: StoreCustomizationRevisionSummary[];\n  total: number;\n  publishedCurrent: StoreCustomizationPublishedCurrentSummary | null;\n}\n","// shared-types/src/storeCustomization/normalizeLayout.ts\nimport type { StoreCustomizationLayout, StoreCustomizationLayoutComponent } from './types'\nimport { isZonedLayout } from './types'\n\nconst emptyZoneComponents = {\n    preComponents: [] as StoreCustomizationLayoutComponent[],\n    postComponents: [] as StoreCustomizationLayoutComponent[],\n}\n\nexport function createEmptyStoreCustomizationLayout(): StoreCustomizationLayout {\n    return {\n        headerZone: {\n            header: null as unknown as StoreCustomizationLayoutComponent,\n            ...emptyZoneComponents,\n        },\n        footerZone: {\n            footer: null as unknown as StoreCustomizationLayoutComponent,\n            preComponents: [],\n            postComponents: [],\n        },\n    }\n}\n\nfunction copyZonedLayout(zoned: StoreCustomizationLayout): StoreCustomizationLayout {\n    return {\n        headerZone: {\n            header: (zoned.headerZone?.header ?? null) as StoreCustomizationLayoutComponent,\n            preComponents: Array.isArray(zoned.headerZone?.preComponents)\n                ? zoned.headerZone.preComponents\n                : [],\n            postComponents: Array.isArray(zoned.headerZone?.postComponents)\n                ? zoned.headerZone.postComponents\n                : [],\n        },\n        footerZone: {\n            footer: (zoned.footerZone?.footer ?? null) as StoreCustomizationLayoutComponent,\n            preComponents: Array.isArray(zoned.footerZone?.preComponents)\n                ? zoned.footerZone.preComponents\n                : [],\n            postComponents: Array.isArray(zoned.footerZone?.postComponents)\n                ? zoned.footerZone.postComponents\n                : [],\n        },\n    }\n}\n\nfunction migrateLegacyLayoutComponents(components: unknown[]): StoreCustomizationLayout {\n    const list = Array.isArray(components) ? components : []\n    const header =\n        (list.find((c: any) => c?.type === 'header') as StoreCustomizationLayoutComponent | undefined) ??\n        (null as unknown as StoreCustomizationLayoutComponent)\n    const footer =\n        (list.find((c: any) => c?.type === 'footer') as StoreCustomizationLayoutComponent | undefined) ??\n        (null as unknown as StoreCustomizationLayoutComponent)\n    const preHeaderComponents = list.filter(\n        (c: any) => c?.type === 'announcement-bar'\n    ) as StoreCustomizationLayoutComponent[]\n\n    return {\n        headerZone: {\n            header,\n            preComponents: preHeaderComponents,\n            postComponents: [],\n        },\n        footerZone: {\n            footer,\n            preComponents: [],\n            postComponents: [],\n        },\n    }\n}\n\n/** True when layout is legacy-only (`components[]` without zones). */\nexport function isLegacyStoreCustomizationLayout(layout: unknown): boolean {\n    return !!(\n        layout &&\n        typeof layout === 'object' &&\n        Array.isArray((layout as { components?: unknown[] }).components) &&\n        !isZonedLayout(layout)\n    )\n}\n\n/**\n * Accepts only zoned layouts. Strips stray legacy `components` from the payload.\n * Returns null for legacy-only or invalid input (must not be persisted as-is).\n */\nexport function sanitizeStoreCustomizationLayout(layout: unknown): StoreCustomizationLayout | null {\n    if (!layout || !isZonedLayout(layout)) {\n        return null\n    }\n    return copyZonedLayout(layout as StoreCustomizationLayout)\n}\n\n/**\n * Upgrades legacy `{ components[] }` from old DB rows or templates to zoned layout.\n * Use on read paths only — never persist the legacy shape again.\n */\nexport function upgradeLegacyStoreCustomizationLayout(layout: unknown): StoreCustomizationLayout {\n    const sanitized = sanitizeStoreCustomizationLayout(layout)\n    if (sanitized) {\n        return sanitized\n    }\n\n    if (layout && typeof layout === 'object' && Array.isArray((layout as { components?: unknown[] }).components)) {\n        return migrateLegacyLayoutComponents((layout as { components: unknown[] }).components)\n    }\n\n    return createEmptyStoreCustomizationLayout()\n}\n\n/** @deprecated Use sanitizeStoreCustomizationLayout (write) or upgradeLegacyStoreCustomizationLayout (read). */\nexport function normalizeStoreCustomizationLayout(layout: unknown): StoreCustomizationLayout {\n    return upgradeLegacyStoreCustomizationLayout(layout)\n}\n\nexport function resolveStoreCustomizationLayoutForRead(layout: unknown): StoreCustomizationLayout {\n    return upgradeLegacyStoreCustomizationLayout(layout)\n}\n\nexport function resolveStoreCustomizationLayoutForWrite(layout: unknown): StoreCustomizationLayout | null {\n    return sanitizeStoreCustomizationLayout(layout)\n}\n","/**\n * GeoZone types\n * Define zonas geográficas reutilizables que pueden ser referenciadas por otras entidades.\n */\n\nimport { MapPosition } from \"../common\";\n\nexport interface GeoZone {\n    id: string;\n    name: string;\n    description?: string;\n    accountId?: string | null; // null for system-wide zones (admin/integration created)\n    area: MapPosition[]; // Spatial geometry polygon\n    createdAt: Date;\n    updatedAt: Date;\n    deletedAt?: Date | null;\n}\n\nexport enum GeoZoneStatus {\n    ACTIVE = \"ACTIVE\",\n    INACTIVE = \"INACTIVE\",\n}","import { GeoZone } from \"../geoZone\";\nimport { Integration } from \"../integration\";\n\n/**\n * IntegrationDeliveryZone types\n * Define las zonas de entrega permitidas para cada integración de fulfillment provider.\n */\n\nexport interface IntegrationDeliveryZone {\n    id: string;\n    integrationId: string;\n    geoZoneId: string;\n    createdAt: Date;\n    updatedAt: Date;\n    deletedAt?: Date | null;\n\n    // Relations\n    integration?: Integration;\n    geoZone?: GeoZone;\n}\n\nexport enum IntegrationDeliveryZoneStatus {\n    ACTIVE = \"ACTIVE\",\n    INACTIVE = \"INACTIVE\",\n}","// shared-types/src/accountExchangeRate/types.ts - Account exchange rate configuration types\nimport { BaseEntityWithAccount } from '../common'\nimport { Currency } from '../common/Currency'\n\nexport interface AccountExchangeRate extends BaseEntityWithAccount {\n    id: string\n    accountId: string\n    // Moneda base (ej: USD)\n    baseCurrency: Currency\n    // Moneda objetivo (ej: ARS)\n    targetCurrency: Currency\n    // Tipo de configuración\n    configurationType: AccountExchangeRateType\n    // Tasa manual (solo para MANUAL)\n    manualRate?: number\n    // Ajuste porcentual sobre la tasa global (solo para AUTOMATIC_WITH_ADJUSTMENT)\n    adjustmentPercentage?: number\n    // Configuración de redondeo (solo para AUTOMATIC_WITH_ADJUSTMENT)\n    roundingConfig?: RoundingConfig\n    // Indica si está activo\n    isActive: boolean\n    // Fecha de última actualización manual\n    lastManualUpdate?: Date\n    // Metadata adicional\n    metadata?: AccountExchangeRateMetadata\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date\n}\n\n// Tipos de configuración disponibles\nexport enum AccountExchangeRateType {\n    // Usa automáticamente la tasa global más reciente\n    AUTOMATIC = 'AUTOMATIC',\n    // Usa la tasa global pero permite ajustes porcentuales y redondeo\n    AUTOMATIC_WITH_ADJUSTMENT = 'AUTOMATIC_WITH_ADJUSTMENT',\n    // Tasa completamente manual\n    MANUAL = 'MANUAL',\n}\n\n// Configuración de redondeo\nexport interface RoundingConfig {\n    // Método de redondeo\n    method: RoundingMethod\n    // Precisión decimal (ej: 2 para centavos)\n    decimalPlaces: number\n    // Regla especial de redondeo (opcional)\n    roundingRule?: RoundingRule\n}\n\n// Métodos de redondeo disponibles\nexport enum RoundingMethod {\n    // Redondeo estándar (0.5 redondea hacia arriba)\n    ROUND = 'ROUND',\n    // Siempre redondea hacia arriba\n    CEIL = 'CEIL',\n    // Siempre redondea hacia abajo\n    FLOOR = 'FLOOR',\n    // Redondeo bancario (half to even)\n    BANKERS = 'BANKERS',\n}\n\n// Reglas especiales de redondeo\nexport enum RoundingRule {\n    // Redondea al múltiplo de 5 más cercano (ej: 123.45 -> 123.45, 123.46 -> 123.50)\n    ROUND_TO_5_CENTS = 'ROUND_TO_5_CENTS',\n    // Redondea al múltiplo de 10 más cercano\n    ROUND_TO_10_CENTS = 'ROUND_TO_10_CENTS',\n    // Sin regla especial\n    NONE = 'NONE',\n}\n\n// Metadata adicional\nexport interface AccountExchangeRateMetadata {\n    // Descripción de la configuración\n    description?: string\n    // Notas adicionales\n    notes?: string\n    // Información adicional específica del account\n    [key: string]: any\n}\n\n// DTOs para operaciones\nexport interface CreateAccountExchangeRateDto {\n    baseCurrency: Currency\n    targetCurrency: Currency\n    configurationType: AccountExchangeRateType\n    manualRate?: number\n    adjustmentPercentage?: number\n    roundingConfig?: RoundingConfig\n    metadata?: AccountExchangeRateMetadata\n}\n\nexport interface UpdateAccountExchangeRateDto {\n    configurationType?: AccountExchangeRateType\n    manualRate?: number\n    adjustmentPercentage?: number\n    roundingConfig?: RoundingConfig\n    isActive?: boolean\n    metadata?: AccountExchangeRateMetadata\n}\n\nexport interface AccountExchangeRateQueryDto {\n    baseCurrency?: Currency\n    targetCurrency?: Currency\n    configurationType?: AccountExchangeRateType\n    isActive?: boolean\n    limit?: number\n    offset?: number\n}\n\n// Tipos para respuestas\nexport interface AccountExchangeRateResponse {\n    item: AccountExchangeRate\n}\n\n// DTO para actualizar todo (tasas independientes)\nexport interface UpdateAccountExchangeRateAllDto {\n    globalConfig?: any // Deprecated, kept for compatibility during transition\n    rates: Array<{\n        id?: string // Si existe, actualizar; si no, crear\n        targetCurrency: Currency\n        configurationType: AccountExchangeRateType\n        manualRate?: number\n        adjustmentPercentage?: number\n        roundingConfig?: RoundingConfig\n    }>\n}\n\n// Respuesta del GET con estructura completa\nexport interface AccountExchangeRateListResponse {\n    storeCurrency: Currency // Moneda de la tienda (account.currency)\n    paymentCurrencies: Currency[] // Monedas de procesadores detectadas\n    rates: AccountExchangeRateWithEffectiveRate[] // Array de tasas con effectiveRate calculado\n}\n\n// Extensión de AccountExchangeRate con tasa efectiva\nexport interface AccountExchangeRateWithEffectiveRate extends AccountExchangeRate {\n    effectiveRate: number // Tasa calculada: 1 storeCurrency = X targetCurrency\n    baseGlobalRate: number // Tasa base de exchange_rate\n    source: string // Fuente de la tasa global\n    effectiveDate: Date // Fecha de la tasa global\n}\n\n// Tipo para configuración completa de monedas por account\nexport interface AccountCurrencyConfig {\n    accountId: string\n    // Moneda principal del account\n    primaryCurrency: Currency\n    // Todas las configuraciones de tasa para este account\n    exchangeRates: AccountExchangeRate[]\n    // Tasas efectivas calculadas (incluyendo ajustes)\n    effectiveRates: EffectiveExchangeRate[]\n}\n\n// Tasa efectiva calculada (lo que realmente se usa para conversiones)\nexport interface EffectiveExchangeRate {\n    baseCurrency: Currency\n    targetCurrency: Currency\n    // Tasa final después de aplicar ajustes y redondeo\n    effectiveRate: number\n    // Tasa base global utilizada\n    baseGlobalRate: number\n    // Tipo de configuración aplicada\n    configurationType: AccountExchangeRateType\n    // Fecha efectiva de la tasa global\n    effectiveDate: Date\n    // Fuente de la tasa global\n    source: string\n}\n","// shared-types/src/storeTemplate/portable.ts\nimport type { StoreCustomization } from '../storeCustomization/types'\n\n/** Builder/system page IDs that stay stable across accounts (not store_page UUIDs). */\nexport const SYSTEM_BUILDER_PAGE_IDS: ReadonlySet<string> = new Set([\n    'home',\n    'catalog',\n    'product-detail',\n    'contact',\n])\n\n/** Portable CMS page IDs in persisted store_template rows (avoid cross-account UUID leaks). */\nexport const TPL_PAGE_PREFIX = 'tpl-page:' as const\n\n/**\n * Matches template path or web URL segment to a single canonical key (slug only, lowercase).\n * Example: \"/Mi-Pagina/\" -> \"mi-pagina\".\n */\nexport function slugKeyFromCustomizationPath(path: string | undefined | null): string {\n    const s = String(path ?? '')\n        .trim()\n        .replace(/^\\/+/g, '')\n        .replace(/\\/+$/g, '')\n        .toLowerCase()\n    return s === '' ? 'root' : s\n}\n\nconst UUID_RE =\n    /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i\n\nexport function isTplPortablePageId(id: string): boolean {\n    return id.startsWith(TPL_PAGE_PREFIX)\n}\n\n/** True when id is a probable store_page UUID (not system, not portable prefix). */\nexport function isLikelyLegacyCmsPageUuid(id: string): boolean {\n    if (!id || SYSTEM_BUILDER_PAGE_IDS.has(id)) return false\n    if (isTplPortablePageId(id)) return false\n    return UUID_RE.test(id)\n}\n\nexport function remapPageReferenceIdsDeep(obj: unknown, idMap: ReadonlyMap<string, string>): void {\n    if (obj === null || obj === undefined || typeof obj !== 'object') return\n    if (Array.isArray(obj)) {\n        for (const entry of obj) remapPageReferenceIdsDeep(entry, idMap)\n        return\n    }\n    const o = obj as Record<string, unknown>\n    const ref = o.referenceId\n    const pageRel =\n        o.itemType === 'PAGE' || o.linkType === 'PAGE'\n    if (typeof ref === 'string' && ref.length > 0 && pageRel && idMap.has(ref)) {\n        o.referenceId = idMap.get(ref)!\n    }\n    for (const k of Object.keys(o)) {\n        if (k === 'referenceId' && pageRel) continue\n        remapPageReferenceIdsDeep(o[k], idMap)\n    }\n}\n\n/** Deep clones layout + theme + pages (JSON round-trip). */\nfunction cloneCustomizationSlice(config: Partial<Pick<StoreCustomization, 'layout' | 'pages' | 'theme'>>) {\n    return JSON.parse(JSON.stringify(config)) as Partial<Pick<StoreCustomization, 'layout' | 'pages' | 'theme'>>\n}\n\n/**\n * Replaces CMS page IDs with portable `tpl-page:{slugKey}` IDs and rewires PAGE referenceIds (header, grids…).\n */\nexport function normalizeTemplateConfigForPersist(config: Partial<Pick<StoreCustomization, 'layout' | 'pages' | 'theme'>>) {\n    if (!config?.pages || !Array.isArray(config.pages)) return config\n\n    const next = cloneCustomizationSlice(config)\n    const pages = next.pages!\n\n    /** Map old customization page id -> portable id (for CMS pages only). */\n    const exportMap = new Map<string, string>()\n\n    for (const raw of pages) {\n        const p = raw as { id?: string; path?: string }\n        const oldId = typeof p?.id === 'string' ? p.id : ''\n        if (!oldId || SYSTEM_BUILDER_PAGE_IDS.has(oldId)) continue\n\n        const key = slugKeyFromCustomizationPath(p.path)\n        const portableId = `${TPL_PAGE_PREFIX}${key}`\n        if (oldId !== portableId) exportMap.set(oldId, portableId)\n        p.id = portableId\n    }\n\n    if (exportMap.size > 0 && next.layout !== undefined && next.layout !== null) {\n        remapPageReferenceIdsDeep(next.layout, exportMap)\n    }\n\n    return next\n}\n\n/** Local preview: remap portable UUIDs/refs to ids from the current customization `pages`. */\nexport function remapPortableTemplateForLocalPreview<\n    T extends Partial<Pick<StoreCustomization, 'layout' | 'pages' | 'theme'>>,\n>(config: T, localCustomizationPages: Array<{ id?: string; path?: string }>): T {\n    if (!config.pages || !Array.isArray(config.pages)) return JSON.parse(JSON.stringify(config))\n\n    const out = cloneCustomizationSlice(config as Partial<Pick<StoreCustomization, 'layout' | 'pages' | 'theme'>>) as T\n\n    /** slugKey -> first matching local customization page id */\n    const slugToLocalId = new Map<string, string>()\n    for (const lp of localCustomizationPages) {\n        if (typeof lp?.id !== 'string' || !lp.id || SYSTEM_BUILDER_PAGE_IDS.has(lp.id)) continue\n        const k = slugKeyFromCustomizationPath(lp.path)\n        if (!slugToLocalId.has(k)) slugToLocalId.set(k, lp.id)\n    }\n\n    const idMap = new Map<string, string>()\n\n    const pagesArr = out.pages as Array<{ id?: string; path?: string }>\n    for (const p of pagesArr) {\n        const oldId = typeof p?.id === 'string' ? p.id : ''\n        if (!oldId || SYSTEM_BUILDER_PAGE_IDS.has(oldId)) continue\n\n        if (isTplPortablePageId(oldId)) {\n            const key = oldId.slice(TPL_PAGE_PREFIX.length)\n            const local = slugToLocalId.get(key)\n            if (local) {\n                idMap.set(oldId, local)\n                p.id = local\n            }\n            continue\n        }\n\n        if (isLikelyLegacyCmsPageUuid(oldId)) {\n            const k = slugKeyFromCustomizationPath(p.path)\n            const local = slugToLocalId.get(k)\n            if (local && local !== oldId) {\n                idMap.set(oldId, local)\n                p.id = local\n            }\n        }\n    }\n\n    if (idMap.size > 0 && out.layout !== undefined && out.layout !== null) {\n        remapPageReferenceIdsDeep(out.layout, idMap)\n    }\n\n    return out\n}\n","// shared-types/src/analytics/types.ts - Analytics types for tracking and reporting\n\nimport { BaseEntityWithAccount } from '../common'\n\n/**\n * Traffic source types\n */\nexport enum TrafficSource {\n    DIRECT = 'direct',\n    ORGANIC = 'organic',\n    PAID = 'paid',\n    REFERRAL = 'referral',\n    SOCIAL = 'social',\n    EMAIL = 'email',\n    OTHER = 'other',\n}\n\n/**\n * Device types\n */\nexport enum DeviceType {\n    DESKTOP = 'desktop',\n    MOBILE = 'mobile',\n    TABLET = 'tablet',\n}\n\n/**\n * Page types for categorization\n */\nexport enum PageType {\n    HOME = 'home',\n    CATALOG = 'catalog',\n    PRODUCT = 'product',\n    CART = 'cart',\n    CHECKOUT = 'checkout',\n    ORDER_CONFIRMATION = 'order_confirmation',\n    PAGE = 'page',\n    SEARCH = 'search',\n    OTHER = 'other',\n}\n\n/**\n * Event types for analytics tracking\n */\nexport enum AnalyticsEventType {\n    // Session events\n    SESSION_START = 'session_start',\n    SESSION_END = 'session_end',\n\n    // Page events\n    PAGE_VIEW = 'page_view',\n\n    // Product events\n    PRODUCT_VIEW = 'product_view',\n    PRODUCT_LIST_VIEW = 'product_list_view',\n    PRODUCT_SEARCH = 'product_search',\n    SEARCH_SUGGESTION_CLICK = 'search_suggestion_click',\n    PRODUCT_SELECT = 'product_select',\n    PRODUCT_SHARE = 'product_share',\n\n    // Cart events\n    ADD_TO_CART = 'add_to_cart',\n    REMOVE_FROM_CART = 'remove_from_cart',\n    UPDATE_CART_QUANTITY = 'update_cart_quantity',\n    CART_ITEM_ADDED = 'cart_item_added',\n    CART_ITEM_REMOVED = 'cart_item_removed',\n    CART_ITEM_QUANTITY_UPDATED = 'cart_item_quantity_updated',\n\n    // Checkout events\n    CHECKOUT_START = 'checkout_start',\n    CHECKOUT_STEP = 'checkout_step',\n    CHECKOUT_COMPLETE = 'checkout_complete',\n    CHECKOUT_VIEW = 'checkout_view',\n    CHECKOUT_ADD_CUSTOMER_INFO = 'checkout_add_customer_info',\n    CHECKOUT_ADD_PAYMENT_INFO = 'checkout_add_payment_info',\n    CHECKOUT_ADD_SHIPPING_INFO = 'checkout_add_shipping_info',\n    CHECKOUT_ADD_BILLING_INFO = 'checkout_add_billing_info',\n    CHECKOUT_CONFIRMED = 'checkout_confirmed',\n\n    // Conversion events\n    PURCHASE = 'purchase',\n\n    // Engagement events\n    CLICK = 'click',\n    SCROLL = 'scroll',\n}\n\n/**\n * Funnel steps for sales funnel analysis\n */\nexport enum FunnelStep {\n    VISIT = 'visit',\n    PRODUCT_VIEW = 'product_view',\n    ADD_TO_CART = 'add_to_cart',\n    CHECKOUT_START = 'checkout_start',\n    CHECKOUT_COMPLETE = 'checkout_complete',\n    PURCHASE = 'purchase',\n}\n\n/**\n * Analytics Session - Tracks a user visit session\n */\nexport interface AnalyticsSession extends BaseEntityWithAccount {\n    visitorId: string\n    cartId?: string\n    customerId?: string\n\n    // Timing\n    startedAt: Date\n    endedAt?: Date\n    duration?: number // in seconds\n    lastActivityAt: Date\n\n    // Traffic source\n    source: TrafficSource\n    medium?: string\n    campaign?: string\n    content?: string\n    term?: string\n\n    // Referrer info\n    referrer?: string\n    referrerDomain?: string\n\n    // Pages\n    landingPage: string\n    exitPage?: string\n    pageviews: number\n    events: number\n\n    // Device info\n    device: DeviceType\n    browser?: string\n    browserVersion?: string\n    os?: string\n    osVersion?: string\n    screenWidth?: number\n    screenHeight?: number\n\n    // Location (from IP)\n    country?: string\n    region?: string\n    city?: string\n\n    // Conversion\n    isConverted: boolean\n    conversionValue: number\n    orderId?: string\n}\n\n/**\n * Analytics Event - Individual user action\n */\nexport interface AnalyticsEvent extends BaseEntityWithAccount {\n    sessionId: string\n    visitorId: string\n\n    // Event info\n    eventType: AnalyticsEventType\n    eventData?: Record<string, any>\n\n    // Page context\n    pageUrl: string\n    pageTitle?: string\n    pageType?: PageType\n\n    // Product context (for product events)\n    productId?: string\n    productVariantId?: string\n    productSku?: string\n    categoryId?: string\n\n    // Cart/Order context (for conversion events)\n    cartId?: string\n    orderId?: string\n\n    // Value\n    value?: number\n    currency?: string\n\n    timestamp: Date\n}\n\n/**\n * Analytics Pageview - Page view tracking\n */\nexport interface AnalyticsPageview extends BaseEntityWithAccount {\n    sessionId: string\n    visitorId: string\n\n    pageUrl: string\n    pageTitle?: string\n    pageType: PageType\n\n    referrerUrl?: string\n\n    timeOnPage?: number // in seconds\n    scrollDepth?: number // percentage 0-100\n\n    timestamp: Date\n}\n\n/**\n * Analytics Funnel Step - Aggregated funnel data\n */\nexport interface AnalyticsFunnelStep extends BaseEntityWithAccount {\n    date: Date\n    step: FunnelStep\n    count: number\n    uniqueVisitors: number\n    conversionFromPrevious?: number // percentage\n}\n\n// ============================================\n// DTOs for API requests\n// ============================================\n\n/**\n * DTO for creating/updating a session\n */\nexport interface CreateAnalyticsSessionDto {\n    visitorId: string\n    cartId?: string\n    customerId?: string\n    landingPage: string\n    source: TrafficSource\n    medium?: string\n    campaign?: string\n    content?: string\n    term?: string\n    referrer?: string\n    referrerDomain?: string\n    device: DeviceType\n    browser?: string\n    browserVersion?: string\n    os?: string\n    osVersion?: string\n    screenWidth?: number\n    screenHeight?: number\n}\n\n/**\n * DTO for tracking an event\n */\nexport interface TrackEventDto {\n    sessionId: string\n    visitorId: string\n    eventType: AnalyticsEventType\n    eventData?: Record<string, any>\n    pageUrl: string\n    pageTitle?: string\n    pageType?: PageType\n    productId?: string\n    productVariantId?: string\n    productSku?: string\n    categoryId?: string\n    cartId?: string\n    orderId?: string\n    value?: number\n    currency?: string\n}\n\n/**\n * DTO for tracking a pageview\n */\nexport interface TrackPageviewDto {\n    sessionId: string\n    visitorId: string\n    pageUrl: string\n    pageTitle?: string\n    pageType: PageType\n    referrerUrl?: string\n}\n\n/**\n * DTO for session heartbeat (keep alive)\n */\nexport interface SessionHeartbeatDto {\n    sessionId: string\n    visitorId: string\n    currentPage?: string\n    scrollDepth?: number\n    timeOnPage?: number\n    pageviewId?: string\n}\n\n// ============================================\n// Response types for dashboard\n// ============================================\n\n/**\n * Real-time analytics data\n */\nexport interface RealtimeAnalytics {\n    activeVisitors: number\n    activeSessions: ActiveSession[]\n    recentEvents: RecentEvent[]\n    pageviewsLastHour: number\n    conversionsLastHour: number\n    revenueLastHour: number\n}\n\nexport interface ActiveSession {\n    sessionId: string\n    visitorId: string\n    currentPage: string\n    pageType: PageType\n    device: DeviceType\n    source: TrafficSource\n    startedAt: Date\n    pageviews: number\n}\n\nexport interface RecentEvent {\n    eventType: AnalyticsEventType\n    pageUrl: string\n    productName?: string\n    value?: number\n    timestamp: Date\n}\n\n/**\n * Overview analytics for a period\n */\nexport interface AnalyticsOverview {\n    // Visitors\n    totalVisits: number\n    uniqueVisitors: number\n    newVisitors: number\n    returningVisitors: number\n\n    // Engagement\n    totalPageviews: number\n    avgSessionDuration: number // in seconds\n    avgPagesPerSession: number\n    bounceRate: number // percentage\n\n    // Conversions\n    totalConversions: number\n    conversionRate: number // percentage\n    totalRevenue: number\n    avgOrderValue: number\n\n    // Comparison with previous period\n    visitsPop?: number // period over period change %\n    conversionsPop?: number\n    revenuePop?: number\n}\n\n/**\n * Traffic sources breakdown\n */\nexport interface TrafficSourcesData {\n    sources: TrafficSourceItem[]\n    total: number\n}\n\nexport interface TrafficSourceItem {\n    source: TrafficSource\n    visits: number\n    uniqueVisitors: number\n    conversions: number\n    conversionRate: number\n    revenue: number\n    percentage: number\n}\n\n/**\n * Sales funnel data\n */\nexport interface FunnelData {\n    steps: FunnelStepData[]\n    overallConversionRate: number\n}\n\nexport interface FunnelStepData {\n    step: FunnelStep\n    label: string\n    count: number\n    uniqueVisitors: number\n    conversionRate: number // from previous step\n    dropoffRate: number // from previous step\n}\n\n/**\n * Campaign performance\n */\nexport interface CampaignPerformance {\n    campaigns: CampaignData[]\n    total: {\n        visits: number\n        conversions: number\n        revenue: number\n    }\n}\n\nexport interface CampaignData {\n    campaign: string\n    source: string\n    medium: string\n    visits: number\n    uniqueVisitors: number\n    conversions: number\n    conversionRate: number\n    revenue: number\n    avgOrderValue: number\n}\n\n/**\n * Top pages data\n */\nexport interface TopPagesData {\n    pages: PageData[]\n}\n\nexport interface PageData {\n    pageUrl: string\n    pageTitle: string\n    pageType: PageType\n    views: number\n    uniqueViews: number\n    avgTimeOnPage: number\n    bounceRate: number\n    exitRate: number\n}\n\n/**\n * Product analytics\n */\nexport interface ProductAnalyticsData {\n    products: ProductAnalyticsItem[]\n}\n\nexport interface ProductAnalyticsItem {\n    productId: string\n    productName: string\n    sku: string\n    views: number\n    addToCarts: number\n    purchases: number\n    viewToCartRate: number\n    cartToPurchaseRate: number\n    revenue: number\n}\n\n/**\n * Historical data point for charts\n */\nexport interface HistoricalDataPoint {\n    date: string // ISO date string\n    visits: number\n    uniqueVisitors: number\n    pageviews: number\n    conversions: number\n    revenue: number\n}\n\n/**\n * Query parameters for analytics endpoints\n */\nexport interface AnalyticsQueryParams {\n    startDate: string // ISO date\n    endDate: string // ISO date\n    compareWithPrevious?: boolean\n    source?: TrafficSource\n    device?: DeviceType\n    campaign?: string\n}\n\n/**\n * Pagination for analytics lists\n */\nexport interface AnalyticsPagination {\n    page: number\n    limit: number\n    total: number\n}\n","export enum InternalNotificationType {\n  ORDER_PLACED_SELLER = 'ORDER_PLACED_SELLER',\n  CONTACT_FORM_SUBMITTED = 'CONTACT_FORM_SUBMITTED',\n  ABANDONED_CART = 'ABANDONED_CART',\n  ORDER_PENDING_PAYMENT = 'ORDER_PENDING_PAYMENT',\n}\n\nexport interface CustomerNotificationConfig {\n  delayHours?: number;\n}\n\nexport interface InternalNotificationConfig {\n  id: string;\n  accountId: string;\n  notificationType: InternalNotificationType;\n  enabled: boolean;\n  recipientUserIds: string[] | null;\n  recipientEmails: string[] | null;\n  config: CustomerNotificationConfig | null;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nexport interface UpdateNotificationSettingsDTO {\n  enabled?: boolean;\n  recipientUserIds?: string[];\n  recipientEmails?: string[];\n  delayHours?: number;\n}\n","// shared-types/src/serviceBilling/types.ts - Service billing (plans and charges for merchants)\n\n/** Catalog price row and contract term: amount is the total for this period (e.g. full year for ANNUAL). */\nexport enum BillingInterval {\n    MONTHLY = 'MONTHLY',\n    SEMIANNUAL = 'SEMIANNUAL',\n    ANNUAL = 'ANNUAL',\n}\n\n/** How often a subscription charge is generated (may split the contract total into installments). */\nexport enum PaymentFrequency {\n    MONTHLY = 'MONTHLY',\n    QUARTERLY = 'QUARTERLY',\n    SEMIANNUAL = 'SEMIANNUAL',\n    ANNUAL = 'ANNUAL',\n}\n\n/** Single item in a spec category (display-like structure). */\nexport interface ServiceBillingPlanSpecItem {\n    key: string\n    label: string\n}\n\n/** Category for the plan comparison table (display only). */\nexport interface ServiceBillingPlanSpecCategory {\n    id: string\n    label: string\n    /** Keys to show. Legacy when items is set. */\n    itemKeys?: string[]\n    /** Display-like: each item has key and label. When set, used instead of itemKeys + labels. */\n    items?: ServiceBillingPlanSpecItem[]\n}\n\n/** Defines comparison table: structure and optional values. Stored in service_billing_plan.specs. */\nexport interface ServiceBillingPlanSpec {\n    categories: ServiceBillingPlanSpecCategory[]\n    /** Map key -> label. Used when category uses itemKeys (legacy). */\n    labels?: Record<string, string>\n    /** Values for this plan; when set, used for comparison instead of limits. */\n    values?: Record<string, unknown>\n}\n\nexport interface ServiceBillingPlanLimits {\n    maxProducts?: number | null\n    maxBranches?: number | null\n    maxAccountUsers?: number | null\n    maxProductCategories?: number | null\n    maxDeliveryOptions?: number | null\n    maxIntegrations?: number | null\n    maxStorageMb?: number | null\n    customDomainAllowed?: boolean\n    bulkImportAllowed?: boolean\n    maxBulkImportRows?: number | null\n    advancedAnalytics?: boolean\n    maxOrdersPerMonth?: number | null\n    /** Soporte: \"Estándar\" | \"Prioritario\" | \"Dedicado\" */\n    supportLevel?: string | null\n    marketingIncluded?: boolean\n    customApiIntegrations?: boolean\n    storeCustomization?: boolean\n    customEmail?: boolean\n    /** Maximum number of mailboxes (email accounts) the account can create. */\n    maxMailboxes?: number | null\n    reportsAndExport?: boolean\n    multiCurrency?: boolean\n    webhooks?: boolean\n    eInvoicing?: boolean\n    trainingOnboarding?: boolean\n    whiteLabel?: boolean\n}\n\nexport interface ServiceBillingPlan {\n    id: string\n    name: string\n    slug: string\n    currency: string\n    description?: string | null\n    order: number\n    /** Enforced and display values (maxProducts, maxBranches, feature flags, etc.). */\n    limits?: ServiceBillingPlanLimits | null\n    /** Optional: comparison table structure (categories, order, labels). If null, backoffice uses default. */\n    specs?: ServiceBillingPlanSpec | null\n    createdAt: Date\n    updatedAt: Date\n}\n\nexport interface ServiceBillingPlanPrice {\n    id: string\n    serviceBillingPlanId: string\n    /** Contract / pricing period this row applies to (matches account assignment contract term). */\n    billingInterval: BillingInterval\n    amount: number\n    aiImageCreditsIncluded: number\n    aiTextCreditsIncluded: number\n    createdAt: Date\n    updatedAt: Date\n}\n\nexport enum AccountServicePlanStatus {\n    ACTIVE = 'ACTIVE',\n    ENDED = 'ENDED',\n    CANCELLED = 'CANCELLED',\n}\n\nexport interface AccountServicePlan {\n    id: string\n    accountId: string\n    serviceBillingPlanId: string\n    status: AccountServicePlanStatus\n    customAmount?: number | null\n    /** Contract term; selects `service_billing_plan_price` row (catalog total for this term). */\n    billingInterval?: BillingInterval | null\n    /** Charge cadence; installments divide the contract catalog/custom total. Null = same as billingInterval (legacy). */\n    paymentFrequency?: PaymentFrequency | null\n    /** Optional one-time fee; generates an INSTALLATION charge when the job runs. */\n    installationFee?: number | null\n    /** First day of the first billable subscription period; installation fee is also anchored to this date. */\n    startedAt: Date\n    endedAt?: Date | null\n    notes?: string | null\n    createdAt: Date\n    updatedAt: Date\n    serviceBillingPlan?: ServiceBillingPlan\n    prices?: ServiceBillingPlanPrice[]\n}\n\nexport enum ChargeType {\n    SUBSCRIPTION = 'SUBSCRIPTION',\n    INSTALLATION = 'INSTALLATION',\n    ADJUSTMENT = 'ADJUSTMENT',\n    OTHER = 'OTHER',\n}\n\nexport enum ChargeStatus {\n    PENDING = 'PENDING',\n    PAID = 'PAID',\n    CANCELLED = 'CANCELLED',\n}\n\n/** Sociedad que recibió el pago del comercio (cobro en caja propia). No es el vendedor. */\nexport enum BillingSociety {\n    COBRATICKET = 'COBRATICKET',\n    RHINO = 'RHINO',\n}\n\nexport interface AccountServiceBillingCharge {\n    id: string\n    accountId: string\n    accountServicePlanId?: string | null\n    amount: number\n    currency: string\n    type: ChargeType\n    /** For SUBSCRIPTION: length of the billed period (payment frequency), e.g. MONTHLY or QUARTERLY. */\n    billingInterval?: BillingInterval | PaymentFrequency | null\n    periodStart?: Date | null\n    periodEnd?: Date | null\n    dueDate?: Date | null\n    paidAt?: Date | null\n    status: ChargeStatus\n    externalReference?: string | null\n    description?: string | null\n    /** Public URL of invoice/receipt PDF or image (e.g. Gestión upload to GCS). */\n    invoiceUrl?: string | null\n    /** Set when status is PAID: which society collected the payment. */\n    collectedBySociety?: BillingSociety | null\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n","// shared-types/src/serviceBilling/billingSchedule.ts — contract term vs payment frequency math\nimport { BillingInterval, PaymentFrequency } from './types'\n\nexport function contractTermMonths(contract: BillingInterval): number {\n    switch (contract) {\n        case BillingInterval.MONTHLY:\n            return 1\n        case BillingInterval.SEMIANNUAL:\n            return 6\n        case BillingInterval.ANNUAL:\n            return 12\n        default:\n            return 1\n    }\n}\n\nexport function paymentFrequencyMonths(freq: PaymentFrequency): number {\n    switch (freq) {\n        case PaymentFrequency.MONTHLY:\n            return 1\n        case PaymentFrequency.QUARTERLY:\n            return 3\n        case PaymentFrequency.SEMIANNUAL:\n            return 6\n        case PaymentFrequency.ANNUAL:\n            return 12\n        default:\n            return 1\n    }\n}\n\n/**\n * Number of subscription charges in one full contract term, or null if incompatible\n * (e.g. quarterly billing on a 1-month contract).\n */\nexport function subscriptionInstallmentCount(\n    contract: BillingInterval,\n    payment: PaymentFrequency\n): number | null {\n    const cm = contractTermMonths(contract)\n    const pm = paymentFrequencyMonths(payment)\n    if (pm > cm) return null\n    if (cm % pm !== 0) return null\n    return cm / pm\n}\n\nexport function resolveEffectivePaymentFrequency(\n    contract: BillingInterval,\n    paymentFrequency: PaymentFrequency | null | undefined\n): PaymentFrequency {\n    if (paymentFrequency != null) return paymentFrequency\n    return contract as unknown as PaymentFrequency\n}\n\n/** Per-charge amount from the contract-period total (catalog or custom). */\nexport function subscriptionAmountPerInstallment(\n    contractTotalAmount: number,\n    contract: BillingInterval,\n    payment: PaymentFrequency\n): number | null {\n    const n = subscriptionInstallmentCount(contract, payment)\n    if (n == null || n <= 0) return null\n    return Math.round((contractTotalAmount / n) * 100) / 100\n}\n\n/** IA credits to grant per subscription charge (proportional to installments). */\nexport function aiCreditsPerSubscriptionInstallment(\n    creditsIncludedPerContract: number,\n    contract: BillingInterval,\n    payment: PaymentFrequency\n): number {\n    const n = subscriptionInstallmentCount(contract, payment)\n    if (n == null || n <= 0) return creditsIncludedPerContract\n    return Math.round(creditsIncludedPerContract / n)\n}\n","// shared-types/src/holiday/types.ts\n\nexport enum HolidayType {\n    /** Business is expected to be closed. Default: excluded from delivery calculation. */\n    NON_WORKING = 'NON_WORKING',\n    /** Business may choose to work. Default: included in delivery calculation. */\n    WORKING = 'WORKING',\n}\n\nexport interface Holiday {\n    id: string\n    /** ISO date string \"YYYY-MM-DD\" */\n    date: string\n    /** ISO 3166-1 alpha-2 country code (e.g. \"UY\", \"AR\") */\n    country: string\n    name: string\n    type: HolidayType\n    createdAt: Date\n    updatedAt: Date\n}\n\nexport interface AccountHolidaySchedule {\n    id: string\n    accountId: string\n    holidayId: string\n    /** Whether the account will operate on this holiday */\n    isOpen: boolean\n    respondedAt: Date\n    /** Tracks whether a reminder has already been sent */\n    reminderSentAt?: Date | null\n    createdAt: Date\n    updatedAt: Date\n}\n","// shared-types/src/lead/types.ts - Lead entity (web contact form + CRM fields)\n\n/** Ordered pipeline stages for Kanban (fixed funnel v1). */\nexport const LEAD_DEAL_STAGE_ORDER = [\n    'NEW',\n    'CONTACTED',\n    'QUALIFIED',\n    'DEMO_SCHEDULED',\n    'TRIAL',\n    'PROPOSAL',\n    'NEGOTIATION',\n    'WON',\n    'LOST',\n] as const\n\nexport type LeadDealStage = (typeof LEAD_DEAL_STAGE_ORDER)[number]\n\nexport const LEAD_DEAL_STAGES: readonly LeadDealStage[] = LEAD_DEAL_STAGE_ORDER\n\nexport function isLeadDealStage(value: string): value is LeadDealStage {\n    return (LEAD_DEAL_STAGE_ORDER as readonly string[]).includes(value)\n}\n\nexport type LeadActivityType =\n    | 'NOTE'\n    | 'CALL'\n    | 'EMAIL'\n    | 'MEETING'\n    | 'STAGE_CHANGE'\n    | 'ASSIGNMENT_CHANGE'\n\nexport type LeadLostReason = 'PRICE' | 'TIMING' | 'COMPETITOR' | 'NO_FIT' | 'NO_RESPONSE' | 'OTHER'\n\nexport type LeadPriority = 'LOW' | 'MEDIUM' | 'HIGH'\n\nexport type LeadSource = 'WEB' | 'REFERRAL' | 'OUTBOUND' | 'PARTNER' | 'OTHER'\n\nexport interface Lead {\n    id: string\n    name: string\n    company: string\n    email: string\n    phone: string\n    message: string\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date\n    /** CRM pipeline stage (DB default NEW). */\n    dealStage?: LeadDealStage\n    /** Retail `seller` (comisionista), not gestión interna. */\n    assignedSellerId?: string | null\n    leadSource?: LeadSource | string | null\n    estimatedValue?: number | null\n    estimatedValueCurrency?: string | null\n    expectedCloseAt?: Date | null\n    nextFollowUpAt?: Date | null\n    priority?: LeadPriority | string | null\n    convertedAccountId?: string | null\n    lostReason?: string | null\n}\n\n/** Payload to create a lead (e.g. from landing form). */\nexport interface CreateLeadDTO {\n    name: string\n    company: string\n    email: string\n    phone: string\n    message: string\n}\n\nexport interface UpdateLeadDTO {\n    dealStage?: LeadDealStage\n    /** Retail `seller` (comisionista), not gestión interna. */\n    assignedSellerId?: string | null\n    leadSource?: LeadSource | string | null\n    estimatedValue?: number | null\n    estimatedValueCurrency?: string | null\n    expectedCloseAt?: string | null\n    nextFollowUpAt?: string | null\n    priority?: LeadPriority | string | null\n    convertedAccountId?: string | null\n    lostReason?: string | null\n}\n\nexport interface CreateLeadActivityDTO {\n    type: LeadActivityType\n    body?: string | null\n    metadata?: Record<string, unknown> | null\n}\n\nexport interface LeadActivity {\n    id: string\n    leadId: string\n    type: LeadActivityType\n    body: string | null\n    metadata: Record<string, unknown> | null\n    createdByGestionUserId: string | null\n    createdByName?: string | null\n    createdAt: Date\n    updatedAt: Date\n}\n\nexport type LeadCrmDashboardSummary = {\n    total: number\n    byStage: Record<LeadDealStage, number>\n    followUpOverdue: number\n}\n","// shared-types/src/gestionUser/types.ts\nexport enum GestionUserRole {\n    OWNER = 'OWNER',\n    ADMIN = 'ADMIN',\n    ANALYST = 'ANALYST',\n}\n\nexport enum GestionUserStatus {\n    ACTIVE = 'ACTIVE',\n    INACTIVE = 'INACTIVE',\n    LOCKED = 'LOCKED',\n}\n\nexport interface GestionUser {\n    id: string\n    email: string\n    passwordHash?: string\n    name: string\n    role: GestionUserRole\n    status: GestionUserStatus\n    lastLoginAt?: Date | null\n    createdAt: Date\n    updatedAt: Date\n    deletedAt?: Date | null\n}\n","// shared-types/src/chatbot/tone.ts\n\nexport const CHATBOT_TONE_IDS = [\n    'professional',\n    'friendly',\n    'concise',\n    'enthusiastic',\n    'formal',\n    'casual',\n] as const\n\nexport type ChatbotToneId = (typeof CHATBOT_TONE_IDS)[number]\n\nexport const DEFAULT_CHATBOT_TONE: ChatbotToneId = 'professional'\n\nexport function isChatbotToneId(value: string): value is ChatbotToneId {\n    return (CHATBOT_TONE_IDS as readonly string[]).includes(value)\n}\n"],"mappings":";;;AAEO,IAAM,sBAAsB,CAAC,MAAM,IAAI;AAGvC,SAAS,mBAAmB,MAA4C;AAC3E,SAAO,oBAAoB,SAAS,IAA4B;AACpE;AA6BO,IAAM,mBAAyD;AAAA,EAClE,IAAI;AAAA,IACA,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,IACV,kBAAkB;AAAA,IAClB,QAAQ;AAAA,IACR,sBAAsB;AAAA,MAClB,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,aAAa,EAAE,KAAK,aAAa,KAAK,WAAW;AAAA,IACrD;AAAA,IACA,cAAc,CAAC,EAAE,MAAM,OAAO,MAAM,IAAI,UAAU,aAAa,CAAC;AAAA,EACpE;AAAA,EACA,IAAI;AAAA,IACA,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,IACV,kBAAkB;AAAA,IAClB,QAAQ;AAAA,IACR,sBAAsB;AAAA,MAClB,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,QAAQ;AAAA,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K;AACjE;","names":["MediaType","Currency","DayOfWeek","AccountStatus","AiCreditType","AiCreditSource","AiCreditTransactionReason","AccountBranchStatus","AccountBranchScheduleStatus","AccountBranchScheduleDay","DeliveryType","AccountDeliveryOptionPriceLogic","AccountDeliveryOptionStatus","AccountDeliveryOptionZoneStatus","DeliveryOptionRuleType","AccountDomainStatus","AccountEmailDomainStatus","AccountIntegrationStatus","AccountIntegrationConnectionStatus","AccountIntegrationEnvironment","AccountPaymentMethodStatus","CartStatus","CartSource","CartDeliveryType","CartItemErrorCode","CustomerStatus","IntegrationCategory","IntegrationStatus","OrderStatus","OrderPaymentStatus","OrderSource","OrderDeliveryType","DisplayOrderStatus","FulfillmentStatus","PaymentStatus","PaymentMethodType","PaymentCardBrandKey","ProductStatus","ProductType","ProductVariantStatus","PromotionType","PromotionStatus","PromotionRuleOperator","PromotionTargetType","PromotionApplicationType","ProductAttributeStatus","ProductAttributeType","ProductCategoryStatus","SizeGuideStatus","SizeGuideUnitBase","SizeGuideUnitDisplayPolicy","CollectionType","CollectionStatus","CollectionRulesLogic","CollectionRuleField","CollectionRuleOperator","CampaignStatus","CampaignBudgetType","StandardCategoryStatus","StoreBannerStatus","StorePageStatus","StorePageType","PubSubTopics","SupportConversationChannel","SupportConversationVisibility","SupportConversationPriority","SupportConversationStatus","SupportConversationMessageDeliveryStatus","SupportConversationMessageAiAnalysisStatus","SupportConversationMessageDirection","SupportConversationMessageSenderType","NavigationItemType","StoreCustomizationRevisionSource","StoreCustomizationRevisionStatus","GeoZoneStatus","IntegrationDeliveryZoneStatus","AccountExchangeRateType","RoundingMethod","RoundingRule","TrafficSource","DeviceType","PageType","AnalyticsEventType","FunnelStep","InternalNotificationType","BillingInterval","PaymentFrequency","AccountServicePlanStatus","ChargeType","ChargeStatus","BillingSociety","HolidayType","GestionUserRole","GestionUserStatus"]}