@retaila/shared-types 1.1.59 → 1.1.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +375 -73
- package/dist/index.d.ts +375 -73
- package/dist/index.js +107 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.d.mts
CHANGED
|
@@ -77,6 +77,31 @@ declare enum Currency {
|
|
|
77
77
|
UYU = "UYU"
|
|
78
78
|
}
|
|
79
79
|
declare function getCurrencySymbol(currencyCode: Currency): string;
|
|
80
|
+
/**
|
|
81
|
+
* Analiza un patrón de formato de precio y extrae la configuración necesaria
|
|
82
|
+
* @param pattern - Patrón de ejemplo como '1,000.12', '1.000,12', '1000.12', '1000'
|
|
83
|
+
* @returns Configuración de formato de precio para Intl.NumberFormat
|
|
84
|
+
*
|
|
85
|
+
* Patrones soportados:
|
|
86
|
+
* - '1.000,12' → es-ES (punto para miles, coma para decimales)
|
|
87
|
+
* - '1,000.12' → en-US (coma para miles, punto para decimales)
|
|
88
|
+
* - '1000,12' → sin separador de miles, coma para decimales
|
|
89
|
+
* - '1000.12' → sin separador de miles, punto para decimales
|
|
90
|
+
* - '1.000' → punto para miles, sin decimales
|
|
91
|
+
* - '1,000' → coma para miles, sin decimales
|
|
92
|
+
* - '1000' → sin separadores, sin decimales
|
|
93
|
+
*/
|
|
94
|
+
declare function parsePriceFormatPattern(pattern: string): {
|
|
95
|
+
locale: string;
|
|
96
|
+
useGrouping: boolean;
|
|
97
|
+
minimumFractionDigits: number;
|
|
98
|
+
maximumFractionDigits: number;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
type Webhook = {
|
|
102
|
+
body: Record<string, unknown>;
|
|
103
|
+
headers: Record<string, string>;
|
|
104
|
+
};
|
|
80
105
|
|
|
81
106
|
interface Account {
|
|
82
107
|
id: string;
|
|
@@ -85,6 +110,7 @@ interface Account {
|
|
|
85
110
|
address?: string;
|
|
86
111
|
logoId?: string;
|
|
87
112
|
currency: string;
|
|
113
|
+
priceFormatPattern: string;
|
|
88
114
|
instagram?: string;
|
|
89
115
|
facebook?: string;
|
|
90
116
|
whatsapp?: string;
|
|
@@ -99,6 +125,7 @@ interface Account {
|
|
|
99
125
|
createdAt: Date;
|
|
100
126
|
updatedAt: Date;
|
|
101
127
|
deletedAt?: Date;
|
|
128
|
+
priceFormat?: Intl.NumberFormatOptions;
|
|
102
129
|
}
|
|
103
130
|
declare enum AccountStatus {
|
|
104
131
|
ACTIVE = "ACTIVE",
|
|
@@ -204,6 +231,33 @@ interface AccountIntegration {
|
|
|
204
231
|
settings: Record<string, any>;
|
|
205
232
|
}
|
|
206
233
|
|
|
234
|
+
/**
|
|
235
|
+
* GeoZone types
|
|
236
|
+
* Define zonas geográficas reutilizables que pueden ser referenciadas por otras entidades.
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
interface GeoZone {
|
|
240
|
+
id: string;
|
|
241
|
+
name: string;
|
|
242
|
+
description?: string;
|
|
243
|
+
accountId?: string | null;
|
|
244
|
+
area: MapPosition[];
|
|
245
|
+
createdAt: Date;
|
|
246
|
+
updatedAt: Date;
|
|
247
|
+
deletedAt?: Date | null;
|
|
248
|
+
}
|
|
249
|
+
declare enum GeoZoneStatus {
|
|
250
|
+
ACTIVE = "ACTIVE",
|
|
251
|
+
INACTIVE = "INACTIVE"
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Delivery types to distinguish between shipping and pickup options
|
|
256
|
+
*/
|
|
257
|
+
declare enum DeliveryType {
|
|
258
|
+
SHIPPING = "SHIPPING",
|
|
259
|
+
PICKUP = "PICKUP"
|
|
260
|
+
}
|
|
207
261
|
/**
|
|
208
262
|
* Entidad AccountDeliveryOption
|
|
209
263
|
* Representa una opción de envío de una cuenta.
|
|
@@ -213,22 +267,24 @@ interface AccountDeliveryOption {
|
|
|
213
267
|
accountId: string;
|
|
214
268
|
accountBranchId: string;
|
|
215
269
|
name: string;
|
|
216
|
-
|
|
270
|
+
accountIntegrationId?: string;
|
|
217
271
|
isScheduled: boolean;
|
|
218
272
|
priceLogic: AccountDeliveryOptionPriceLogic;
|
|
219
273
|
status: AccountDeliveryOptionStatus;
|
|
274
|
+
deliveryType: DeliveryType;
|
|
220
275
|
demo: boolean;
|
|
221
276
|
createdAt: Date;
|
|
222
277
|
updatedAt: Date;
|
|
223
278
|
deletedAt?: Date | null;
|
|
224
|
-
|
|
279
|
+
data?: Record<string, unknown>;
|
|
280
|
+
deliveryZones: AccountDeliveryOptionZone[];
|
|
225
281
|
integration?: AccountIntegration | null;
|
|
226
|
-
|
|
282
|
+
price?: number | null;
|
|
227
283
|
accountBranch?: AccountBranch | null;
|
|
228
284
|
}
|
|
229
285
|
declare enum AccountDeliveryOptionPriceLogic {
|
|
230
286
|
FIXED = "FIXED",
|
|
231
|
-
|
|
287
|
+
CALCULATED = "CALCULATED"
|
|
232
288
|
}
|
|
233
289
|
declare enum AccountDeliveryOptionStatus {
|
|
234
290
|
ACTIVE = "ACTIVE",
|
|
@@ -245,20 +301,51 @@ interface AccountDeliveryOptionZone {
|
|
|
245
301
|
id: string;
|
|
246
302
|
accountId: string;
|
|
247
303
|
accountDeliveryOptionId: string;
|
|
248
|
-
|
|
249
|
-
price: number;
|
|
250
|
-
priceMin: number;
|
|
251
|
-
area: string;
|
|
304
|
+
geoZoneId: string;
|
|
252
305
|
status: AccountDeliveryOptionZoneStatus;
|
|
253
306
|
demo: boolean;
|
|
254
307
|
createdAt: Date;
|
|
255
308
|
updatedAt: Date;
|
|
256
309
|
deletedAt?: Date | null;
|
|
310
|
+
geoZone?: GeoZone;
|
|
257
311
|
}
|
|
258
312
|
declare enum AccountDeliveryOptionZoneStatus {
|
|
259
313
|
ACTIVE = "ACTIVE",
|
|
260
314
|
INACTIVE = "INACTIVE"
|
|
261
315
|
}
|
|
316
|
+
interface DeliveryZoneInput {
|
|
317
|
+
geoZoneId?: string;
|
|
318
|
+
geoZone?: GeoZoneInput;
|
|
319
|
+
}
|
|
320
|
+
interface GeoZoneInput {
|
|
321
|
+
name: string;
|
|
322
|
+
area: MapPosition[];
|
|
323
|
+
description?: string;
|
|
324
|
+
}
|
|
325
|
+
interface CreateAccountDeliveryOptionDTO {
|
|
326
|
+
accountId: string;
|
|
327
|
+
accountBranchId: string;
|
|
328
|
+
name: string;
|
|
329
|
+
accountIntegrationId?: string | null;
|
|
330
|
+
isScheduled?: boolean;
|
|
331
|
+
priceLogic?: AccountDeliveryOptionPriceLogic;
|
|
332
|
+
price?: number;
|
|
333
|
+
status?: AccountDeliveryOptionStatus;
|
|
334
|
+
deliveryType: DeliveryType;
|
|
335
|
+
deliveryZones?: DeliveryZoneInput[];
|
|
336
|
+
data?: Record<string, unknown>;
|
|
337
|
+
}
|
|
338
|
+
interface UpdateAccountDeliveryOptionDTO {
|
|
339
|
+
accountBranchId: string;
|
|
340
|
+
name?: string;
|
|
341
|
+
accountIntegrationId?: string | null;
|
|
342
|
+
isScheduled?: boolean;
|
|
343
|
+
priceLogic?: AccountDeliveryOptionPriceLogic;
|
|
344
|
+
status?: AccountDeliveryOptionStatus;
|
|
345
|
+
deliveryType?: DeliveryType;
|
|
346
|
+
deliveryZones?: DeliveryZoneInput[];
|
|
347
|
+
data?: Record<string, unknown>;
|
|
348
|
+
}
|
|
262
349
|
|
|
263
350
|
/**
|
|
264
351
|
* Entidad AccountBranch
|
|
@@ -334,38 +421,6 @@ declare enum AccountDomainStatus {
|
|
|
334
421
|
INACTIVE = "INACTIVE"
|
|
335
422
|
}
|
|
336
423
|
|
|
337
|
-
interface StatusInfo {
|
|
338
|
-
text: string;
|
|
339
|
-
class: string;
|
|
340
|
-
actionText?: string;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
declare enum AccountPaymentMethodStatus {
|
|
344
|
-
ACTIVE = "ACTIVE",// Active
|
|
345
|
-
INACTIVE = "INACTIVE"
|
|
346
|
-
}
|
|
347
|
-
interface AccountPaymentMethod {
|
|
348
|
-
id: string;
|
|
349
|
-
accountId: string;
|
|
350
|
-
accountIntegrationId?: string;
|
|
351
|
-
name: string;
|
|
352
|
-
description?: string;
|
|
353
|
-
customerInstructions?: string;
|
|
354
|
-
order: number;
|
|
355
|
-
availableForWeb?: boolean;
|
|
356
|
-
status: AccountPaymentMethodStatus;
|
|
357
|
-
demo: boolean;
|
|
358
|
-
createdAt: Date;
|
|
359
|
-
updatedAt: Date;
|
|
360
|
-
deletedAt?: Date;
|
|
361
|
-
accountIntegration?: AccountIntegration;
|
|
362
|
-
account?: Account;
|
|
363
|
-
statusInfo?: StatusInfo;
|
|
364
|
-
typeName?: string;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
declare function getAccountPaymentMethodStatusInfo(status: AccountPaymentMethodStatus): StatusInfo;
|
|
368
|
-
|
|
369
424
|
/**
|
|
370
425
|
* Entidad Customer
|
|
371
426
|
* Cliente de la tienda
|
|
@@ -402,6 +457,12 @@ interface CustomerUpsertDto {
|
|
|
402
457
|
phone?: Phone;
|
|
403
458
|
}
|
|
404
459
|
|
|
460
|
+
interface StatusInfo {
|
|
461
|
+
text: string;
|
|
462
|
+
class: string;
|
|
463
|
+
actionText?: string;
|
|
464
|
+
}
|
|
465
|
+
|
|
405
466
|
/**
|
|
406
467
|
* Entidad StandardCategory
|
|
407
468
|
* Define las categorías estándar de productos.
|
|
@@ -539,40 +600,40 @@ declare function getProductStatusInfo(status: ProductStatus): StatusInfo;
|
|
|
539
600
|
type FulfillmentItem = {
|
|
540
601
|
id: string;
|
|
541
602
|
fulfillmentId: string;
|
|
542
|
-
orderItemId: string;
|
|
543
603
|
quantity: number;
|
|
544
604
|
};
|
|
545
605
|
|
|
546
606
|
type CreateFulfillmentItemDto = {
|
|
607
|
+
quantity: number;
|
|
547
608
|
orderItemId: string;
|
|
548
|
-
quantity: string;
|
|
549
609
|
};
|
|
550
610
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
CANCELLED = "cancelled"
|
|
557
|
-
}
|
|
558
|
-
type Fulfillment = {
|
|
611
|
+
/**
|
|
612
|
+
* FulfillmentLabel Entity
|
|
613
|
+
* Represents shipping labels and tracking information returned by fulfillment providers
|
|
614
|
+
*/
|
|
615
|
+
interface FulfillmentLabel {
|
|
559
616
|
id: string;
|
|
617
|
+
fulfillmentId: string;
|
|
618
|
+
trackingNumber: string;
|
|
619
|
+
trackingUrl?: string;
|
|
620
|
+
labelUrl?: string;
|
|
560
621
|
accountId: string;
|
|
561
|
-
orderId: string;
|
|
562
|
-
accountBranchId: string;
|
|
563
|
-
carrier: string;
|
|
564
|
-
trackingNumber: string | null;
|
|
565
|
-
items: FulfillmentItem[];
|
|
566
|
-
status: FulfillmentStatus;
|
|
567
|
-
data: Record<string, unknown> | null;
|
|
568
|
-
packedAt: Date | null;
|
|
569
|
-
shippedAt: Date | null;
|
|
570
|
-
deliveredAt: Date | null;
|
|
571
|
-
cancelledAt: Date | null;
|
|
572
622
|
createdAt: Date;
|
|
573
623
|
updatedAt: Date;
|
|
574
624
|
deletedAt?: Date;
|
|
575
|
-
}
|
|
625
|
+
}
|
|
626
|
+
interface FulfillmentLabelCreateData {
|
|
627
|
+
fulfillmentId: string;
|
|
628
|
+
trackingNumber: string;
|
|
629
|
+
trackingUrl?: string;
|
|
630
|
+
labelUrl?: string;
|
|
631
|
+
}
|
|
632
|
+
interface FulfillmentLabelUpdateData {
|
|
633
|
+
trackingNumber?: string;
|
|
634
|
+
trackingUrl?: string;
|
|
635
|
+
labelUrl?: string;
|
|
636
|
+
}
|
|
576
637
|
|
|
577
638
|
declare enum PaymentStatus {
|
|
578
639
|
PENDING = "PENDING",// Pendiente
|
|
@@ -601,7 +662,6 @@ interface Payment {
|
|
|
601
662
|
accountId: string;
|
|
602
663
|
orderId: string;
|
|
603
664
|
invoiceId?: string;
|
|
604
|
-
accountPaymentMethodId?: string;
|
|
605
665
|
accountIntegrationId?: string;
|
|
606
666
|
referenceCode?: string;
|
|
607
667
|
paymentMethodType?: PaymentMethodType;
|
|
@@ -623,7 +683,7 @@ interface Payment {
|
|
|
623
683
|
createdAt: string | Date;
|
|
624
684
|
updatedAt: string | Date;
|
|
625
685
|
deletedAt?: string | Date;
|
|
626
|
-
|
|
686
|
+
accountIntegration?: AccountIntegration;
|
|
627
687
|
order?: Order;
|
|
628
688
|
}
|
|
629
689
|
type PaymentProviderKey = 'MERCADOPAGO' | 'MANUAL';
|
|
@@ -698,6 +758,158 @@ interface PaymentProviderAdapter {
|
|
|
698
758
|
|
|
699
759
|
declare function getPaymentStatusInfo(status: PaymentStatus): StatusInfo;
|
|
700
760
|
|
|
761
|
+
declare enum FulfillmentStatus {
|
|
762
|
+
PENDING = "pending",
|
|
763
|
+
SHIPPED = "shipped",
|
|
764
|
+
DELIVERED = "delivered",
|
|
765
|
+
CANCELLED = "cancelled"
|
|
766
|
+
}
|
|
767
|
+
type Fulfillment = {
|
|
768
|
+
id: string;
|
|
769
|
+
code: string;
|
|
770
|
+
accountId: string;
|
|
771
|
+
orderId: string;
|
|
772
|
+
accountBranchId: string;
|
|
773
|
+
deliveryOptionId: string;
|
|
774
|
+
items: FulfillmentItem[];
|
|
775
|
+
labels: FulfillmentLabel[];
|
|
776
|
+
status: FulfillmentStatus;
|
|
777
|
+
data: Record<string, unknown> | null;
|
|
778
|
+
shippedAt: Date | null;
|
|
779
|
+
deliveredAt: Date | null;
|
|
780
|
+
cancelledAt: Date | null;
|
|
781
|
+
createdAt: Date;
|
|
782
|
+
updatedAt: Date;
|
|
783
|
+
deletedAt?: Date;
|
|
784
|
+
};
|
|
785
|
+
type FulfillmentDeliveryOption = {
|
|
786
|
+
id: string;
|
|
787
|
+
name: string;
|
|
788
|
+
pickupLocations?: PickupLocation[];
|
|
789
|
+
[key: string]: unknown;
|
|
790
|
+
};
|
|
791
|
+
interface PickupLocation {
|
|
792
|
+
id: string;
|
|
793
|
+
name: string;
|
|
794
|
+
address: {
|
|
795
|
+
street: string;
|
|
796
|
+
city: string;
|
|
797
|
+
state: string;
|
|
798
|
+
postalCode?: string;
|
|
799
|
+
};
|
|
800
|
+
coordinates?: {
|
|
801
|
+
latitude: number;
|
|
802
|
+
longitude: number;
|
|
803
|
+
};
|
|
804
|
+
hours?: string;
|
|
805
|
+
phone?: string;
|
|
806
|
+
additionalInfo?: Record<string, unknown>;
|
|
807
|
+
}
|
|
808
|
+
type FulfillmentRecollectionMode = 'RECOLLECTION' | 'DROP_OFF';
|
|
809
|
+
type FulfillmentRecollectionSchedule = {
|
|
810
|
+
dayOfWeek: number;
|
|
811
|
+
startHour: number;
|
|
812
|
+
endHour: number;
|
|
813
|
+
intervalMinutes?: number;
|
|
814
|
+
};
|
|
815
|
+
type FulfillmentRecollectionCapabilities = {
|
|
816
|
+
supportsRecollection: boolean;
|
|
817
|
+
supportsDropOff: boolean;
|
|
818
|
+
allowsScheduling: boolean;
|
|
819
|
+
recollectionSchedule?: FulfillmentRecollectionSchedule[];
|
|
820
|
+
leadTimeHours: number;
|
|
821
|
+
maxAdvanceDays: number;
|
|
822
|
+
dropOffLocationsUrl?: string;
|
|
823
|
+
};
|
|
824
|
+
type FulfillmentRecollectionConfig = {
|
|
825
|
+
mode: FulfillmentRecollectionMode;
|
|
826
|
+
scheduledDateTime?: Date;
|
|
827
|
+
recollectionAddress?: {
|
|
828
|
+
street: string;
|
|
829
|
+
city: string;
|
|
830
|
+
state: string;
|
|
831
|
+
};
|
|
832
|
+
contactInfo?: {
|
|
833
|
+
name: string;
|
|
834
|
+
phone: string;
|
|
835
|
+
email?: string;
|
|
836
|
+
};
|
|
837
|
+
specialInstructions?: string;
|
|
838
|
+
};
|
|
839
|
+
type FulfillmentProviderCreateInput = {
|
|
840
|
+
data: Record<string, unknown>;
|
|
841
|
+
items: FulfillmentItem[];
|
|
842
|
+
order: Order;
|
|
843
|
+
fulfillment: Fulfillment;
|
|
844
|
+
recollectionConfig?: FulfillmentRecollectionConfig;
|
|
845
|
+
};
|
|
846
|
+
type FulfillmentProviderCreateOutput = {
|
|
847
|
+
data?: Record<string, unknown>;
|
|
848
|
+
labels: {
|
|
849
|
+
trackingNumber: string;
|
|
850
|
+
trackingUrl?: string;
|
|
851
|
+
label?: {
|
|
852
|
+
url?: string;
|
|
853
|
+
base64?: string;
|
|
854
|
+
format?: 'pdf' | 'png' | 'zpl';
|
|
855
|
+
};
|
|
856
|
+
}[];
|
|
857
|
+
};
|
|
858
|
+
type FulfillmentProviderProcessWebhookInput = WebhookPayload & {
|
|
859
|
+
fulfillmentService: any;
|
|
860
|
+
};
|
|
861
|
+
type FulfillmentProviderProcessWebhookOutput = {
|
|
862
|
+
fulfillmentId: string;
|
|
863
|
+
fulfillmentStatus: FulfillmentStatus;
|
|
864
|
+
data: Record<string, any>;
|
|
865
|
+
};
|
|
866
|
+
type FulfillmentProviderKey = 'MANUAL' | 'DAC';
|
|
867
|
+
type FulfillmentProviderContext = {
|
|
868
|
+
data: Record<string, any>;
|
|
869
|
+
};
|
|
870
|
+
interface FulfillmentProviderAdapter {
|
|
871
|
+
readonly key: FulfillmentProviderKey;
|
|
872
|
+
listDeliveryOptions(): Promise<FulfillmentDeliveryOption[]>;
|
|
873
|
+
canCalculate(data: Record<string, unknown>): Promise<boolean>;
|
|
874
|
+
getRecollectionCapabilities(): Promise<FulfillmentRecollectionCapabilities>;
|
|
875
|
+
createFulfillment(input: FulfillmentProviderCreateInput): Promise<FulfillmentProviderCreateOutput>;
|
|
876
|
+
processWebhook(input: FulfillmentProviderProcessWebhookInput): Promise<FulfillmentProviderProcessWebhookOutput | null>;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* OrderDeliveryMethod Entity
|
|
881
|
+
* Represents a snapshot of the selected delivery option for an order
|
|
882
|
+
*/
|
|
883
|
+
|
|
884
|
+
interface OrderDeliveryMethod {
|
|
885
|
+
id: string;
|
|
886
|
+
orderId: string;
|
|
887
|
+
deliveryOptionId: string;
|
|
888
|
+
name: string;
|
|
889
|
+
description?: string;
|
|
890
|
+
amount: number;
|
|
891
|
+
data?: Record<string, any>;
|
|
892
|
+
accountId: string;
|
|
893
|
+
createdAt: Date;
|
|
894
|
+
updatedAt: Date;
|
|
895
|
+
deletedAt?: Date;
|
|
896
|
+
deliveryOption?: AccountDeliveryOption;
|
|
897
|
+
}
|
|
898
|
+
interface OrderDeliveryMethodCreateData {
|
|
899
|
+
orderId: string;
|
|
900
|
+
deliveryOptionId: string;
|
|
901
|
+
name: string;
|
|
902
|
+
description?: string;
|
|
903
|
+
amount: number;
|
|
904
|
+
data?: Record<string, any>;
|
|
905
|
+
}
|
|
906
|
+
interface OrderDeliveryMethodUpdateData {
|
|
907
|
+
name?: string;
|
|
908
|
+
description?: string;
|
|
909
|
+
amount?: number;
|
|
910
|
+
data?: Record<string, any>;
|
|
911
|
+
}
|
|
912
|
+
|
|
701
913
|
/**
|
|
702
914
|
* Entidad Order
|
|
703
915
|
* Define la orden de compra de un cliente en el sitio web.
|
|
@@ -713,9 +925,7 @@ interface Order {
|
|
|
713
925
|
deliveryLastName?: string;
|
|
714
926
|
deliveryAddress?: any;
|
|
715
927
|
deliveryPhone?: any;
|
|
716
|
-
deliveryOptionId?: string;
|
|
717
928
|
pickupBranchId?: string;
|
|
718
|
-
accountPaymentMethodId?: string;
|
|
719
929
|
paymentMethodIntegrationId?: string;
|
|
720
930
|
billingInformation?: any;
|
|
721
931
|
currency: Currency;
|
|
@@ -747,7 +957,9 @@ interface Order {
|
|
|
747
957
|
customer?: Customer | null;
|
|
748
958
|
paymentMethodIntegration?: AccountIntegration | null;
|
|
749
959
|
accountDomain?: AccountDomain;
|
|
750
|
-
|
|
960
|
+
deliveryMethod?: OrderDeliveryMethod | null;
|
|
961
|
+
account?: Account;
|
|
962
|
+
payments?: Payment[];
|
|
751
963
|
statusFlow?: StatusFlow[];
|
|
752
964
|
statusChangeAllowed?: OrderStatus[];
|
|
753
965
|
}
|
|
@@ -883,7 +1095,6 @@ interface CartUpdateDto {
|
|
|
883
1095
|
};
|
|
884
1096
|
delivery: {
|
|
885
1097
|
type: 'SHIPPING' | 'PICKUP';
|
|
886
|
-
deliveryOptionId?: string;
|
|
887
1098
|
pickupBranchId?: string;
|
|
888
1099
|
firstname: string;
|
|
889
1100
|
lastname: string;
|
|
@@ -944,6 +1155,63 @@ declare enum CartItemErrorCode {
|
|
|
944
1155
|
VALIDATION_ERROR = "VALIDATION_ERROR"
|
|
945
1156
|
}
|
|
946
1157
|
|
|
1158
|
+
/**
|
|
1159
|
+
* CartDeliveryMethod Entity
|
|
1160
|
+
* Represents a snapshot of the selected delivery option for a cart
|
|
1161
|
+
*/
|
|
1162
|
+
interface CartDeliveryMethod {
|
|
1163
|
+
id: string;
|
|
1164
|
+
cartId: string;
|
|
1165
|
+
deliveryOptionId: string;
|
|
1166
|
+
name: string;
|
|
1167
|
+
description?: string;
|
|
1168
|
+
amount: number;
|
|
1169
|
+
data?: Record<string, any>;
|
|
1170
|
+
accountId: string;
|
|
1171
|
+
createdAt: Date;
|
|
1172
|
+
updatedAt: Date;
|
|
1173
|
+
deletedAt?: Date;
|
|
1174
|
+
}
|
|
1175
|
+
interface CartDeliveryMethodCreateData {
|
|
1176
|
+
cartId: string;
|
|
1177
|
+
deliveryOptionId: string;
|
|
1178
|
+
name: string;
|
|
1179
|
+
description?: string;
|
|
1180
|
+
amount: number;
|
|
1181
|
+
data?: Record<string, any>;
|
|
1182
|
+
}
|
|
1183
|
+
interface CartDeliveryMethodUpdateData {
|
|
1184
|
+
name?: string;
|
|
1185
|
+
description?: string;
|
|
1186
|
+
amount?: number;
|
|
1187
|
+
data?: Record<string, any>;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* DTOs for CartDeliveryMethod operations
|
|
1192
|
+
*/
|
|
1193
|
+
interface CartDeliveryMethodCreateDto {
|
|
1194
|
+
cartId: string;
|
|
1195
|
+
deliveryOptionId: string;
|
|
1196
|
+
data?: Record<string, any>;
|
|
1197
|
+
}
|
|
1198
|
+
interface CartDeliveryMethodUpdateDto {
|
|
1199
|
+
deliveryOptionId?: string;
|
|
1200
|
+
name?: string;
|
|
1201
|
+
description?: string;
|
|
1202
|
+
amount?: number;
|
|
1203
|
+
data?: Record<string, any>;
|
|
1204
|
+
}
|
|
1205
|
+
interface CartDeliveryMethodFindParams {
|
|
1206
|
+
cartId: string;
|
|
1207
|
+
accountId: string;
|
|
1208
|
+
}
|
|
1209
|
+
interface CartDeliveryMethodResponse {
|
|
1210
|
+
success: boolean;
|
|
1211
|
+
item?: CartDeliveryMethod | null;
|
|
1212
|
+
error?: string;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
947
1215
|
/**
|
|
948
1216
|
* Entidad Cart
|
|
949
1217
|
* Define el carrito de compras de un cliente en el sitio web.
|
|
@@ -957,13 +1225,11 @@ interface Cart {
|
|
|
957
1225
|
currency: string;
|
|
958
1226
|
subtotal: number;
|
|
959
1227
|
total: number;
|
|
960
|
-
accountPaymentMethodId?: string;
|
|
961
1228
|
deliveryType: CartDeliveryType;
|
|
962
1229
|
deliveryFirstName?: string;
|
|
963
1230
|
deliveryLastName?: string;
|
|
964
1231
|
deliveryAddress?: string;
|
|
965
1232
|
deliveryPhone?: string;
|
|
966
|
-
deliveryOptionId?: string;
|
|
967
1233
|
pickupBranchId?: string;
|
|
968
1234
|
itemCount: number;
|
|
969
1235
|
createdAt: Date;
|
|
@@ -983,7 +1249,7 @@ interface Cart {
|
|
|
983
1249
|
taxDetails?: any;
|
|
984
1250
|
customer?: Partial<Customer> | null;
|
|
985
1251
|
accountDomain?: Partial<AccountDomain> | null;
|
|
986
|
-
|
|
1252
|
+
deliveryMethod?: CartDeliveryMethod | null;
|
|
987
1253
|
}
|
|
988
1254
|
interface CartItem {
|
|
989
1255
|
id: string;
|
|
@@ -1257,9 +1523,26 @@ type CreateFulfillmentDto = {
|
|
|
1257
1523
|
accountId: string;
|
|
1258
1524
|
orderId: string;
|
|
1259
1525
|
accountBranchId: string;
|
|
1260
|
-
|
|
1526
|
+
deliveryOptionId: string;
|
|
1261
1527
|
items: CreateFulfillmentItemDto[];
|
|
1262
1528
|
data?: Record<string, unknown>;
|
|
1529
|
+
recollectionConfig?: FulfillmentRecollectionConfig;
|
|
1530
|
+
};
|
|
1531
|
+
type UpdateFulfillmentDto = {
|
|
1532
|
+
status?: FulfillmentStatus;
|
|
1533
|
+
data?: Record<string, unknown>;
|
|
1534
|
+
shippedAt?: Date;
|
|
1535
|
+
deliveredAt?: Date;
|
|
1536
|
+
};
|
|
1537
|
+
type CreateDeliveryOptionDto = {
|
|
1538
|
+
accountId: string;
|
|
1539
|
+
accountBranchId: string;
|
|
1540
|
+
name: string;
|
|
1541
|
+
integrationId?: string | null;
|
|
1542
|
+
isScheduled?: boolean;
|
|
1543
|
+
priceLogic?: 'FIXED' | 'PER_KM';
|
|
1544
|
+
price?: number;
|
|
1545
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
1263
1546
|
};
|
|
1264
1547
|
|
|
1265
1548
|
declare function getFulfillmentStatusInfo(status: FulfillmentStatus): StatusInfo;
|
|
@@ -1362,4 +1645,23 @@ interface StoreCustomizationSeo {
|
|
|
1362
1645
|
favicon?: Media | null;
|
|
1363
1646
|
}
|
|
1364
1647
|
|
|
1365
|
-
|
|
1648
|
+
/**
|
|
1649
|
+
* IntegrationDeliveryZone types
|
|
1650
|
+
* Define las zonas de entrega permitidas para cada integración de fulfillment provider.
|
|
1651
|
+
*/
|
|
1652
|
+
interface IntegrationDeliveryZone {
|
|
1653
|
+
id: string;
|
|
1654
|
+
integrationId: string;
|
|
1655
|
+
geoZoneId: string;
|
|
1656
|
+
createdAt: Date;
|
|
1657
|
+
updatedAt: Date;
|
|
1658
|
+
deletedAt?: Date | null;
|
|
1659
|
+
integration?: Integration;
|
|
1660
|
+
geoZone?: GeoZone;
|
|
1661
|
+
}
|
|
1662
|
+
declare enum IntegrationDeliveryZoneStatus {
|
|
1663
|
+
ACTIVE = "ACTIVE",
|
|
1664
|
+
INACTIVE = "INACTIVE"
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
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, type CartDeliveryMethod, type CartDeliveryMethodCreateData, type CartDeliveryMethodCreateDto, type CartDeliveryMethodFindParams, type CartDeliveryMethodResponse, type CartDeliveryMethodUpdateData, type CartDeliveryMethodUpdateDto, CartDeliveryType, type CartItem, type CartItemAddDto, type CartItemAttributeDetail, CartItemErrorCode, type CartItemRemoveDto, type CartItemUpdateDto, type CartItemValidation, CartSource, CartStatus, type CartUpdateDto, type CreateAccountDeliveryOptionDTO, type CreateDeliveryOptionDto, type CreateFulfillmentDto, type CreateFulfillmentItemDto, Currency, type Customer, CustomerStatus, type CustomerUpsertDto, DeliveryType, type DeliveryZoneInput, type Fulfillment, type FulfillmentDeliveryOption, type FulfillmentItem, type FulfillmentLabel, type FulfillmentLabelCreateData, type FulfillmentLabelUpdateData, type FulfillmentProviderAdapter, type FulfillmentProviderContext, type FulfillmentProviderCreateInput, type FulfillmentProviderCreateOutput, type FulfillmentProviderKey, type FulfillmentProviderProcessWebhookInput, type FulfillmentProviderProcessWebhookOutput, type FulfillmentRecollectionCapabilities, type FulfillmentRecollectionConfig, type FulfillmentRecollectionMode, type FulfillmentRecollectionSchedule, FulfillmentStatus, type GeoZone, type GeoZoneInput, GeoZoneStatus, type Integration, IntegrationCategory, type IntegrationDeliveryZone, IntegrationDeliveryZoneStatus, IntegrationStatus, type MapPosition, type Media, MediaType, type NextStatusAction, type Order, type OrderCreateFromCartDto, type OrderDeliveryMethod, type OrderDeliveryMethodCreateData, type OrderDeliveryMethodUpdateData, 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 PickupLocation, 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 UpdateAccountDeliveryOptionDTO, type UpdateFulfillmentDto, type Webhook, type WebhookPayload, getCurrencySymbol, getFulfillmentStatusInfo, getIntegrationCategoryName, getOrderStatusInfo, getPaymentCardBrand, getPaymentStatusInfo, getProductStatusInfo, parsePriceFormatPattern };
|