@retaila/shared-types 1.1.50 → 1.1.52
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.d.mts +48 -8
- package/dist/index.d.ts +48 -8
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -149,6 +149,8 @@ interface Integration {
|
|
|
149
149
|
logoUrl?: string;
|
|
150
150
|
requiredParamsSchema?: any;
|
|
151
151
|
supportedPaymentMethods?: string[];
|
|
152
|
+
paymentCanRecapture?: boolean;
|
|
153
|
+
paymentCanRefund?: boolean;
|
|
152
154
|
status: IntegrationStatus;
|
|
153
155
|
createdAt: Date;
|
|
154
156
|
updatedAt: Date;
|
|
@@ -325,6 +327,43 @@ declare enum AccountDomainStatus {
|
|
|
325
327
|
INACTIVE = "INACTIVE"
|
|
326
328
|
}
|
|
327
329
|
|
|
330
|
+
interface StatusInfo {
|
|
331
|
+
text: string;
|
|
332
|
+
class: string;
|
|
333
|
+
actionText?: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
declare enum AccountPaymentMethodStatus {
|
|
337
|
+
ACTIVE = "ACTIVE",// Active
|
|
338
|
+
INACTIVE = "INACTIVE"
|
|
339
|
+
}
|
|
340
|
+
declare enum AccountPaymentMethodType {
|
|
341
|
+
PROVIDER = "PROVIDER",
|
|
342
|
+
MANUAL = "MANUAL"
|
|
343
|
+
}
|
|
344
|
+
interface AccountPaymentMethod {
|
|
345
|
+
id: string;
|
|
346
|
+
accountId: string;
|
|
347
|
+
accountIntegrationId?: string;
|
|
348
|
+
type: AccountPaymentMethodType;
|
|
349
|
+
name: string;
|
|
350
|
+
description?: string;
|
|
351
|
+
customerInstructions?: string;
|
|
352
|
+
order: number;
|
|
353
|
+
status: AccountPaymentMethodStatus;
|
|
354
|
+
demo: boolean;
|
|
355
|
+
createdAt: Date;
|
|
356
|
+
updatedAt: Date;
|
|
357
|
+
deletedAt?: Date;
|
|
358
|
+
accountIntegration?: AccountIntegration;
|
|
359
|
+
account?: Account;
|
|
360
|
+
statusInfo?: StatusInfo;
|
|
361
|
+
typeName?: string;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
declare function getAccountPaymentMethodStatusInfo(status: AccountPaymentMethodStatus): StatusInfo;
|
|
365
|
+
declare function getAccountPaymentMethodTypeName(type: AccountPaymentMethodType): string;
|
|
366
|
+
|
|
328
367
|
/**
|
|
329
368
|
* Entidad Customer
|
|
330
369
|
* Cliente de la tienda
|
|
@@ -361,12 +400,6 @@ interface CustomerUpsertDto {
|
|
|
361
400
|
phone?: Phone;
|
|
362
401
|
}
|
|
363
402
|
|
|
364
|
-
interface StatusInfo {
|
|
365
|
-
text: string;
|
|
366
|
-
class: string;
|
|
367
|
-
actionText?: string;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
403
|
/**
|
|
371
404
|
* Entidad StandardCategory
|
|
372
405
|
* Define las categorías estándar de productos.
|
|
@@ -566,7 +599,8 @@ interface Payment {
|
|
|
566
599
|
accountId: string;
|
|
567
600
|
orderId: string;
|
|
568
601
|
invoiceId?: string;
|
|
569
|
-
|
|
602
|
+
accountPaymentMethodId?: string;
|
|
603
|
+
accountIntegrationId?: string;
|
|
570
604
|
referenceCode?: string;
|
|
571
605
|
paymentMethodType?: PaymentMethodType;
|
|
572
606
|
currency: Currency;
|
|
@@ -585,6 +619,7 @@ interface Payment {
|
|
|
585
619
|
createdAt: string | Date;
|
|
586
620
|
updatedAt: string | Date;
|
|
587
621
|
deletedAt?: string | Date;
|
|
622
|
+
accountPaymentMethod?: Partial<AccountPaymentMethod> | null;
|
|
588
623
|
}
|
|
589
624
|
type PaymentProviderKey = 'MERCADOPAGO' | 'MANUAL';
|
|
590
625
|
interface PaymentProviderContext {
|
|
@@ -664,6 +699,7 @@ interface Order {
|
|
|
664
699
|
deliveryPhone?: any;
|
|
665
700
|
deliveryOptionId?: string;
|
|
666
701
|
pickupBranchId?: string;
|
|
702
|
+
accountPaymentMethodId?: string;
|
|
667
703
|
paymentMethodIntegrationId?: string;
|
|
668
704
|
billingInformation?: any;
|
|
669
705
|
currency: Currency;
|
|
@@ -695,6 +731,7 @@ interface Order {
|
|
|
695
731
|
customer?: Customer | null;
|
|
696
732
|
paymentMethodIntegration?: AccountIntegration | null;
|
|
697
733
|
accountDomain?: AccountDomain;
|
|
734
|
+
accountPaymentMethod?: Partial<AccountPaymentMethod> | null;
|
|
698
735
|
statusFlow?: StatusFlow[];
|
|
699
736
|
statusChangeAllowed?: OrderStatus[];
|
|
700
737
|
}
|
|
@@ -903,6 +940,7 @@ interface Cart {
|
|
|
903
940
|
currency: string;
|
|
904
941
|
subtotal: number;
|
|
905
942
|
total: number;
|
|
943
|
+
accountPaymentMethodId?: string;
|
|
906
944
|
deliveryType: CartDeliveryType;
|
|
907
945
|
deliveryFirstName?: string;
|
|
908
946
|
deliveryLastName?: string;
|
|
@@ -928,6 +966,7 @@ interface Cart {
|
|
|
928
966
|
taxDetails?: any;
|
|
929
967
|
customer?: Partial<Customer> | null;
|
|
930
968
|
accountDomain?: Partial<AccountDomain> | null;
|
|
969
|
+
accountPaymentMethod?: Partial<AccountPaymentMethod> | null;
|
|
931
970
|
}
|
|
932
971
|
interface CartItem {
|
|
933
972
|
id: string;
|
|
@@ -1092,6 +1131,7 @@ declare enum PubSubTopics {
|
|
|
1092
1131
|
ORDER_PROCESSING = "order-processing",
|
|
1093
1132
|
ORDER_PROCESSED = "order-processed",
|
|
1094
1133
|
ORDER_COMPLETED = "order-completed",
|
|
1134
|
+
ORDER_CANCELLED = "order-cancelled",
|
|
1095
1135
|
PAYMENT_PAID = "payment-paid",
|
|
1096
1136
|
NOTIFICATION_CREATED = "notification-created"
|
|
1097
1137
|
}
|
|
@@ -1305,4 +1345,4 @@ interface StoreCustomizationSeo {
|
|
|
1305
1345
|
favicon?: Media | null;
|
|
1306
1346
|
}
|
|
1307
1347
|
|
|
1308
|
-
export { type Account, type AccountBranch, type AccountBranchSchedule, AccountBranchScheduleDay, AccountBranchScheduleStatus, AccountBranchStatus, type AccountDeliveryOption, type AccountDeliveryOptionCalculatedCost, AccountDeliveryOptionPriceLogic, AccountDeliveryOptionStatus, type AccountDeliveryOptionZone, AccountDeliveryOptionZoneStatus, type AccountDomain, AccountDomainStatus, type AccountIntegration, type AccountIntegrationConfigDTO, AccountIntegrationConnectionStatus, AccountIntegrationEnvironment, AccountIntegrationStatus, AccountStatus, type Address, type AdminOrderStatusChangeDto, type BaseEntity, type BaseEntityWithAccount, type BaseEntityWithAccountAndUser, type BaseEntityWithUser, type ButtonStyle, type Cart, type CartConfirmDto, CartDeliveryType, type CartItem, type CartItemAddDto, type CartItemAttributeDetail, CartItemErrorCode, type CartItemRemoveDto, type CartItemUpdateDto, type CartItemValidation, CartSource, CartStatus, type CartUpdateDto, type CreateFulfillmentDto, Currency, type Customer, CustomerStatus, type CustomerUpsertDto, type Fulfillment, FulfillmentStatus, type Integration, IntegrationCategory, IntegrationStatus, type MapPosition, type Media, MediaType, type NextStatusAction, type Order, type OrderCreateFromCartDto, OrderDeliveryType, type OrderItem, type OrderItemSnapshot, OrderPaymentStatus, OrderSource, OrderStatus, type Payment, type PaymentCardBrand, PaymentCardBrandKey, PaymentMethodType, type PaymentProviderAdapter, type PaymentProviderCaptureInput, type PaymentProviderCaptureOutput, type PaymentProviderContext, type PaymentProviderInitInput, type PaymentProviderInitOutput, type PaymentProviderKey, type PaymentProviderRefundInput, type PaymentProviderRefundOutput, type PaymentProviderWebhookResult, PaymentStatus, type Phone, type Product, type ProductAttribute, type ProductAttributeOption, ProductAttributeStatus, ProductAttributeType, type ProductCategory, ProductCategoryStatus, ProductStatus, ProductType, type ProductVariant, PubSubTopics, type StandardCategory, StandardCategoryStatus, type StatusChangeHistory, type StatusFlow, type StoreBanner, StoreBannerStatus, type StoreCustomization, type StoreCustomizationComponentSettings, type StoreCustomizationLayoutComponent, type StoreCustomizationPage, type StoreCustomizationPageComponent, type StoreCustomizationSeo, type StoreCustomizationThemeButtons, type StoreCustomizationThemeColors, type StoreCustomizationThemeTypography, type StorePage, StorePageStatus, StorePageType, type SupportConversation, SupportConversationChannel, type SupportConversationMessage, SupportConversationMessageAiAnalysisStatus, SupportConversationMessageDeliveryStatus, SupportConversationMessageDirection, SupportConversationMessageSenderType, SupportConversationPriority, SupportConversationStatus, SupportConversationVisibility, type ThemeConfig, type WebhookPayload, getCurrencySymbol, getFulfillmentStatusInfo, getOrderStatusInfo, getPaymentCardBrand, getPaymentStatusInfo, getProductStatusInfo };
|
|
1348
|
+
export { type Account, type AccountBranch, type AccountBranchSchedule, AccountBranchScheduleDay, AccountBranchScheduleStatus, AccountBranchStatus, type AccountDeliveryOption, type AccountDeliveryOptionCalculatedCost, AccountDeliveryOptionPriceLogic, AccountDeliveryOptionStatus, type AccountDeliveryOptionZone, AccountDeliveryOptionZoneStatus, type AccountDomain, AccountDomainStatus, type AccountIntegration, type AccountIntegrationConfigDTO, AccountIntegrationConnectionStatus, AccountIntegrationEnvironment, AccountIntegrationStatus, type AccountPaymentMethod, AccountPaymentMethodStatus, AccountPaymentMethodType, AccountStatus, type Address, type AdminOrderStatusChangeDto, type BaseEntity, type BaseEntityWithAccount, type BaseEntityWithAccountAndUser, type BaseEntityWithUser, type ButtonStyle, type Cart, type CartConfirmDto, CartDeliveryType, type CartItem, type CartItemAddDto, type CartItemAttributeDetail, CartItemErrorCode, type CartItemRemoveDto, type CartItemUpdateDto, type CartItemValidation, CartSource, CartStatus, type CartUpdateDto, type CreateFulfillmentDto, Currency, type Customer, CustomerStatus, type CustomerUpsertDto, type Fulfillment, FulfillmentStatus, type Integration, IntegrationCategory, IntegrationStatus, type MapPosition, type Media, MediaType, type NextStatusAction, type Order, type OrderCreateFromCartDto, OrderDeliveryType, type OrderItem, type OrderItemSnapshot, OrderPaymentStatus, OrderSource, OrderStatus, type Payment, type PaymentCardBrand, PaymentCardBrandKey, PaymentMethodType, type PaymentProviderAdapter, type PaymentProviderCaptureInput, type PaymentProviderCaptureOutput, type PaymentProviderContext, type PaymentProviderInitInput, type PaymentProviderInitOutput, type PaymentProviderKey, type PaymentProviderRefundInput, type PaymentProviderRefundOutput, type PaymentProviderWebhookResult, PaymentStatus, type Phone, type Product, type ProductAttribute, type ProductAttributeOption, ProductAttributeStatus, ProductAttributeType, type ProductCategory, ProductCategoryStatus, ProductStatus, ProductType, type ProductVariant, PubSubTopics, type StandardCategory, StandardCategoryStatus, type StatusChangeHistory, type StatusFlow, type StoreBanner, StoreBannerStatus, type StoreCustomization, type StoreCustomizationComponentSettings, type StoreCustomizationLayoutComponent, type StoreCustomizationPage, type StoreCustomizationPageComponent, type StoreCustomizationSeo, type StoreCustomizationThemeButtons, type StoreCustomizationThemeColors, type StoreCustomizationThemeTypography, type StorePage, StorePageStatus, StorePageType, type SupportConversation, SupportConversationChannel, type SupportConversationMessage, SupportConversationMessageAiAnalysisStatus, SupportConversationMessageDeliveryStatus, SupportConversationMessageDirection, SupportConversationMessageSenderType, SupportConversationPriority, SupportConversationStatus, SupportConversationVisibility, type ThemeConfig, type WebhookPayload, getAccountPaymentMethodStatusInfo, getAccountPaymentMethodTypeName, getCurrencySymbol, getFulfillmentStatusInfo, getOrderStatusInfo, getPaymentCardBrand, getPaymentStatusInfo, getProductStatusInfo };
|
package/dist/index.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ interface Integration {
|
|
|
149
149
|
logoUrl?: string;
|
|
150
150
|
requiredParamsSchema?: any;
|
|
151
151
|
supportedPaymentMethods?: string[];
|
|
152
|
+
paymentCanRecapture?: boolean;
|
|
153
|
+
paymentCanRefund?: boolean;
|
|
152
154
|
status: IntegrationStatus;
|
|
153
155
|
createdAt: Date;
|
|
154
156
|
updatedAt: Date;
|
|
@@ -325,6 +327,43 @@ declare enum AccountDomainStatus {
|
|
|
325
327
|
INACTIVE = "INACTIVE"
|
|
326
328
|
}
|
|
327
329
|
|
|
330
|
+
interface StatusInfo {
|
|
331
|
+
text: string;
|
|
332
|
+
class: string;
|
|
333
|
+
actionText?: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
declare enum AccountPaymentMethodStatus {
|
|
337
|
+
ACTIVE = "ACTIVE",// Active
|
|
338
|
+
INACTIVE = "INACTIVE"
|
|
339
|
+
}
|
|
340
|
+
declare enum AccountPaymentMethodType {
|
|
341
|
+
PROVIDER = "PROVIDER",
|
|
342
|
+
MANUAL = "MANUAL"
|
|
343
|
+
}
|
|
344
|
+
interface AccountPaymentMethod {
|
|
345
|
+
id: string;
|
|
346
|
+
accountId: string;
|
|
347
|
+
accountIntegrationId?: string;
|
|
348
|
+
type: AccountPaymentMethodType;
|
|
349
|
+
name: string;
|
|
350
|
+
description?: string;
|
|
351
|
+
customerInstructions?: string;
|
|
352
|
+
order: number;
|
|
353
|
+
status: AccountPaymentMethodStatus;
|
|
354
|
+
demo: boolean;
|
|
355
|
+
createdAt: Date;
|
|
356
|
+
updatedAt: Date;
|
|
357
|
+
deletedAt?: Date;
|
|
358
|
+
accountIntegration?: AccountIntegration;
|
|
359
|
+
account?: Account;
|
|
360
|
+
statusInfo?: StatusInfo;
|
|
361
|
+
typeName?: string;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
declare function getAccountPaymentMethodStatusInfo(status: AccountPaymentMethodStatus): StatusInfo;
|
|
365
|
+
declare function getAccountPaymentMethodTypeName(type: AccountPaymentMethodType): string;
|
|
366
|
+
|
|
328
367
|
/**
|
|
329
368
|
* Entidad Customer
|
|
330
369
|
* Cliente de la tienda
|
|
@@ -361,12 +400,6 @@ interface CustomerUpsertDto {
|
|
|
361
400
|
phone?: Phone;
|
|
362
401
|
}
|
|
363
402
|
|
|
364
|
-
interface StatusInfo {
|
|
365
|
-
text: string;
|
|
366
|
-
class: string;
|
|
367
|
-
actionText?: string;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
403
|
/**
|
|
371
404
|
* Entidad StandardCategory
|
|
372
405
|
* Define las categorías estándar de productos.
|
|
@@ -566,7 +599,8 @@ interface Payment {
|
|
|
566
599
|
accountId: string;
|
|
567
600
|
orderId: string;
|
|
568
601
|
invoiceId?: string;
|
|
569
|
-
|
|
602
|
+
accountPaymentMethodId?: string;
|
|
603
|
+
accountIntegrationId?: string;
|
|
570
604
|
referenceCode?: string;
|
|
571
605
|
paymentMethodType?: PaymentMethodType;
|
|
572
606
|
currency: Currency;
|
|
@@ -585,6 +619,7 @@ interface Payment {
|
|
|
585
619
|
createdAt: string | Date;
|
|
586
620
|
updatedAt: string | Date;
|
|
587
621
|
deletedAt?: string | Date;
|
|
622
|
+
accountPaymentMethod?: Partial<AccountPaymentMethod> | null;
|
|
588
623
|
}
|
|
589
624
|
type PaymentProviderKey = 'MERCADOPAGO' | 'MANUAL';
|
|
590
625
|
interface PaymentProviderContext {
|
|
@@ -664,6 +699,7 @@ interface Order {
|
|
|
664
699
|
deliveryPhone?: any;
|
|
665
700
|
deliveryOptionId?: string;
|
|
666
701
|
pickupBranchId?: string;
|
|
702
|
+
accountPaymentMethodId?: string;
|
|
667
703
|
paymentMethodIntegrationId?: string;
|
|
668
704
|
billingInformation?: any;
|
|
669
705
|
currency: Currency;
|
|
@@ -695,6 +731,7 @@ interface Order {
|
|
|
695
731
|
customer?: Customer | null;
|
|
696
732
|
paymentMethodIntegration?: AccountIntegration | null;
|
|
697
733
|
accountDomain?: AccountDomain;
|
|
734
|
+
accountPaymentMethod?: Partial<AccountPaymentMethod> | null;
|
|
698
735
|
statusFlow?: StatusFlow[];
|
|
699
736
|
statusChangeAllowed?: OrderStatus[];
|
|
700
737
|
}
|
|
@@ -903,6 +940,7 @@ interface Cart {
|
|
|
903
940
|
currency: string;
|
|
904
941
|
subtotal: number;
|
|
905
942
|
total: number;
|
|
943
|
+
accountPaymentMethodId?: string;
|
|
906
944
|
deliveryType: CartDeliveryType;
|
|
907
945
|
deliveryFirstName?: string;
|
|
908
946
|
deliveryLastName?: string;
|
|
@@ -928,6 +966,7 @@ interface Cart {
|
|
|
928
966
|
taxDetails?: any;
|
|
929
967
|
customer?: Partial<Customer> | null;
|
|
930
968
|
accountDomain?: Partial<AccountDomain> | null;
|
|
969
|
+
accountPaymentMethod?: Partial<AccountPaymentMethod> | null;
|
|
931
970
|
}
|
|
932
971
|
interface CartItem {
|
|
933
972
|
id: string;
|
|
@@ -1092,6 +1131,7 @@ declare enum PubSubTopics {
|
|
|
1092
1131
|
ORDER_PROCESSING = "order-processing",
|
|
1093
1132
|
ORDER_PROCESSED = "order-processed",
|
|
1094
1133
|
ORDER_COMPLETED = "order-completed",
|
|
1134
|
+
ORDER_CANCELLED = "order-cancelled",
|
|
1095
1135
|
PAYMENT_PAID = "payment-paid",
|
|
1096
1136
|
NOTIFICATION_CREATED = "notification-created"
|
|
1097
1137
|
}
|
|
@@ -1305,4 +1345,4 @@ interface StoreCustomizationSeo {
|
|
|
1305
1345
|
favicon?: Media | null;
|
|
1306
1346
|
}
|
|
1307
1347
|
|
|
1308
|
-
export { type Account, type AccountBranch, type AccountBranchSchedule, AccountBranchScheduleDay, AccountBranchScheduleStatus, AccountBranchStatus, type AccountDeliveryOption, type AccountDeliveryOptionCalculatedCost, AccountDeliveryOptionPriceLogic, AccountDeliveryOptionStatus, type AccountDeliveryOptionZone, AccountDeliveryOptionZoneStatus, type AccountDomain, AccountDomainStatus, type AccountIntegration, type AccountIntegrationConfigDTO, AccountIntegrationConnectionStatus, AccountIntegrationEnvironment, AccountIntegrationStatus, AccountStatus, type Address, type AdminOrderStatusChangeDto, type BaseEntity, type BaseEntityWithAccount, type BaseEntityWithAccountAndUser, type BaseEntityWithUser, type ButtonStyle, type Cart, type CartConfirmDto, CartDeliveryType, type CartItem, type CartItemAddDto, type CartItemAttributeDetail, CartItemErrorCode, type CartItemRemoveDto, type CartItemUpdateDto, type CartItemValidation, CartSource, CartStatus, type CartUpdateDto, type CreateFulfillmentDto, Currency, type Customer, CustomerStatus, type CustomerUpsertDto, type Fulfillment, FulfillmentStatus, type Integration, IntegrationCategory, IntegrationStatus, type MapPosition, type Media, MediaType, type NextStatusAction, type Order, type OrderCreateFromCartDto, OrderDeliveryType, type OrderItem, type OrderItemSnapshot, OrderPaymentStatus, OrderSource, OrderStatus, type Payment, type PaymentCardBrand, PaymentCardBrandKey, PaymentMethodType, type PaymentProviderAdapter, type PaymentProviderCaptureInput, type PaymentProviderCaptureOutput, type PaymentProviderContext, type PaymentProviderInitInput, type PaymentProviderInitOutput, type PaymentProviderKey, type PaymentProviderRefundInput, type PaymentProviderRefundOutput, type PaymentProviderWebhookResult, PaymentStatus, type Phone, type Product, type ProductAttribute, type ProductAttributeOption, ProductAttributeStatus, ProductAttributeType, type ProductCategory, ProductCategoryStatus, ProductStatus, ProductType, type ProductVariant, PubSubTopics, type StandardCategory, StandardCategoryStatus, type StatusChangeHistory, type StatusFlow, type StoreBanner, StoreBannerStatus, type StoreCustomization, type StoreCustomizationComponentSettings, type StoreCustomizationLayoutComponent, type StoreCustomizationPage, type StoreCustomizationPageComponent, type StoreCustomizationSeo, type StoreCustomizationThemeButtons, type StoreCustomizationThemeColors, type StoreCustomizationThemeTypography, type StorePage, StorePageStatus, StorePageType, type SupportConversation, SupportConversationChannel, type SupportConversationMessage, SupportConversationMessageAiAnalysisStatus, SupportConversationMessageDeliveryStatus, SupportConversationMessageDirection, SupportConversationMessageSenderType, SupportConversationPriority, SupportConversationStatus, SupportConversationVisibility, type ThemeConfig, type WebhookPayload, getCurrencySymbol, getFulfillmentStatusInfo, getOrderStatusInfo, getPaymentCardBrand, getPaymentStatusInfo, getProductStatusInfo };
|
|
1348
|
+
export { type Account, type AccountBranch, type AccountBranchSchedule, AccountBranchScheduleDay, AccountBranchScheduleStatus, AccountBranchStatus, type AccountDeliveryOption, type AccountDeliveryOptionCalculatedCost, AccountDeliveryOptionPriceLogic, AccountDeliveryOptionStatus, type AccountDeliveryOptionZone, AccountDeliveryOptionZoneStatus, type AccountDomain, AccountDomainStatus, type AccountIntegration, type AccountIntegrationConfigDTO, AccountIntegrationConnectionStatus, AccountIntegrationEnvironment, AccountIntegrationStatus, type AccountPaymentMethod, AccountPaymentMethodStatus, AccountPaymentMethodType, AccountStatus, type Address, type AdminOrderStatusChangeDto, type BaseEntity, type BaseEntityWithAccount, type BaseEntityWithAccountAndUser, type BaseEntityWithUser, type ButtonStyle, type Cart, type CartConfirmDto, CartDeliveryType, type CartItem, type CartItemAddDto, type CartItemAttributeDetail, CartItemErrorCode, type CartItemRemoveDto, type CartItemUpdateDto, type CartItemValidation, CartSource, CartStatus, type CartUpdateDto, type CreateFulfillmentDto, Currency, type Customer, CustomerStatus, type CustomerUpsertDto, type Fulfillment, FulfillmentStatus, type Integration, IntegrationCategory, IntegrationStatus, type MapPosition, type Media, MediaType, type NextStatusAction, type Order, type OrderCreateFromCartDto, OrderDeliveryType, type OrderItem, type OrderItemSnapshot, OrderPaymentStatus, OrderSource, OrderStatus, type Payment, type PaymentCardBrand, PaymentCardBrandKey, PaymentMethodType, type PaymentProviderAdapter, type PaymentProviderCaptureInput, type PaymentProviderCaptureOutput, type PaymentProviderContext, type PaymentProviderInitInput, type PaymentProviderInitOutput, type PaymentProviderKey, type PaymentProviderRefundInput, type PaymentProviderRefundOutput, type PaymentProviderWebhookResult, PaymentStatus, type Phone, type Product, type ProductAttribute, type ProductAttributeOption, ProductAttributeStatus, ProductAttributeType, type ProductCategory, ProductCategoryStatus, ProductStatus, ProductType, type ProductVariant, PubSubTopics, type StandardCategory, StandardCategoryStatus, type StatusChangeHistory, type StatusFlow, type StoreBanner, StoreBannerStatus, type StoreCustomization, type StoreCustomizationComponentSettings, type StoreCustomizationLayoutComponent, type StoreCustomizationPage, type StoreCustomizationPageComponent, type StoreCustomizationSeo, type StoreCustomizationThemeButtons, type StoreCustomizationThemeColors, type StoreCustomizationThemeTypography, type StorePage, StorePageStatus, StorePageType, type SupportConversation, SupportConversationChannel, type SupportConversationMessage, SupportConversationMessageAiAnalysisStatus, SupportConversationMessageDeliveryStatus, SupportConversationMessageDirection, SupportConversationMessageSenderType, SupportConversationPriority, SupportConversationStatus, SupportConversationVisibility, type ThemeConfig, type WebhookPayload, getAccountPaymentMethodStatusInfo, getAccountPaymentMethodTypeName, getCurrencySymbol, getFulfillmentStatusInfo, getOrderStatusInfo, getPaymentCardBrand, getPaymentStatusInfo, getProductStatusInfo };
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,8 @@ __export(index_exports, {
|
|
|
31
31
|
AccountIntegrationConnectionStatus: () => AccountIntegrationConnectionStatus,
|
|
32
32
|
AccountIntegrationEnvironment: () => AccountIntegrationEnvironment,
|
|
33
33
|
AccountIntegrationStatus: () => AccountIntegrationStatus,
|
|
34
|
+
AccountPaymentMethodStatus: () => AccountPaymentMethodStatus,
|
|
35
|
+
AccountPaymentMethodType: () => AccountPaymentMethodType,
|
|
34
36
|
AccountStatus: () => AccountStatus,
|
|
35
37
|
CartDeliveryType: () => CartDeliveryType,
|
|
36
38
|
CartItemErrorCode: () => CartItemErrorCode,
|
|
@@ -67,6 +69,8 @@ __export(index_exports, {
|
|
|
67
69
|
SupportConversationPriority: () => SupportConversationPriority,
|
|
68
70
|
SupportConversationStatus: () => SupportConversationStatus,
|
|
69
71
|
SupportConversationVisibility: () => SupportConversationVisibility,
|
|
72
|
+
getAccountPaymentMethodStatusInfo: () => getAccountPaymentMethodStatusInfo,
|
|
73
|
+
getAccountPaymentMethodTypeName: () => getAccountPaymentMethodTypeName,
|
|
70
74
|
getCurrencySymbol: () => getCurrencySymbol,
|
|
71
75
|
getFulfillmentStatusInfo: () => getFulfillmentStatusInfo,
|
|
72
76
|
getOrderStatusInfo: () => getOrderStatusInfo,
|
|
@@ -185,6 +189,34 @@ var AccountIntegrationEnvironment = /* @__PURE__ */ ((AccountIntegrationEnvironm
|
|
|
185
189
|
return AccountIntegrationEnvironment2;
|
|
186
190
|
})(AccountIntegrationEnvironment || {});
|
|
187
191
|
|
|
192
|
+
// src/accountPaymentMethod/types.ts
|
|
193
|
+
var AccountPaymentMethodStatus = /* @__PURE__ */ ((AccountPaymentMethodStatus2) => {
|
|
194
|
+
AccountPaymentMethodStatus2["ACTIVE"] = "ACTIVE";
|
|
195
|
+
AccountPaymentMethodStatus2["INACTIVE"] = "INACTIVE";
|
|
196
|
+
return AccountPaymentMethodStatus2;
|
|
197
|
+
})(AccountPaymentMethodStatus || {});
|
|
198
|
+
var AccountPaymentMethodType = /* @__PURE__ */ ((AccountPaymentMethodType2) => {
|
|
199
|
+
AccountPaymentMethodType2["PROVIDER"] = "PROVIDER";
|
|
200
|
+
AccountPaymentMethodType2["MANUAL"] = "MANUAL";
|
|
201
|
+
return AccountPaymentMethodType2;
|
|
202
|
+
})(AccountPaymentMethodType || {});
|
|
203
|
+
|
|
204
|
+
// src/accountPaymentMethod/helpers.ts
|
|
205
|
+
function getAccountPaymentMethodStatusInfo(status) {
|
|
206
|
+
const map = {
|
|
207
|
+
ACTIVE: { text: "Activo", class: "success", actionText: "" },
|
|
208
|
+
INACTIVE: { text: "Inactivo", class: "danger", actionText: "" }
|
|
209
|
+
};
|
|
210
|
+
return map[status] ?? { text: String(status), class: "secondary" };
|
|
211
|
+
}
|
|
212
|
+
function getAccountPaymentMethodTypeName(type) {
|
|
213
|
+
const map = {
|
|
214
|
+
PROVIDER: "Procesados por un proveedor de pago.",
|
|
215
|
+
MANUAL: "Gestionados por fuera de la plataforma."
|
|
216
|
+
};
|
|
217
|
+
return map[type] ?? type;
|
|
218
|
+
}
|
|
219
|
+
|
|
188
220
|
// src/cart/types.ts
|
|
189
221
|
var CartStatus = /* @__PURE__ */ ((CartStatus2) => {
|
|
190
222
|
CartStatus2["ACTIVE"] = "ACTIVE";
|
|
@@ -446,6 +478,7 @@ var PubSubTopics = /* @__PURE__ */ ((PubSubTopics2) => {
|
|
|
446
478
|
PubSubTopics2["ORDER_PROCESSING"] = "order-processing";
|
|
447
479
|
PubSubTopics2["ORDER_PROCESSED"] = "order-processed";
|
|
448
480
|
PubSubTopics2["ORDER_COMPLETED"] = "order-completed";
|
|
481
|
+
PubSubTopics2["ORDER_CANCELLED"] = "order-cancelled";
|
|
449
482
|
PubSubTopics2["PAYMENT_PAID"] = "payment-paid";
|
|
450
483
|
PubSubTopics2["NOTIFICATION_CREATED"] = "notification-created";
|
|
451
484
|
return PubSubTopics2;
|
|
@@ -538,6 +571,8 @@ function getFulfillmentStatusInfo(status) {
|
|
|
538
571
|
AccountIntegrationConnectionStatus,
|
|
539
572
|
AccountIntegrationEnvironment,
|
|
540
573
|
AccountIntegrationStatus,
|
|
574
|
+
AccountPaymentMethodStatus,
|
|
575
|
+
AccountPaymentMethodType,
|
|
541
576
|
AccountStatus,
|
|
542
577
|
CartDeliveryType,
|
|
543
578
|
CartItemErrorCode,
|
|
@@ -574,6 +609,8 @@ function getFulfillmentStatusInfo(status) {
|
|
|
574
609
|
SupportConversationPriority,
|
|
575
610
|
SupportConversationStatus,
|
|
576
611
|
SupportConversationVisibility,
|
|
612
|
+
getAccountPaymentMethodStatusInfo,
|
|
613
|
+
getAccountPaymentMethodTypeName,
|
|
577
614
|
getCurrencySymbol,
|
|
578
615
|
getFulfillmentStatusInfo,
|
|
579
616
|
getOrderStatusInfo,
|
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/cart/types.ts","../src/cart/dto.ts","../src/customer/types.ts","../src/integration/types.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 './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 USD = 'USD',\n EUR = 'EUR',\n UYU = 'UYU',\n ARS = 'ARS',\n BRL = 'BRL'\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}","import { CartItemValidation } from \"./dto\";\nimport { Customer } from \"../customer\";\nimport { AccountDomain } from \"../accountDomain\";\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 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}\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\tstatus: IntegrationStatus;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\torder: number;\n\n\taccountIntegration: AccountIntegration | null;\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\";\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 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\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 status: OrderStatus;\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\";\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 gatewayPaymentId?: 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 cardBrand?: string;\n cardBrandInfo?: PaymentCardBrand;\n cardLast4?: string;\n data?: Record<string, unknown>\n metadata?: Record<string, any>;\n demo: boolean;\n createdAt: string | Date;\n updatedAt: string | Date;\n deletedAt?: string | Date;\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 order_code: 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}\n\nexport interface PaymentCardBrand {\n key: string;\n name: string;\n image: 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: 'Mercado Pago',\n image: 'https://storage.googleapis.com/retaila-assets/payments/mercadopago.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 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;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;AAPE,SAAAA;AAAA,GAAA;;;ACrBL,IAAK,WAAL,kBAAKC,cA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,UAAU;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","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/accountPaymentMethod/types.ts","../src/accountPaymentMethod/helpers.ts","../src/cart/types.ts","../src/cart/dto.ts","../src/customer/types.ts","../src/integration/types.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 USD = 'USD',\n EUR = 'EUR',\n UYU = 'UYU',\n ARS = 'ARS',\n BRL = 'BRL'\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 enum AccountPaymentMethodType {\n PROVIDER = 'PROVIDER',\n MANUAL = 'MANUAL',\n}\n\nexport interface AccountPaymentMethod {\n id: string;\n accountId: string;\n accountIntegrationId?: string;\n type: AccountPaymentMethodType;\n name: string;\n description?: string;\n customerInstructions?: string;\n order: number;\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, AccountPaymentMethodType } 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}\n\nexport function getAccountPaymentMethodTypeName(type: AccountPaymentMethodType): string {\n\tconst map: Record<AccountPaymentMethodType, string> = {\n\t\tPROVIDER: 'Procesados por un proveedor de pago.',\n\t\tMANUAL: 'Gestionados por fuera de la plataforma.',\n\t};\n\treturn map[type] ?? type;\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}","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 status: OrderStatus;\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\";\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 cardBrand?: string;\n cardBrandInfo?: PaymentCardBrand;\n cardLast4?: string;\n data?: Record<string, unknown>\n metadata?: Record<string, any>;\n demo: boolean;\n createdAt: string | Date;\n updatedAt: string | Date;\n deletedAt?: string | Date;\n\n accountPaymentMethod?: Partial<AccountPaymentMethod> | null;\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 order_code: 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}\n\nexport interface PaymentCardBrand {\n key: string;\n name: string;\n image: 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: 'Mercado Pago',\n image: 'https://storage.googleapis.com/retaila-assets/payments/mercadopago.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;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;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AALE,SAAAA;AAAA,GAAA;AAQL,IAAK,6CAAL,kBAAKC,gDAAL;AACN,EAAAA,4CAAA,aAAU;AACV,EAAAA,4CAAA,gBAAa;AACb,EAAAA,4CAAA,eAAY;AACZ,EAAAA,4CAAA,YAAS;AAJE,SAAAA;AAAA,GAAA;AAQL,IAAK,sCAAL,kBAAKC,yCAAL;AACN,EAAAA,qCAAA,aAAU;AACV,EAAAA,qCAAA,cAAW;AAFA,SAAAA;AAAA,GAAA;AAMH,IAAK,uCAAL,kBAAKC,0CAAL;AACR,EAAAA,sCAAA,cAAW;AACX,EAAAA,sCAAA,kBAAe;AACf,EAAAA,sCAAA,eAAY;AACZ,EAAAA,sCAAA,YAAS;AACT,EAAAA,sCAAA,QAAK;AALQ,SAAAA;AAAA,GAAA;;;AClDP,IAAK,oBAAL,kBAAKC,uBAAL;AACH,EAAAA,mBAAA,aAAU;AACV,EAAAA,mBAAA,YAAS;AACT,EAAAA,mBAAA,aAAU;AACV,EAAAA,mBAAA,eAAY;AACZ,EAAAA,mBAAA,eAAY;AALJ,SAAAA;AAAA,GAAA;;;ACCL,SAAS,yBAAyB,QAAuC;AAC/E,QAAM,MAA6C;AAAA,IAClD,SAAS,EAAE,MAAM,aAAa,OAAO,WAAW,YAAY,GAAG;AAAA,IAC/D,QAAQ,EAAE,MAAM,iBAAiB,OAAO,QAAQ,YAAY,gBAAgB;AAAA,IAC5E,SAAS,EAAE,MAAM,WAAW,OAAO,WAAW,YAAY,UAAU;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","AccountPaymentMethodType","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"]}
|
package/dist/index.mjs
CHANGED
|
@@ -109,6 +109,34 @@ var AccountIntegrationEnvironment = /* @__PURE__ */ ((AccountIntegrationEnvironm
|
|
|
109
109
|
return AccountIntegrationEnvironment2;
|
|
110
110
|
})(AccountIntegrationEnvironment || {});
|
|
111
111
|
|
|
112
|
+
// src/accountPaymentMethod/types.ts
|
|
113
|
+
var AccountPaymentMethodStatus = /* @__PURE__ */ ((AccountPaymentMethodStatus2) => {
|
|
114
|
+
AccountPaymentMethodStatus2["ACTIVE"] = "ACTIVE";
|
|
115
|
+
AccountPaymentMethodStatus2["INACTIVE"] = "INACTIVE";
|
|
116
|
+
return AccountPaymentMethodStatus2;
|
|
117
|
+
})(AccountPaymentMethodStatus || {});
|
|
118
|
+
var AccountPaymentMethodType = /* @__PURE__ */ ((AccountPaymentMethodType2) => {
|
|
119
|
+
AccountPaymentMethodType2["PROVIDER"] = "PROVIDER";
|
|
120
|
+
AccountPaymentMethodType2["MANUAL"] = "MANUAL";
|
|
121
|
+
return AccountPaymentMethodType2;
|
|
122
|
+
})(AccountPaymentMethodType || {});
|
|
123
|
+
|
|
124
|
+
// src/accountPaymentMethod/helpers.ts
|
|
125
|
+
function getAccountPaymentMethodStatusInfo(status) {
|
|
126
|
+
const map = {
|
|
127
|
+
ACTIVE: { text: "Activo", class: "success", actionText: "" },
|
|
128
|
+
INACTIVE: { text: "Inactivo", class: "danger", actionText: "" }
|
|
129
|
+
};
|
|
130
|
+
return map[status] ?? { text: String(status), class: "secondary" };
|
|
131
|
+
}
|
|
132
|
+
function getAccountPaymentMethodTypeName(type) {
|
|
133
|
+
const map = {
|
|
134
|
+
PROVIDER: "Procesados por un proveedor de pago.",
|
|
135
|
+
MANUAL: "Gestionados por fuera de la plataforma."
|
|
136
|
+
};
|
|
137
|
+
return map[type] ?? type;
|
|
138
|
+
}
|
|
139
|
+
|
|
112
140
|
// src/cart/types.ts
|
|
113
141
|
var CartStatus = /* @__PURE__ */ ((CartStatus2) => {
|
|
114
142
|
CartStatus2["ACTIVE"] = "ACTIVE";
|
|
@@ -370,6 +398,7 @@ var PubSubTopics = /* @__PURE__ */ ((PubSubTopics2) => {
|
|
|
370
398
|
PubSubTopics2["ORDER_PROCESSING"] = "order-processing";
|
|
371
399
|
PubSubTopics2["ORDER_PROCESSED"] = "order-processed";
|
|
372
400
|
PubSubTopics2["ORDER_COMPLETED"] = "order-completed";
|
|
401
|
+
PubSubTopics2["ORDER_CANCELLED"] = "order-cancelled";
|
|
373
402
|
PubSubTopics2["PAYMENT_PAID"] = "payment-paid";
|
|
374
403
|
PubSubTopics2["NOTIFICATION_CREATED"] = "notification-created";
|
|
375
404
|
return PubSubTopics2;
|
|
@@ -461,6 +490,8 @@ export {
|
|
|
461
490
|
AccountIntegrationConnectionStatus,
|
|
462
491
|
AccountIntegrationEnvironment,
|
|
463
492
|
AccountIntegrationStatus,
|
|
493
|
+
AccountPaymentMethodStatus,
|
|
494
|
+
AccountPaymentMethodType,
|
|
464
495
|
AccountStatus,
|
|
465
496
|
CartDeliveryType,
|
|
466
497
|
CartItemErrorCode,
|
|
@@ -497,6 +528,8 @@ export {
|
|
|
497
528
|
SupportConversationPriority,
|
|
498
529
|
SupportConversationStatus,
|
|
499
530
|
SupportConversationVisibility,
|
|
531
|
+
getAccountPaymentMethodStatusInfo,
|
|
532
|
+
getAccountPaymentMethodTypeName,
|
|
500
533
|
getCurrencySymbol,
|
|
501
534
|
getFulfillmentStatusInfo,
|
|
502
535
|
getOrderStatusInfo,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../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/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":["/**\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 USD = 'USD',\n EUR = 'EUR',\n UYU = 'UYU',\n ARS = 'ARS',\n BRL = 'BRL'\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}","import { CartItemValidation } from \"./dto\";\nimport { Customer } from \"../customer\";\nimport { AccountDomain } from \"../accountDomain\";\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 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}\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\tstatus: IntegrationStatus;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tdeletedAt?: Date | null;\n\torder: number;\n\n\taccountIntegration: AccountIntegration | null;\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\";\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 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\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 status: OrderStatus;\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\";\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 gatewayPaymentId?: 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 cardBrand?: string;\n cardBrandInfo?: PaymentCardBrand;\n cardLast4?: string;\n data?: Record<string, unknown>\n metadata?: Record<string, any>;\n demo: boolean;\n createdAt: string | Date;\n updatedAt: string | Date;\n deletedAt?: string | Date;\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 order_code: 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}\n\nexport interface PaymentCardBrand {\n key: string;\n name: string;\n image: 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: 'Mercado Pago',\n image: 'https://storage.googleapis.com/retaila-assets/payments/mercadopago.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 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":";;;AAqBO,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;AAPE,SAAAA;AAAA,GAAA;;;ACrBL,IAAK,WAAL,kBAAKC,cAAL;AACL,EAAAA,UAAA,SAAM;A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E,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","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/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/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":["/**\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 USD = 'USD',\n EUR = 'EUR',\n UYU = 'UYU',\n ARS = 'ARS',\n BRL = 'BRL'\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 enum AccountPaymentMethodType {\n PROVIDER = 'PROVIDER',\n MANUAL = 'MANUAL',\n}\n\nexport interface AccountPaymentMethod {\n id: string;\n accountId: string;\n accountIntegrationId?: string;\n type: AccountPaymentMethodType;\n name: string;\n description?: string;\n customerInstructions?: string;\n order: number;\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, AccountPaymentMethodType } 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}\n\nexport function getAccountPaymentMethodTypeName(type: AccountPaymentMethodType): string {\n\tconst map: Record<AccountPaymentMethodType, string> = {\n\t\tPROVIDER: 'Procesados por un proveedor de pago.',\n\t\tMANUAL: 'Gestionados por fuera de la plataforma.',\n\t};\n\treturn map[type] ?? type;\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}","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 status: OrderStatus;\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\";\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 cardBrand?: string;\n cardBrandInfo?: PaymentCardBrand;\n cardLast4?: string;\n data?: Record<string, unknown>\n metadata?: Record<string, any>;\n demo: boolean;\n createdAt: string | Date;\n updatedAt: string | Date;\n deletedAt?: string | Date;\n\n accountPaymentMethod?: Partial<AccountPaymentMethod> | null;\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 order_code: 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}\n\nexport interface PaymentCardBrand {\n key: string;\n name: string;\n image: 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: 'Mercado Pago',\n image: 'https://storage.googleapis.com/retaila-assets/payments/mercadopago.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":";;;AAqBO,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;AAPE,SAAAA;AAAA,GAAA;;;ACrBL,IAAK,WAAL,kBAAKC,cAAL;AACL,EAAAA,UAAA,SAAM;AACN,EAAAA,UAAA,SAAM;AACN,EAAAA,UAAA,SAAM;AACN,EAAAA,UAAA,SAAM;AACN,EAAAA,UAAA,SAAM;AALI,SAAAA;AAAA,GAAA;AAQL,SAAS,kBAAkB,cAAgC;AAChE,QAAM,kBAA6C;AAAA,IAC/C,CAAC,eAAY,GAAG;AAAA,IAChB,CAAC,eAAY,GAAG;AAAA,IAChB,CAAC,eAAY,GAAG;AAAA,IAChB,CAAC,eAAY,GAAG;AAAA,IAChB,CAAC,eAAY,GAAG;AAAA,EACpB;AAEA,SAAO,gBAAgB,YAAY,KAAK,aAAa,SAAS;AAChE;;;ACOO,IAAK,gBAAL,kBAAKC,mBAAL;AACL,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,aAAU;AACV,EAAAA,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D,QAAQ,EAAE,MAAM,iBAAiB,OAAO,QAAQ,YAAY,gBAAgB;AAAA,IAC5E,SAAS,EAAE,MAAM,WAAW,OAAO,WAAW,YAAY,UAAU;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","AccountPaymentMethodType","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"]}
|