@retaila/shared-types 1.1.59 → 1.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -31,7 +31,6 @@ __export(index_exports, {
31
31
  AccountIntegrationConnectionStatus: () => AccountIntegrationConnectionStatus,
32
32
  AccountIntegrationEnvironment: () => AccountIntegrationEnvironment,
33
33
  AccountIntegrationStatus: () => AccountIntegrationStatus,
34
- AccountPaymentMethodStatus: () => AccountPaymentMethodStatus,
35
34
  AccountStatus: () => AccountStatus,
36
35
  CartDeliveryType: () => CartDeliveryType,
37
36
  CartItemErrorCode: () => CartItemErrorCode,
@@ -39,8 +38,11 @@ __export(index_exports, {
39
38
  CartStatus: () => CartStatus,
40
39
  Currency: () => Currency,
41
40
  CustomerStatus: () => CustomerStatus,
41
+ DeliveryType: () => DeliveryType,
42
42
  FulfillmentStatus: () => FulfillmentStatus,
43
+ GeoZoneStatus: () => GeoZoneStatus,
43
44
  IntegrationCategory: () => IntegrationCategory,
45
+ IntegrationDeliveryZoneStatus: () => IntegrationDeliveryZoneStatus,
44
46
  IntegrationStatus: () => IntegrationStatus,
45
47
  MediaType: () => MediaType,
46
48
  OrderDeliveryType: () => OrderDeliveryType,
@@ -68,14 +70,14 @@ __export(index_exports, {
68
70
  SupportConversationPriority: () => SupportConversationPriority,
69
71
  SupportConversationStatus: () => SupportConversationStatus,
70
72
  SupportConversationVisibility: () => SupportConversationVisibility,
71
- getAccountPaymentMethodStatusInfo: () => getAccountPaymentMethodStatusInfo,
72
73
  getCurrencySymbol: () => getCurrencySymbol,
73
74
  getFulfillmentStatusInfo: () => getFulfillmentStatusInfo,
74
75
  getIntegrationCategoryName: () => getIntegrationCategoryName,
75
76
  getOrderStatusInfo: () => getOrderStatusInfo,
76
77
  getPaymentCardBrand: () => getPaymentCardBrand,
77
78
  getPaymentStatusInfo: () => getPaymentStatusInfo,
78
- getProductStatusInfo: () => getProductStatusInfo
79
+ getProductStatusInfo: () => getProductStatusInfo,
80
+ parsePriceFormatPattern: () => parsePriceFormatPattern
79
81
  });
80
82
  module.exports = __toCommonJS(index_exports);
81
83
 
@@ -115,6 +117,82 @@ function getCurrencySymbol(currencyCode) {
115
117
  };
116
118
  return currencySymbols[currencyCode] || currencyCode.toString();
117
119
  }
120
+ function parsePriceFormatPattern(pattern) {
121
+ const hasComma = pattern.includes(",");
122
+ const hasPeriod = pattern.includes(".");
123
+ let locale = "es-UY";
124
+ let useGrouping = false;
125
+ let minimumFractionDigits = 0;
126
+ let maximumFractionDigits = 0;
127
+ if (hasComma && hasPeriod) {
128
+ const commaIndex = pattern.indexOf(",");
129
+ const periodIndex = pattern.indexOf(".");
130
+ if (commaIndex < periodIndex) {
131
+ locale = "en-US";
132
+ useGrouping = true;
133
+ const decimalPart = pattern.split(".")[1];
134
+ minimumFractionDigits = decimalPart ? decimalPart.length : 0;
135
+ maximumFractionDigits = decimalPart ? decimalPart.length : 2;
136
+ } else {
137
+ locale = "es-ES";
138
+ useGrouping = true;
139
+ const decimalPart = pattern.split(",")[1];
140
+ minimumFractionDigits = decimalPart ? decimalPart.length : 0;
141
+ maximumFractionDigits = decimalPart ? decimalPart.length : 2;
142
+ }
143
+ } else if (hasComma && !hasPeriod) {
144
+ const parts = pattern.split(",");
145
+ const integerPart = parts[0];
146
+ const decimalPart = parts[1];
147
+ if (decimalPart && decimalPart.length <= 2 && integerPart.length <= 4) {
148
+ locale = "es-ES";
149
+ useGrouping = false;
150
+ minimumFractionDigits = decimalPart.length;
151
+ maximumFractionDigits = decimalPart.length;
152
+ } else if (decimalPart && decimalPart.length === 3) {
153
+ locale = "en-US";
154
+ useGrouping = true;
155
+ minimumFractionDigits = 0;
156
+ maximumFractionDigits = 0;
157
+ } else if (!decimalPart) {
158
+ locale = "en-US";
159
+ useGrouping = true;
160
+ minimumFractionDigits = 0;
161
+ maximumFractionDigits = 0;
162
+ }
163
+ } else if (hasPeriod && !hasComma) {
164
+ const parts = pattern.split(".");
165
+ const integerPart = parts[0];
166
+ const decimalPart = parts[1];
167
+ if (decimalPart && decimalPart.length <= 2 && integerPart.length <= 4) {
168
+ locale = "en-US";
169
+ useGrouping = false;
170
+ minimumFractionDigits = decimalPart.length;
171
+ maximumFractionDigits = decimalPart.length;
172
+ } else if (decimalPart && decimalPart.length === 3) {
173
+ locale = "es-ES";
174
+ useGrouping = true;
175
+ minimumFractionDigits = 0;
176
+ maximumFractionDigits = 0;
177
+ } else if (!decimalPart) {
178
+ locale = "es-ES";
179
+ useGrouping = true;
180
+ minimumFractionDigits = 0;
181
+ maximumFractionDigits = 0;
182
+ }
183
+ } else {
184
+ locale = "es-UY";
185
+ useGrouping = false;
186
+ minimumFractionDigits = 0;
187
+ maximumFractionDigits = 0;
188
+ }
189
+ return {
190
+ locale,
191
+ useGrouping,
192
+ minimumFractionDigits,
193
+ maximumFractionDigits
194
+ };
195
+ }
118
196
 
119
197
  // src/account/types.ts
120
198
  var AccountStatus = /* @__PURE__ */ ((AccountStatus2) => {
@@ -148,9 +226,14 @@ var AccountBranchScheduleDay = /* @__PURE__ */ ((AccountBranchScheduleDay2) => {
148
226
  })(AccountBranchScheduleDay || {});
149
227
 
150
228
  // src/accountDeliveryOption/types.ts
229
+ var DeliveryType = /* @__PURE__ */ ((DeliveryType2) => {
230
+ DeliveryType2["SHIPPING"] = "SHIPPING";
231
+ DeliveryType2["PICKUP"] = "PICKUP";
232
+ return DeliveryType2;
233
+ })(DeliveryType || {});
151
234
  var AccountDeliveryOptionPriceLogic = /* @__PURE__ */ ((AccountDeliveryOptionPriceLogic2) => {
152
235
  AccountDeliveryOptionPriceLogic2["FIXED"] = "FIXED";
153
- AccountDeliveryOptionPriceLogic2["PER_KM"] = "PER_KM";
236
+ AccountDeliveryOptionPriceLogic2["CALCULATED"] = "CALCULATED";
154
237
  return AccountDeliveryOptionPriceLogic2;
155
238
  })(AccountDeliveryOptionPriceLogic || {});
156
239
  var AccountDeliveryOptionStatus = /* @__PURE__ */ ((AccountDeliveryOptionStatus2) => {
@@ -193,22 +276,6 @@ var AccountIntegrationEnvironment = /* @__PURE__ */ ((AccountIntegrationEnvironm
193
276
  return AccountIntegrationEnvironment2;
194
277
  })(AccountIntegrationEnvironment || {});
195
278
 
196
- // src/accountPaymentMethod/types.ts
197
- var AccountPaymentMethodStatus = /* @__PURE__ */ ((AccountPaymentMethodStatus2) => {
198
- AccountPaymentMethodStatus2["ACTIVE"] = "ACTIVE";
199
- AccountPaymentMethodStatus2["INACTIVE"] = "INACTIVE";
200
- return AccountPaymentMethodStatus2;
201
- })(AccountPaymentMethodStatus || {});
202
-
203
- // src/accountPaymentMethod/helpers.ts
204
- function getAccountPaymentMethodStatusInfo(status) {
205
- const map = {
206
- ACTIVE: { text: "Activo", class: "success", actionText: "" },
207
- INACTIVE: { text: "Inactivo", class: "danger", actionText: "" }
208
- };
209
- return map[status] ?? { text: String(status), class: "secondary" };
210
- }
211
-
212
279
  // src/cart/types.ts
213
280
  var CartStatus = /* @__PURE__ */ ((CartStatus2) => {
214
281
  CartStatus2["ACTIVE"] = "ACTIVE";
@@ -619,7 +686,6 @@ var SupportConversationMessageSenderType = /* @__PURE__ */ ((SupportConversation
619
686
  // src/fulfillment/types.ts
620
687
  var FulfillmentStatus = /* @__PURE__ */ ((FulfillmentStatus2) => {
621
688
  FulfillmentStatus2["PENDING"] = "pending";
622
- FulfillmentStatus2["PACKED"] = "packed";
623
689
  FulfillmentStatus2["SHIPPED"] = "shipped";
624
690
  FulfillmentStatus2["DELIVERED"] = "delivered";
625
691
  FulfillmentStatus2["CANCELLED"] = "cancelled";
@@ -629,14 +695,27 @@ var FulfillmentStatus = /* @__PURE__ */ ((FulfillmentStatus2) => {
629
695
  // src/fulfillment/helpers.ts
630
696
  function getFulfillmentStatusInfo(status) {
631
697
  const map = {
632
- pending: { text: "Pendiente", class: "warning", actionText: "" },
633
- packed: { text: "Paquete listo", class: "info", actionText: "Paquete listo" },
698
+ pending: { text: "Paquete listo", class: "warning", actionText: "" },
634
699
  shipped: { text: "Enviado", class: "warning", actionText: "Enviado" },
635
700
  delivered: { text: "Entregado", class: "success", actionText: "Entregado" },
636
701
  cancelled: { text: "Cancelado", class: "danger", actionText: "Cancelado" }
637
702
  };
638
703
  return map[status] ?? { text: String(status), class: "secondary" };
639
704
  }
705
+
706
+ // src/geoZone/types.ts
707
+ var GeoZoneStatus = /* @__PURE__ */ ((GeoZoneStatus2) => {
708
+ GeoZoneStatus2["ACTIVE"] = "ACTIVE";
709
+ GeoZoneStatus2["INACTIVE"] = "INACTIVE";
710
+ return GeoZoneStatus2;
711
+ })(GeoZoneStatus || {});
712
+
713
+ // src/integrationDeliveryZone/types.ts
714
+ var IntegrationDeliveryZoneStatus = /* @__PURE__ */ ((IntegrationDeliveryZoneStatus2) => {
715
+ IntegrationDeliveryZoneStatus2["ACTIVE"] = "ACTIVE";
716
+ IntegrationDeliveryZoneStatus2["INACTIVE"] = "INACTIVE";
717
+ return IntegrationDeliveryZoneStatus2;
718
+ })(IntegrationDeliveryZoneStatus || {});
640
719
  // Annotate the CommonJS export names for ESM import in node:
641
720
  0 && (module.exports = {
642
721
  AccountBranchScheduleDay,
@@ -649,7 +728,6 @@ function getFulfillmentStatusInfo(status) {
649
728
  AccountIntegrationConnectionStatus,
650
729
  AccountIntegrationEnvironment,
651
730
  AccountIntegrationStatus,
652
- AccountPaymentMethodStatus,
653
731
  AccountStatus,
654
732
  CartDeliveryType,
655
733
  CartItemErrorCode,
@@ -657,8 +735,11 @@ function getFulfillmentStatusInfo(status) {
657
735
  CartStatus,
658
736
  Currency,
659
737
  CustomerStatus,
738
+ DeliveryType,
660
739
  FulfillmentStatus,
740
+ GeoZoneStatus,
661
741
  IntegrationCategory,
742
+ IntegrationDeliveryZoneStatus,
662
743
  IntegrationStatus,
663
744
  MediaType,
664
745
  OrderDeliveryType,
@@ -686,13 +767,13 @@ function getFulfillmentStatusInfo(status) {
686
767
  SupportConversationPriority,
687
768
  SupportConversationStatus,
688
769
  SupportConversationVisibility,
689
- getAccountPaymentMethodStatusInfo,
690
770
  getCurrencySymbol,
691
771
  getFulfillmentStatusInfo,
692
772
  getIntegrationCategoryName,
693
773
  getOrderStatusInfo,
694
774
  getPaymentCardBrand,
695
775
  getPaymentStatusInfo,
696
- getProductStatusInfo
776
+ getProductStatusInfo,
777
+ parsePriceFormatPattern
697
778
  });
698
779
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/common/Media.ts","../src/common/Currency.ts","../src/account/types.ts","../src/accountBranch/types.ts","../src/accountDeliveryOption/types.ts","../src/accountDomain/types.ts","../src/accountIntegration/types.ts","../src/accountPaymentMethod/types.ts","../src/accountPaymentMethod/helpers.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/order/helpers.ts","../src/payment/types.ts","../src/payment/helpers.ts","../src/product/types.ts","../src/product/helpers.ts","../src/productAttribute/types.ts","../src/productCategory/types.ts","../src/standardCategory/types.ts","../src/storeBanner/types.ts","../src/storePage/types.ts","../src/pubsub/types.ts","../src/supportConversation/types.ts","../src/fulfillment/types.ts","../src/fulfillment/helpers.ts"],"sourcesContent":["// shared-types/src/index.ts - Main exports for shared types package\n\n// Common types\nexport * from './common';\n\n// Entity-specific exports\nexport * from './account';\nexport * from './accountBranch';\nexport * from './accountDeliveryOption';\nexport * from './accountDomain';\nexport * from './accountIntegration';\nexport * from './accountPaymentMethod';\nexport * from './cart';\nexport * from './customer';\nexport * from './integration';\nexport * from './order';\nexport * from './payment'\nexport * from './product';\nexport * from './productAttribute';\nexport * from './productCategory';\nexport * from './standardCategory';\nexport * from './storeBanner';\nexport * from './storePage';\nexport * from './pubsub';\nexport * from './supportConversation';\nexport * from './fulfillment';\nexport * from './storeCustomization';\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","// shared-types/src/account/types.ts - Account entity types\n\nexport interface Account {\n id: string;\n name: string;\n slug: string;\n address?: string;\n logoId?: string;\n currency: string;\n instagram?: string;\n facebook?: string;\n whatsapp?: string;\n phone?: string;\n email: string;\n timezone: string;\n hasDelivery: boolean;\n status: AccountStatus;\n themeConfig?: ThemeConfig;\n privateKey?: string;\n demo: boolean;\n createdAt: Date;\n updatedAt: Date;\n deletedAt?: Date;\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 ","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 addressCoordinates?: MapPosition | null;\n phone?: Phone | null;\n email?: string | null;\n demo:boolean;\n status: AccountBranchStatus; \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 { Address, MapPosition } from \"../common\";\nimport { AccountIntegration } from \"../accountIntegration/types\";\nimport { AccountBranch } from \"../accountBranch/types\";\n\n/**\n * Entidad AccountDeliveryOption\n * Representa una opción de envío de una cuenta.\n */\n\nexport interface AccountDeliveryOption {\n\tid: string;\n\taccountId: string;\n\taccountBranchId: string;\n\tname: string;\n\tintegrationId?: string;\n\tisScheduled: boolean;\n\tpriceLogic: AccountDeliveryOptionPriceLogic;\n\tstatus: AccountDeliveryOptionStatus;\n\tdemo:boolean;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\n\tzones: AccountDeliveryOptionZone[];\n\tintegration?: AccountIntegration | null;\n\tcalculatedCost?: AccountDeliveryOptionCalculatedCost | null;\n\taccountBranch?: AccountBranch | null;\n}\n\nexport enum AccountDeliveryOptionPriceLogic {\n\tFIXED = \"FIXED\",\n\tPER_KM = \"PER_KM\",\n}\n\nexport enum AccountDeliveryOptionStatus {\n\tACTIVE = \"ACTIVE\",\n\tINACTIVE = \"INACTIVE\",\n}\n\nexport interface AccountDeliveryOptionCalculatedCost {\n\tbasePrice: number;\n\tdistanceKm: number;\n\tfinalPrice: number;\n\tpriceLogic: AccountDeliveryOptionPriceLogic;\n\tcurrency: string;\n}\n\n\nexport interface AccountDeliveryOptionZone {\n\tid: string;\n\taccountId: string;\n\taccountDeliveryOptionId: string;\n\tname: string;\n\tprice: number;\n\tpriceMin: number;\n\tarea: string;\n\tstatus: AccountDeliveryOptionZoneStatus;\n\tdemo:boolean;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n}\n\nexport enum AccountDeliveryOptionZoneStatus {\n\tACTIVE = \"ACTIVE\",\n\tINACTIVE = \"INACTIVE\",\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 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 ","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 { StatusInfo } from \"../common/Status\";\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}","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}","import { CartItemValidation } from \"./dto\";\nimport { Customer } from \"../customer\";\nimport { AccountDomain } from \"../accountDomain\";\nimport { AccountPaymentMethod } from \"../accountPaymentMethod\";\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 accountPaymentMethodId?: string;\n deliveryType: CartDeliveryType;\n deliveryFirstName?: string;\n deliveryLastName?: string;\n deliveryAddress?: string;\n deliveryPhone?: string;\n deliveryOptionId?: string;\n pickupBranchId?: 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\n customer?: Partial<Customer> | null;\n accountDomain?: Partial<AccountDomain> | null;\n accountPaymentMethod?: Partial<AccountPaymentMethod> | 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}\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\n\n\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 deliveryOptionId?: string;\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}\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 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')\n\tname: string; // Human-readable name (e.g., \"Stripe\", \"Mercado Pago\")\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\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 { PaymentStatus } from \"../payment\";\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 deliveryOptionId?: string;\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 items?: OrderItem[];\n\n customer?: Customer | null;\n paymentMethodIntegration?: AccountIntegration | null;\n accountDomain?: AccountDomain;\n accountPaymentMethod?: Partial<AccountPaymentMethod> | null;\n\n statusFlow?: StatusFlow[];\n // Estados permitidos para cambiar el estado de la orden\n statusChangeAllowed?: OrderStatus[];\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\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\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};","import { StatusInfo } from \"../common/Status\";\nimport { OrderStatus } from \"./types\";\n\nexport function getOrderStatusInfo(status: OrderStatus): StatusInfo {\n\tconst map: Record<OrderStatus, StatusInfo> = {\n\t\tPENDING: { text: 'Pendiente', class: 'secondary', actionText: '' },\n\t\tCONFIRMED: { text: 'Confirmada', class: 'info', actionText: 'Confirmar orden' },\n\t\tPROCESSING: { text: 'En proceso', class: 'warning', actionText: 'Procesar orden' },\n\t\tPROCESSED: { text: 'Procesada', class: 'primary', actionText: 'Orden procesada' },\n\t\tON_HOLD: { text: 'En espera', class: 'secondary', actionText: 'Orden en espera' },\n\t\tCOMPLETED: { text: 'Completada', class: 'success', actionText: 'Completar orden' }, \n\t\tCANCELLED: { text: 'Cancelada', class: 'danger', actionText: 'Cancelar orden' },\n\t\tFAILED: { text: 'Fallida', class: 'danger', actionText: '' },\n\t};\n\n\treturn map[status] ?? { text: String(status), class: 'secondary' };\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\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 PHYSICAL = 'PHYSICAL',\n INTERNATIONAL = 'INTERNATIONAL',\n PAYPAL = 'PAYPAL',\n CASH = 'CASH',\n OTHER = 'OTHER', // Added for flexibility\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 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\n// Provider-level types (entity-agnostic, reusable across projects)\nexport type PaymentProviderKey = 'MERCADOPAGO' | 'MANUAL';\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 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://storage.googleapis.com/retaila-assets/payments/mercadopago.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/mercadopago-ico.png',\n },\n master: {\n key: PaymentCardBrandKey.master,\n name: 'Mastercard',\n image: 'https://storage.googleapis.com/retaila-assets/payments/master.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/master-ico.png',\n },\n debmaster: {\n key: PaymentCardBrandKey.master,\n name: 'Mastercard Débito',\n image: 'https://storage.googleapis.com/retaila-assets/payments/master.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/master-ico.png',\n },\n visa: {\n key: PaymentCardBrandKey.visa,\n name: 'Visa',\n image: 'https://storage.googleapis.com/retaila-assets/payments/visa.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/visa-ico.png',\n },\n debvisa: {\n key: PaymentCardBrandKey.visa,\n name: 'Visa Débito',\n image: 'https://storage.googleapis.com/retaila-assets/payments/visa.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/visa-ico.png',\n },\n diners:{\n key: PaymentCardBrandKey.diners,\n name: 'Diners',\n image: 'https://storage.googleapis.com/retaila-assets/payments/diners.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/diners-ico.png',\n },\n oca: {\n key: PaymentCardBrandKey.oca,\n name: 'Oca',\n image: 'https://storage.googleapis.com/retaila-assets/payments/oca.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/oca-ico.png',\n },\n lider:{\n key: PaymentCardBrandKey.lider,\n name: 'Lider',\n image: 'https://storage.googleapis.com/retaila-assets/payments/lider.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/lider-ico.png',\n },\n amex: {\n key: PaymentCardBrandKey.amex,\n name: 'American Express',\n image: 'https://storage.googleapis.com/retaila-assets/payments/amex.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/amex-ico.png',\n },\n redpagos: {\n key: PaymentCardBrandKey.redpagos,\n name: 'Redpagos',\n image: 'https://storage.googleapis.com/retaila-assets/payments/redpagos.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/redpagos-ico.png',\n },\n abitab:{\n key: PaymentCardBrandKey.abitab,\n name: 'Abitab',\n image: 'https://storage.googleapis.com/retaila-assets/payments/abitab.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/abitab-ico.png',\n }\n }\n return map[key] || {\n key,\n name: '',\n image: null,\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}","import { StatusInfo } from \"../common/Status\";\nimport { PaymentStatus } from \"./types\";\n\nexport function getPaymentStatusInfo(status: PaymentStatus): StatusInfo {\n\tconst map: Record<PaymentStatus, StatusInfo> = {\n\t\tPENDING: { text: 'Pago pendiente', class: 'warning', actionText: '' },\n\t\tPREAUTHORIZED: { text: 'Pago preautorizado', class: 'info', actionText: 'Preautorizar pago' },\n\t\tAPPROVED: { text: 'Pago aprobado', class: 'success', actionText: 'Aprobar pago' },\n\t\tPAID: { text: 'Pago realizado', class: 'success', actionText: 'Pago realizado' },\n\t\tREJECTED: { text: 'Pago rechazado', class: 'danger', actionText: 'Rechazar pago' },\n\t\tREFUND_IN_PROCESS: { text: 'Pago en proceso de reembolso', class: 'warning', actionText: 'Reembolsar pago' },\n\t\tPARTIAL_REFUND: { text: 'Pago parcialmente reembolsado', class: 'warning', actionText: 'Reembolsar pago' },\n\t\tREFUNDED: { text: 'Pago reembolsado', class: 'success', actionText: 'Reembolsado' },\n\t\tERROR: { text: 'Error en pago', class: 'danger', actionText: 'Error en pago' },\n\t};\n\n\treturn map[status] ?? { text: String(status), class: 'secondary' };\n}","import { Media } from \"../common\";\nimport { StatusInfo } from \"../common/Status\";\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 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\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 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}","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 * 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;\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 * 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_COMPLETED = 'order-completed',\n ORDER_CANCELLED = 'order-cancelled',\n PAYMENT_PAID = 'payment-paid',\n NOTIFICATION_CREATED = 'notification-created',\n }","import { Account } from \"../account/types\";\nimport { Customer } from \"../customer/types\";\n\n\n// origen principal del hilo de conversación\nexport enum SupportConversationChannel {\n\tWEB = 'WEB',\n\tEMAIL = 'EMAIL',\n\tWHATSAPP = 'WHATSAPP'\n}\n\n// quién puede ver el hilo en el tenant\nexport enum SupportConversationVisibility {\n\tINTERNAL = 'INTERNAL',\n\tMERCHANT = 'MERCHANT'\n}\n\nexport enum SupportConversationPriority {\n\tLOW = 'LOW',\n\tMEDIUM = 'MEDIUM',\n\tHIGH = 'HIGH',\n\tURGENT = 'URGENT'\n}\n\nexport enum SupportConversationStatus {\n\tOPEN = 'OPEN',\n\tCLOSED = 'CLOSED',\n\tPENDING = 'PENDING'\n}\n\nexport enum SupportConversationMessageDeliveryStatus {\n\tQUEUED = 'QUEUED',\n\tSENT = 'SENT',\n\tDELIVERED = 'DELIVERED',\n\tREAD = 'READ',\n\tFAILED = 'FAILED'\n}\n\nexport enum SupportConversationMessageAiAnalysisStatus {\n\tPENDING = 'PENDING',\n\tPROCESSING = 'PROCESSING',\n\tCOMPLETED = 'COMPLETED',\n\tFAILED = 'FAILED'\n}\n\n// Dirección del mensaje con respecto al sistema: entrante o saliente\nexport enum SupportConversationMessageDirection {\n\tINBOUND = 'INBOUND',\n\tOUTBOUND = 'OUTBOUND'\n }\n \n // Tipo de emisor del mensaje\n export enum SupportConversationMessageSenderType {\n\tCUSTOMER = 'CUSTOMER',\n\tACCOUNT_USER = 'ACCOUNT_USER',\n\tANONYMOUS = 'ANONYMOUS',\n\tSYSTEM = 'SYSTEM',\n\tAI = 'AI'\n }\n\nexport interface SupportConversation {\n\tid: string;\n\taccountId: string;\n\tsubject?: string | null; // Asunto opcional del hilo (para email o contacto web)\n\tchannel: SupportConversationChannel; // Canal principal de la conversación (email/whatsapp/web, etc.)\n\tassigneeId?: string | null; // Asignación interna (agente/usuario de la cuenta que atiende la conversación)\n\tvisibility: SupportConversationVisibility;\n\tpriority: SupportConversationPriority; // Priorización operativa\n\trequiresMerchantAction: boolean; // Indica si el comercio debe responder o tomar acción\n\trequiresInternalAction: boolean; // Indica si el equipo interno debe intervenir (respuesta, etc.)\n\tcustomerId?: string | null; // Identificador del cliente si está registrado en el sistema\n\tcustomerName?: string | null; // Nombre del contacto (snapshot, no necesariamente el del Customer)\n\tcustomerLastname?: string | null; // Apellido del contacto (snapshot)\n\tcustomerEmail?: string | null; // Email del contacto (snapshot)\n\tcustomerPhone?: string | null; // Teléfono del contacto (snapshot)\n\tstatus: SupportConversationStatus; // Estado simple (string para mantenerlo liviano)\n\tlastMessageAt?: Date | null;\n\tunreadForAgent: number; // Mensajes no leídos por el agente interno\n\tunreadForCustomer: number; // Mensajes no leídos por el cliente/comercio\n\tmetadata?: Object | null; // Metadatos flexibles (headers email, ids de chat, etc.)\n\taiSuggestion?: Object | null; // Sugerencias/Resumen asistidos por IA\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\n\taccount: Account;\n\t// assignee: AccountUser | null;\n\tcustomer: Customer | null;\n\tmessages: SupportConversationMessage[];\n}\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 { FulfillmentItem } from \"../fulfillmentItem\";\n\nexport enum FulfillmentStatus {\n PENDING = 'pending',\n PACKED = 'packed',\n SHIPPED = 'shipped',\n DELIVERED = 'delivered',\n CANCELLED = 'cancelled',\n}\n\nexport type Fulfillment = {\n id: string;\n accountId: string;\n orderId: string;\n accountBranchId: string;\n carrier: string;\n trackingNumber: string | null;\n items: FulfillmentItem[];\n status: FulfillmentStatus;\n data: Record<string, unknown> | null;\n packedAt: Date | null;\n shippedAt: Date | null;\n deliveredAt: Date | null;\n cancelledAt: Date | null;\n createdAt: Date;\n updatedAt: Date;\n deletedAt?: Date;\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: 'Pendiente', class: 'warning', actionText: '' },\n\t\tpacked: { text: 'Paquete listo', class: 'info', actionText: 'Paquete listo' },\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}"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AU;AAAA,IACpE,WAAW,EAAE,MAAM,aAAa,OAAO,WAAW,YAAY,YAAY;AAAA,IAC1E,WAAW,EAAE,MAAM,aAAa,OAAO,UAAU,YAAY,YAAY;AAAA,EAC1E;AAEA,SAAO,IAAI,MAAM,KAAK,EAAE,MAAM,OAAO,MAAM,GAAG,OAAO,YAAY;AAClE;","names":["MediaType","Currency","AccountStatus","AccountBranchStatus","AccountBranchScheduleStatus","AccountBranchScheduleDay","AccountDeliveryOptionPriceLogic","AccountDeliveryOptionStatus","AccountDeliveryOptionZoneStatus","AccountDomainStatus","AccountIntegrationStatus","AccountIntegrationConnectionStatus","AccountIntegrationEnvironment","AccountPaymentMethodStatus","CartStatus","CartSource","CartDeliveryType","CartItemErrorCode","CustomerStatus","IntegrationCategory","IntegrationStatus","OrderStatus","OrderPaymentStatus","OrderSource","OrderDeliveryType","PaymentStatus","PaymentMethodType","PaymentCardBrandKey","ProductStatus","ProductType","ProductAttributeStatus","ProductAttributeType","ProductCategoryStatus","StandardCategoryStatus","StoreBannerStatus","StorePageStatus","StorePageType","PubSubTopics","SupportConversationChannel","SupportConversationVisibility","SupportConversationPriority","SupportConversationStatus","SupportConversationMessageDeliveryStatus","SupportConversationMessageAiAnalysisStatus","SupportConversationMessageDirection","SupportConversationMessageSenderType","FulfillmentStatus"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/common/Media.ts","../src/common/Currency.ts","../src/account/types.ts","../src/accountBranch/types.ts","../src/accountDeliveryOption/types.ts","../src/accountDomain/types.ts","../src/accountIntegration/types.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/order/helpers.ts","../src/payment/types.ts","../src/payment/helpers.ts","../src/product/types.ts","../src/product/helpers.ts","../src/productAttribute/types.ts","../src/productCategory/types.ts","../src/standardCategory/types.ts","../src/storeBanner/types.ts","../src/storePage/types.ts","../src/pubsub/types.ts","../src/supportConversation/types.ts","../src/fulfillment/types.ts","../src/fulfillment/helpers.ts","../src/geoZone/types.ts","../src/integrationDeliveryZone/types.ts"],"sourcesContent":["// shared-types/src/index.ts - Main exports for shared types package\n\n// Common types\nexport * from './common';\n\n// Entity-specific exports\nexport * from './account';\nexport * from './accountBranch';\nexport * from './accountDeliveryOption';\nexport * from './accountDomain';\nexport * from './accountIntegration';\nexport * from './cart';\nexport * from './cartDeliveryMethod';\nexport * from './customer';\nexport * from './integration';\nexport * from './order';\nexport * from './orderDeliveryMethod';\nexport * from './payment'\nexport * from './product';\nexport * from './productAttribute';\nexport * from './productCategory';\nexport * from './standardCategory';\nexport * from './storeBanner';\nexport * from './storePage';\nexport * from './pubsub';\nexport * from './supportConversation';\nexport * from './fulfillment';\nexport * from './fulfillmentItem';\nexport * from './fulfillmentLabel';\nexport * from './storeCustomization';\nexport * from './geoZone';\nexport * from './integrationDeliveryZone';\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","// shared-types/src/account/types.ts - Account entity types\n\nexport interface Account {\n id: string;\n name: string;\n slug: string;\n address?: string;\n logoId?: string;\n currency: string;\n priceFormatPattern: string;\n instagram?: string;\n facebook?: string;\n whatsapp?: string;\n phone?: string;\n email: string;\n timezone: string;\n hasDelivery: boolean;\n status: AccountStatus;\n themeConfig?: ThemeConfig;\n privateKey?: string;\n demo: boolean;\n createdAt: Date;\n updatedAt: Date;\n deletedAt?: Date;\n\n priceFormat?: Intl.NumberFormatOptions;\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 ","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 addressCoordinates?: MapPosition | null;\n phone?: Phone | null;\n email?: string | null;\n demo:boolean;\n status: AccountBranchStatus; \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\tSHIPPING = \"SHIPPING\",\n\tPICKUP = \"PICKUP\",\n}\n\n/**\n * Entidad AccountDeliveryOption\n * Representa una opción de envío de una cuenta.\n */\n\nexport interface AccountDeliveryOption {\n\tid: string;\n\taccountId: string;\n\taccountBranchId: string;\n\tname: string;\n\taccountIntegrationId?: string;\n\tisScheduled: boolean;\n\tpriceLogic: AccountDeliveryOptionPriceLogic;\n\tstatus: AccountDeliveryOptionStatus;\n\tdeliveryType: DeliveryType;\n\tdemo:boolean;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\tdata?: Record<string, unknown>\n\n\tdeliveryZones: AccountDeliveryOptionZone[];\n\tintegration?: AccountIntegration | null;\n\tprice?: number | null;\n\taccountBranch?: AccountBranch | null;\n}\n\nexport enum AccountDeliveryOptionPriceLogic {\n\tFIXED = \"FIXED\",\n\tCALCULATED = \"CALCULATED\",\n}\n\nexport enum AccountDeliveryOptionStatus {\n\tACTIVE = \"ACTIVE\",\n\tINACTIVE = \"INACTIVE\",\n}\n\nexport interface AccountDeliveryOptionCalculatedCost {\n\tbasePrice: number;\n\tdistanceKm: number;\n\tfinalPrice: number;\n\tpriceLogic: AccountDeliveryOptionPriceLogic;\n\tcurrency: string;\n}\n\n\nexport interface AccountDeliveryOptionZone {\n\tid: string;\n\taccountId: string;\n\taccountDeliveryOptionId: string;\n\tgeoZoneId: string;\n\tstatus: AccountDeliveryOptionZoneStatus;\n\tdemo: boolean;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\n\t// Relations\n\tgeoZone?: GeoZone;\n}\n\nexport enum AccountDeliveryOptionZoneStatus {\n\tACTIVE = \"ACTIVE\",\n\tINACTIVE = \"INACTIVE\",\n}\n\n// DTO Types for API operations\nexport interface DeliveryZoneInput {\n\tgeoZoneId?: string;\n\tgeoZone?: GeoZoneInput;\n}\n\nexport interface GeoZoneInput {\n\tname: string;\n\tarea: MapPosition[];\n\tdescription?: string;\n}\n\nexport interface CreateAccountDeliveryOptionDTO {\n\taccountId: string;\n\taccountBranchId: string;\n\tname: string;\n\taccountIntegrationId?: string | null;\n\tisScheduled?: boolean;\n\tpriceLogic?: AccountDeliveryOptionPriceLogic;\n\tprice?: number;\n\tstatus?: AccountDeliveryOptionStatus;\n\tdeliveryType: DeliveryType;\n\tdeliveryZones?: DeliveryZoneInput[];\n\tdata?: Record<string, unknown>;\n}\n\nexport interface UpdateAccountDeliveryOptionDTO {\n\taccountBranchId: string;\n\tname?: string;\n\taccountIntegrationId?: string | null;\n\tisScheduled?: boolean;\n\tpriceLogic?: AccountDeliveryOptionPriceLogic;\n\tstatus?: AccountDeliveryOptionStatus;\n\tdeliveryType?: DeliveryType;\n\tdeliveryZones?: DeliveryZoneInput[];\n\tdata?: Record<string, unknown>;\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 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 ","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}","import { CartItemValidation } from \"./dto\";\nimport { Customer } from \"../customer\";\nimport { AccountDomain } from \"../accountDomain\";\nimport { CartDeliveryMethod } from \"../cartDeliveryMethod\";\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 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\n customer?: Partial<Customer> | null;\n accountDomain?: Partial<AccountDomain> | null;\n deliveryMethod?: CartDeliveryMethod | 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}\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\n\n\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}\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 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')\n\tname: string; // Human-readable name (e.g., \"Stripe\", \"Mercado Pago\")\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\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\";\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 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 items?: OrderItem[];\n\n customer?: Customer | null;\n paymentMethodIntegration?: AccountIntegration | null;\n accountDomain?: AccountDomain;\n deliveryMethod?: OrderDeliveryMethod | null;\n account?: Account\n payments?: Payment[]\n\n statusFlow?: StatusFlow[];\n // Estados permitidos para cambiar el estado de la orden\n statusChangeAllowed?: OrderStatus[];\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\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\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};","import { StatusInfo } from \"../common/Status\";\nimport { OrderStatus } from \"./types\";\n\nexport function getOrderStatusInfo(status: OrderStatus): StatusInfo {\n\tconst map: Record<OrderStatus, StatusInfo> = {\n\t\tPENDING: { text: 'Pendiente', class: 'secondary', actionText: '' },\n\t\tCONFIRMED: { text: 'Confirmada', class: 'info', actionText: 'Confirmar orden' },\n\t\tPROCESSING: { text: 'En proceso', class: 'warning', actionText: 'Procesar orden' },\n\t\tPROCESSED: { text: 'Procesada', class: 'primary', actionText: 'Orden procesada' },\n\t\tON_HOLD: { text: 'En espera', class: 'secondary', actionText: 'Orden en espera' },\n\t\tCOMPLETED: { text: 'Completada', class: 'success', actionText: 'Completar orden' }, \n\t\tCANCELLED: { text: 'Cancelada', class: 'danger', actionText: 'Cancelar orden' },\n\t\tFAILED: { text: 'Fallida', class: 'danger', actionText: '' },\n\t};\n\n\treturn map[status] ?? { text: String(status), class: 'secondary' };\n}","// shared-types/src/payment/types.ts\n\nimport { Currency } from \"../common\";\nimport { Order } from \"../order\";\nimport { StatusInfo } from \"../common/Status\";\nimport { AccountIntegration } from \"../accountIntegration\";\n\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 PHYSICAL = 'PHYSICAL',\n INTERNATIONAL = 'INTERNATIONAL',\n PAYPAL = 'PAYPAL',\n CASH = 'CASH',\n OTHER = 'OTHER', // Added for flexibility\n}\nexport interface Payment {\n id: string;\n accountId: string;\n orderId: string;\n invoiceId?: 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 metadata?: Record<string, any>;\n internalComment?: string;\n demo: boolean;\n createdAt: string | Date;\n updatedAt: string | Date;\n deletedAt?: string | Date;\n\n accountIntegration?: AccountIntegration;\n order?: Order;\n}\n\n// Provider-level types (entity-agnostic, reusable across projects)\nexport type PaymentProviderKey = 'MERCADOPAGO' | 'MANUAL';\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 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://storage.googleapis.com/retaila-assets/payments/mercadopago.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/mercadopago-ico.png',\n },\n master: {\n key: PaymentCardBrandKey.master,\n name: 'Mastercard',\n image: 'https://storage.googleapis.com/retaila-assets/payments/master.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/master-ico.png',\n },\n debmaster: {\n key: PaymentCardBrandKey.master,\n name: 'Mastercard Débito',\n image: 'https://storage.googleapis.com/retaila-assets/payments/master.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/master-ico.png',\n },\n visa: {\n key: PaymentCardBrandKey.visa,\n name: 'Visa',\n image: 'https://storage.googleapis.com/retaila-assets/payments/visa.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/visa-ico.png',\n },\n debvisa: {\n key: PaymentCardBrandKey.visa,\n name: 'Visa Débito',\n image: 'https://storage.googleapis.com/retaila-assets/payments/visa.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/visa-ico.png',\n },\n diners:{\n key: PaymentCardBrandKey.diners,\n name: 'Diners',\n image: 'https://storage.googleapis.com/retaila-assets/payments/diners.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/diners-ico.png',\n },\n oca: {\n key: PaymentCardBrandKey.oca,\n name: 'Oca',\n image: 'https://storage.googleapis.com/retaila-assets/payments/oca.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/oca-ico.png',\n },\n lider:{\n key: PaymentCardBrandKey.lider,\n name: 'Lider',\n image: 'https://storage.googleapis.com/retaila-assets/payments/lider.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/lider-ico.png',\n },\n amex: {\n key: PaymentCardBrandKey.amex,\n name: 'American Express',\n image: 'https://storage.googleapis.com/retaila-assets/payments/amex.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/amex-ico.png',\n },\n redpagos: {\n key: PaymentCardBrandKey.redpagos,\n name: 'Redpagos',\n image: 'https://storage.googleapis.com/retaila-assets/payments/redpagos.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/redpagos-ico.png',\n },\n abitab:{\n key: PaymentCardBrandKey.abitab,\n name: 'Abitab',\n image: 'https://storage.googleapis.com/retaila-assets/payments/abitab.png',\n icon: 'https://storage.googleapis.com/retaila-assets/payments/abitab-ico.png',\n }\n }\n return map[key] || {\n key,\n name: '',\n image: null,\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}","import { StatusInfo } from \"../common/Status\";\nimport { PaymentStatus } from \"./types\";\n\nexport function getPaymentStatusInfo(status: PaymentStatus): StatusInfo {\n\tconst map: Record<PaymentStatus, StatusInfo> = {\n\t\tPENDING: { text: 'Pago pendiente', class: 'warning', actionText: '' },\n\t\tPREAUTHORIZED: { text: 'Pago preautorizado', class: 'info', actionText: 'Preautorizar pago' },\n\t\tAPPROVED: { text: 'Pago aprobado', class: 'success', actionText: 'Aprobar pago' },\n\t\tPAID: { text: 'Pago realizado', class: 'success', actionText: 'Pago realizado' },\n\t\tREJECTED: { text: 'Pago rechazado', class: 'danger', actionText: 'Rechazar pago' },\n\t\tREFUND_IN_PROCESS: { text: 'Pago en proceso de reembolso', class: 'warning', actionText: 'Reembolsar pago' },\n\t\tPARTIAL_REFUND: { text: 'Pago parcialmente reembolsado', class: 'warning', actionText: 'Reembolsar pago' },\n\t\tREFUNDED: { text: 'Pago reembolsado', class: 'success', actionText: 'Reembolsado' },\n\t\tERROR: { text: 'Error en pago', class: 'danger', actionText: 'Error en pago' },\n\t};\n\n\treturn map[status] ?? { text: String(status), class: 'secondary' };\n}","import { Media } from \"../common\";\nimport { StatusInfo } from \"../common/Status\";\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 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\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 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}","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 * 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;\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 * 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_COMPLETED = 'order-completed',\n ORDER_CANCELLED = 'order-cancelled',\n PAYMENT_PAID = 'payment-paid',\n NOTIFICATION_CREATED = 'notification-created',\n }","import { Account } from \"../account/types\";\nimport { Customer } from \"../customer/types\";\n\n\n// origen principal del hilo de conversación\nexport enum SupportConversationChannel {\n\tWEB = 'WEB',\n\tEMAIL = 'EMAIL',\n\tWHATSAPP = 'WHATSAPP'\n}\n\n// quién puede ver el hilo en el tenant\nexport enum SupportConversationVisibility {\n\tINTERNAL = 'INTERNAL',\n\tMERCHANT = 'MERCHANT'\n}\n\nexport enum SupportConversationPriority {\n\tLOW = 'LOW',\n\tMEDIUM = 'MEDIUM',\n\tHIGH = 'HIGH',\n\tURGENT = 'URGENT'\n}\n\nexport enum SupportConversationStatus {\n\tOPEN = 'OPEN',\n\tCLOSED = 'CLOSED',\n\tPENDING = 'PENDING'\n}\n\nexport enum SupportConversationMessageDeliveryStatus {\n\tQUEUED = 'QUEUED',\n\tSENT = 'SENT',\n\tDELIVERED = 'DELIVERED',\n\tREAD = 'READ',\n\tFAILED = 'FAILED'\n}\n\nexport enum SupportConversationMessageAiAnalysisStatus {\n\tPENDING = 'PENDING',\n\tPROCESSING = 'PROCESSING',\n\tCOMPLETED = 'COMPLETED',\n\tFAILED = 'FAILED'\n}\n\n// Dirección del mensaje con respecto al sistema: entrante o saliente\nexport enum SupportConversationMessageDirection {\n\tINBOUND = 'INBOUND',\n\tOUTBOUND = 'OUTBOUND'\n }\n \n // Tipo de emisor del mensaje\n export enum SupportConversationMessageSenderType {\n\tCUSTOMER = 'CUSTOMER',\n\tACCOUNT_USER = 'ACCOUNT_USER',\n\tANONYMOUS = 'ANONYMOUS',\n\tSYSTEM = 'SYSTEM',\n\tAI = 'AI'\n }\n\nexport interface SupportConversation {\n\tid: string;\n\taccountId: string;\n\tsubject?: string | null; // Asunto opcional del hilo (para email o contacto web)\n\tchannel: SupportConversationChannel; // Canal principal de la conversación (email/whatsapp/web, etc.)\n\tassigneeId?: string | null; // Asignación interna (agente/usuario de la cuenta que atiende la conversación)\n\tvisibility: SupportConversationVisibility;\n\tpriority: SupportConversationPriority; // Priorización operativa\n\trequiresMerchantAction: boolean; // Indica si el comercio debe responder o tomar acción\n\trequiresInternalAction: boolean; // Indica si el equipo interno debe intervenir (respuesta, etc.)\n\tcustomerId?: string | null; // Identificador del cliente si está registrado en el sistema\n\tcustomerName?: string | null; // Nombre del contacto (snapshot, no necesariamente el del Customer)\n\tcustomerLastname?: string | null; // Apellido del contacto (snapshot)\n\tcustomerEmail?: string | null; // Email del contacto (snapshot)\n\tcustomerPhone?: string | null; // Teléfono del contacto (snapshot)\n\tstatus: SupportConversationStatus; // Estado simple (string para mantenerlo liviano)\n\tlastMessageAt?: Date | null;\n\tunreadForAgent: number; // Mensajes no leídos por el agente interno\n\tunreadForCustomer: number; // Mensajes no leídos por el cliente/comercio\n\tmetadata?: Object | null; // Metadatos flexibles (headers email, ids de chat, etc.)\n\taiSuggestion?: Object | null; // Sugerencias/Resumen asistidos por IA\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\n\taccount: Account;\n\t// assignee: AccountUser | null;\n\tcustomer: Customer | null;\n\tmessages: SupportConversationMessage[];\n}\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 { Webhook } from \"../common/Webhook\";\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 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 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 // Pickup locations for PICKUP delivery type options\n pickupLocations?: PickupLocation[]\n [key: string]: unknown\n}\n\n// Pickup Location types\nexport interface PickupLocation {\n id: string;\n name: string;\n address: {\n street: string;\n city: string;\n state: string;\n postalCode?: string;\n };\n coordinates?: {\n latitude: number;\n longitude: number;\n };\n hours?: string;\n phone?: string;\n additionalInfo?: Record<string, unknown>;\n}\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\nexport type FulfillmentRecollectionConfig = {\n mode: FulfillmentRecollectionMode;\n scheduledDateTime?: Date; // Required when allowsScheduling=true and mode includes recollection\n recollectionAddress?: {\n street: string;\n city: string;\n state: string;\n };\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}\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}\n\n// Provider-level types (entity-agnostic, reusable across projects)\nexport type FulfillmentProviderKey = 'MANUAL' | 'DAC';\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 getRecollectionCapabilities(): Promise<FulfillmentRecollectionCapabilities>;\n // Create fulfillment with third-party provider\n createFulfillment(input: FulfillmentProviderCreateInput): Promise<FulfillmentProviderCreateOutput>;\n processWebhook(input: FulfillmentProviderProcessWebhookInput): Promise<FulfillmentProviderProcessWebhookOutput | null>\n // cancel(input: FulfillmentProviderCancelInput): Promise<FulfillmentProviderCancelOutput>;\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 * 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}"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqBO,IAAK,YAAL,kBAAKA,eAAL;AACL,EAAAA,WAAA,WAAQ;AACR,EAAAA,WAAA,WAAQ;AACR,EAAAA,WAAA,aAAU;AACV,EAAAA,WAAA,cAAW;AACX,EAAAA,WAAA,WAAQ;AACR,EAAAA,WAAA,aAAU;AACV,EAAAA,WAAA,WAAQ;AA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GAAA;;;ACGL,IAAK,gCAAL,kBAAKC,mCAAL;AACH,EAAAA,+BAAA,YAAS;AACT,EAAAA,+BAAA,cAAW;AAFH,SAAAA;AAAA,GAAA;","names":["MediaType","Currency","AccountStatus","AccountBranchStatus","AccountBranchScheduleStatus","AccountBranchScheduleDay","DeliveryType","AccountDeliveryOptionPriceLogic","AccountDeliveryOptionStatus","AccountDeliveryOptionZoneStatus","AccountDomainStatus","AccountIntegrationStatus","AccountIntegrationConnectionStatus","AccountIntegrationEnvironment","CartStatus","CartSource","CartDeliveryType","CartItemErrorCode","CustomerStatus","IntegrationCategory","IntegrationStatus","OrderStatus","OrderPaymentStatus","OrderSource","OrderDeliveryType","PaymentStatus","PaymentMethodType","PaymentCardBrandKey","ProductStatus","ProductType","ProductAttributeStatus","ProductAttributeType","ProductCategoryStatus","StandardCategoryStatus","StoreBannerStatus","StorePageStatus","StorePageType","PubSubTopics","SupportConversationChannel","SupportConversationVisibility","SupportConversationPriority","SupportConversationStatus","SupportConversationMessageDeliveryStatus","SupportConversationMessageAiAnalysisStatus","SupportConversationMessageDirection","SupportConversationMessageSenderType","FulfillmentStatus","GeoZoneStatus","IntegrationDeliveryZoneStatus"]}