@artisan-commerce/types 0.14.0-canary.51 → 0.14.0-canary.55
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/bundle.d.ts +677 -304
- package/package.json +2 -2
package/dist/bundle.d.ts
CHANGED
|
@@ -280,39 +280,22 @@ interface Account<T extends AdditionalInfo = AdditionalInfo> {
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
/**
|
|
283
|
-
* Representation of a Commerce
|
|
283
|
+
* Representation of a Commerce Catalogue.
|
|
284
284
|
*
|
|
285
|
-
* @interface
|
|
285
|
+
* @interface Catalogue
|
|
286
286
|
* @since 0.1.0
|
|
287
287
|
*/
|
|
288
|
-
interface
|
|
289
|
-
/**
|
|
290
|
-
|
|
291
|
-
/**
|
|
288
|
+
interface Catalogue<T extends AdditionalInfo = AdditionalInfo> {
|
|
289
|
+
/** Catalogue's id */
|
|
290
|
+
catalogueId: string;
|
|
291
|
+
/** Catalogue's name */
|
|
292
292
|
name: string;
|
|
293
|
-
/**
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
reload: boolean;
|
|
299
|
-
/** Whether or not the category has subcategories */
|
|
300
|
-
subcategories: boolean;
|
|
301
|
-
/** Category additional info */
|
|
293
|
+
/** Whether or not the catalogue is active */
|
|
294
|
+
active: boolean;
|
|
295
|
+
/** Catalogue's friendly name to use on front end */
|
|
296
|
+
friendlyName?: string;
|
|
297
|
+
/** Catalogue additional info */
|
|
302
298
|
additionalInfo?: T;
|
|
303
|
-
/** Whether or not the category is featured */
|
|
304
|
-
featured: boolean;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Representation of a category which contains several base products.
|
|
308
|
-
*
|
|
309
|
-
* @interface CategoryWithProducts
|
|
310
|
-
* @since 0.1.0
|
|
311
|
-
* @extends {{@link Category}
|
|
312
|
-
*/
|
|
313
|
-
interface CategoryWithProducts extends Category {
|
|
314
|
-
/** Array of base products associated with a category, see {@link BaseProduct} */
|
|
315
|
-
products: BaseProduct[];
|
|
316
299
|
}
|
|
317
300
|
|
|
318
301
|
/**
|
|
@@ -340,25 +323,6 @@ interface Vendor<T extends AdditionalInfo = AdditionalInfo> {
|
|
|
340
323
|
additionalInfo?: T;
|
|
341
324
|
}
|
|
342
325
|
|
|
343
|
-
/**
|
|
344
|
-
* Representation of a Commerce Catalogue.
|
|
345
|
-
*
|
|
346
|
-
* @interface Catalogue
|
|
347
|
-
* @since 0.1.0
|
|
348
|
-
*/
|
|
349
|
-
interface Catalogue<T extends AdditionalInfo = AdditionalInfo> {
|
|
350
|
-
/** Catalogue's id */
|
|
351
|
-
catalogueId: string;
|
|
352
|
-
/** Catalogue's name */
|
|
353
|
-
name: string;
|
|
354
|
-
/** Whether or not the catalogue is active */
|
|
355
|
-
active: boolean;
|
|
356
|
-
/** Catalogue's friendly name to use on front end */
|
|
357
|
-
friendlyName?: string;
|
|
358
|
-
/** Catalogue additional info */
|
|
359
|
-
additionalInfo?: T;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
326
|
/**
|
|
363
327
|
* Representation of a Commerce Store.
|
|
364
328
|
*
|
|
@@ -553,289 +517,116 @@ interface StorePolygons {
|
|
|
553
517
|
}
|
|
554
518
|
|
|
555
519
|
/**
|
|
556
|
-
* Representation of a Commerce
|
|
520
|
+
* Representation of a Commerce Category.
|
|
557
521
|
*
|
|
558
|
-
* @interface
|
|
522
|
+
* @interface Category
|
|
559
523
|
* @since 0.1.0
|
|
560
524
|
*/
|
|
561
|
-
interface
|
|
562
|
-
/**
|
|
563
|
-
|
|
564
|
-
/**
|
|
525
|
+
interface Category<T extends AdditionalInfo = AdditionalInfo> {
|
|
526
|
+
/** Category's id */
|
|
527
|
+
categoryId: string;
|
|
528
|
+
/** Category's name */
|
|
565
529
|
name: string;
|
|
566
|
-
/**
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
netPrice: number;
|
|
576
|
-
/** Shipping cost's subtotal without taxes */
|
|
577
|
-
subtotalBeforeTaxes: number;
|
|
578
|
-
/** Shipping cost's tax total */
|
|
579
|
-
taxTotal: number;
|
|
580
|
-
/** Shipping cost's discount */
|
|
581
|
-
discounts: any[];
|
|
582
|
-
/** Shipping cost's discount total amount */
|
|
583
|
-
discountTotal: number;
|
|
584
|
-
/** Shipping cost's total */
|
|
585
|
-
total: number;
|
|
586
|
-
/** Shipping cost additional info */
|
|
530
|
+
/** Category image's array, see {@link CDNImage} */
|
|
531
|
+
images: CDNImage[];
|
|
532
|
+
/** Whether or not to display the category */
|
|
533
|
+
displayInMenu: boolean;
|
|
534
|
+
/** Whether or not the category should be reloaded */
|
|
535
|
+
reload: boolean;
|
|
536
|
+
/** Whether or not the category has subcategories */
|
|
537
|
+
subcategories: boolean;
|
|
538
|
+
/** Category additional info */
|
|
587
539
|
additionalInfo?: T;
|
|
588
|
-
/**
|
|
589
|
-
|
|
540
|
+
/** Whether or not the category is featured */
|
|
541
|
+
featured: boolean;
|
|
590
542
|
}
|
|
591
543
|
/**
|
|
592
|
-
* Representation of a
|
|
544
|
+
* Representation of a category which contains several base products.
|
|
593
545
|
*
|
|
594
|
-
* @interface
|
|
546
|
+
* @interface CategoryWithProducts
|
|
595
547
|
* @since 0.1.0
|
|
548
|
+
* @extends {{@link Category}
|
|
596
549
|
*/
|
|
597
|
-
interface
|
|
598
|
-
/**
|
|
599
|
-
|
|
600
|
-
/** Tax name */
|
|
601
|
-
name: string;
|
|
602
|
-
/** Value added tax rate code */
|
|
603
|
-
vatRateCode: number;
|
|
604
|
-
/** Tax code */
|
|
605
|
-
code: number;
|
|
606
|
-
/** Value added tax rate */
|
|
607
|
-
vatRate: string;
|
|
608
|
-
/** Tax base value */
|
|
609
|
-
taxBase: number;
|
|
610
|
-
/** Tax value */
|
|
611
|
-
value: string;
|
|
550
|
+
interface CategoryWithProducts extends Category {
|
|
551
|
+
/** Array of base products associated with a category, see {@link BaseProduct} */
|
|
552
|
+
products: BaseProduct[];
|
|
612
553
|
}
|
|
613
554
|
|
|
614
555
|
/**
|
|
615
|
-
* Representation of a Commerce
|
|
556
|
+
* Representation of a Commerce Product.
|
|
616
557
|
*
|
|
617
|
-
* @
|
|
618
|
-
* @template T
|
|
619
|
-
* @template U
|
|
620
|
-
* @template V Categories additional info
|
|
621
|
-
* @template W Store additional info
|
|
622
|
-
* @template X Vendor additional info
|
|
623
|
-
* @template Y Catalogues additional info
|
|
624
|
-
* @template Z Shipping cost additional info
|
|
558
|
+
* @typedef Product
|
|
559
|
+
* @template T Product additional info
|
|
560
|
+
* @template U Categories additional info
|
|
625
561
|
* @since 0.1.0
|
|
626
562
|
*/
|
|
627
|
-
|
|
628
|
-
/** Shopping cart unique identifier */
|
|
629
|
-
id: string;
|
|
630
|
-
/** Shopping cart name */
|
|
631
|
-
name: string;
|
|
632
|
-
/** Shopping cart latitude */
|
|
633
|
-
latitude: number;
|
|
634
|
-
/** Shopping cart longitude */
|
|
635
|
-
longitude: number;
|
|
636
|
-
/** Shopping cart price category, see {@link PriceCategoryType}*/
|
|
637
|
-
priceCategory?: PriceCategoryType;
|
|
638
|
-
/** Shopping cart creation date */
|
|
639
|
-
createdAt: string;
|
|
640
|
-
/** Shopping cart update date */
|
|
641
|
-
updatedAt: string;
|
|
642
|
-
/** Shopping cart channel unique identifier */
|
|
643
|
-
channelId: string;
|
|
644
|
-
/** Shopping cart stores, see Objectify<{@link CartStore}> */
|
|
645
|
-
stores: Objectify<CartStore<W, U, V, X, Y>>;
|
|
646
|
-
/** Shopping cart shipping cost */
|
|
647
|
-
shippingCost: ShippingCost<Z> | null;
|
|
648
|
-
/** Shopping cart additional info */
|
|
649
|
-
additional_info?: T;
|
|
650
|
-
/** Shopping cart bill total */
|
|
651
|
-
billTotal: BillTotal;
|
|
652
|
-
/** Shopping cart applied benefits */
|
|
653
|
-
benefits?: ShoppingCartBenefits;
|
|
654
|
-
/** Shopping cart user wallet id */
|
|
655
|
-
benefitsHash?: string;
|
|
656
|
-
/**
|
|
657
|
-
* Shopping cart pick up time, must be in UTC and
|
|
658
|
-
* `YYYY-MM-DD HH:mm:ss` format
|
|
659
|
-
*/
|
|
660
|
-
pickUpTime?: string;
|
|
661
|
-
}
|
|
563
|
+
type Product<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo> = BaseProduct<T> | ProductDetails<T, U> | CartProduct<T, U>;
|
|
662
564
|
/**
|
|
663
|
-
*
|
|
565
|
+
* Base product attributes.
|
|
664
566
|
*
|
|
665
|
-
* @interface
|
|
567
|
+
* @interface BaseProduct
|
|
666
568
|
* @since 0.1.0
|
|
667
569
|
*/
|
|
668
|
-
interface
|
|
669
|
-
/**
|
|
670
|
-
|
|
671
|
-
/**
|
|
672
|
-
|
|
673
|
-
/**
|
|
674
|
-
|
|
570
|
+
interface BaseProduct<T extends AdditionalInfo = AdditionalInfo> {
|
|
571
|
+
/** Product unique identifier */
|
|
572
|
+
productId: string;
|
|
573
|
+
/** The name of the product */
|
|
574
|
+
name: string;
|
|
575
|
+
/** The description of the product */
|
|
576
|
+
description: string;
|
|
577
|
+
/** The type of the product, see {@link ProductType} */
|
|
578
|
+
type: ProductType;
|
|
579
|
+
/** The cover url of the product */
|
|
580
|
+
coverUrl: string;
|
|
581
|
+
/** Product prices, see {@link ProductPrices} */
|
|
582
|
+
prices: ProductPrices;
|
|
583
|
+
/** Indicates if a product can be added directly to cart */
|
|
584
|
+
addDirectlyToCart: boolean;
|
|
585
|
+
/** Indicates if a product is out of service */
|
|
586
|
+
outOfService: boolean;
|
|
587
|
+
/** Indicates if a product is out of stock */
|
|
588
|
+
outOfStock: boolean;
|
|
589
|
+
/** The stock of the product */
|
|
590
|
+
stock: number;
|
|
591
|
+
/** The measure of the product */
|
|
592
|
+
measure: string;
|
|
593
|
+
/** Product attributes, see {@link ProductAttributes} */
|
|
594
|
+
attributes: ProductAttributes;
|
|
595
|
+
/** The suggested price of the product */
|
|
596
|
+
suggestedPrice: string;
|
|
597
|
+
/** Indicates if a product is available */
|
|
598
|
+
available: boolean;
|
|
599
|
+
/** Array of product images, see {@link CDNImage} */
|
|
600
|
+
images: CDNImage[];
|
|
601
|
+
/** The standard time of the product */
|
|
602
|
+
standardTime: string;
|
|
603
|
+
/** Indicates if a product is sponsored */
|
|
604
|
+
sponsored: boolean;
|
|
605
|
+
/** The status of the product, see {@link ProductStatus} */
|
|
606
|
+
status: ProductStatus;
|
|
607
|
+
/** Product additional info */
|
|
608
|
+
additionalInfo?: T;
|
|
609
|
+
/** Up-sell products related to the base product */
|
|
610
|
+
upSelling?: BaseProduct[];
|
|
675
611
|
}
|
|
676
612
|
/**
|
|
677
|
-
*
|
|
613
|
+
* Product prices attributes.
|
|
678
614
|
*
|
|
679
|
-
* @interface
|
|
680
|
-
* @template T Store additional info
|
|
681
|
-
* @template U Product additional info
|
|
682
|
-
* @template V Categories additional info
|
|
683
|
-
* @template W Vendor additional info
|
|
684
|
-
* @template X Catalogues additional info
|
|
615
|
+
* @interface ProductPrices
|
|
685
616
|
* @since 0.1.0
|
|
686
|
-
* @extends {{@link Store}
|
|
687
617
|
*/
|
|
688
|
-
interface
|
|
689
|
-
/**
|
|
690
|
-
|
|
691
|
-
/**
|
|
692
|
-
|
|
618
|
+
interface ProductPrices {
|
|
619
|
+
/** Normal price category, see {@link PriceCategory} */
|
|
620
|
+
NORMAL: PriceCategory;
|
|
621
|
+
/** Points price category, see {@link PriceCategory} */
|
|
622
|
+
POINTS: PriceCategory;
|
|
623
|
+
/** Suggested price category, see {@link PriceCategory} */
|
|
624
|
+
SUGGESTED: PriceCategory;
|
|
693
625
|
}
|
|
694
626
|
/**
|
|
695
|
-
*
|
|
627
|
+
* Price category attributes.
|
|
696
628
|
*
|
|
697
|
-
* @
|
|
698
|
-
* @since 0.1.0
|
|
699
|
-
*/
|
|
700
|
-
type BillTotal = {
|
|
701
|
-
/** Normal bill total category */
|
|
702
|
-
NORMAL?: BillTotalCategory;
|
|
703
|
-
/** Points bill total category */
|
|
704
|
-
POINTS?: BillTotalCategory;
|
|
705
|
-
};
|
|
706
|
-
/**
|
|
707
|
-
* Representation of a Bill Total Category.
|
|
708
|
-
*
|
|
709
|
-
* @interface BillTotalCategory
|
|
710
|
-
* @since 0.1.0
|
|
711
|
-
*/
|
|
712
|
-
interface BillTotalCategory {
|
|
713
|
-
/** Bill total category subtotal without taxes */
|
|
714
|
-
subtotalBeforeTaxes: number;
|
|
715
|
-
/** Bill total category total taxes */
|
|
716
|
-
taxTotal: number;
|
|
717
|
-
/** Bill total category total */
|
|
718
|
-
total: number;
|
|
719
|
-
/** discounts shopping cart */
|
|
720
|
-
discounts: Discount[];
|
|
721
|
-
/** Taxes shopping cart */
|
|
722
|
-
taxes: PriceCategoryTax[];
|
|
723
|
-
}
|
|
724
|
-
/**
|
|
725
|
-
* Representation of shopping cart discount.
|
|
726
|
-
*
|
|
727
|
-
* @interface Discounts
|
|
728
|
-
* @since 0.1.0
|
|
729
|
-
*/
|
|
730
|
-
interface Discount {
|
|
731
|
-
benefitId: string;
|
|
732
|
-
/** Benefit wallet id */
|
|
733
|
-
benefitWalletId: string;
|
|
734
|
-
/** Discount base value */
|
|
735
|
-
discountBase: number;
|
|
736
|
-
/** Whether or not the coupon has taxes */
|
|
737
|
-
hasTaxes: boolean;
|
|
738
|
-
/** If the coupon discount has been initialized */
|
|
739
|
-
isInitialized: boolean;
|
|
740
|
-
/** The benefit name */
|
|
741
|
-
name: string;
|
|
742
|
-
/** The benefit percentage */
|
|
743
|
-
percentage: number;
|
|
744
|
-
/** The benefit taxes */
|
|
745
|
-
taxValue: number;
|
|
746
|
-
/** The benefit type */
|
|
747
|
-
type: BenefitTypes;
|
|
748
|
-
/** The discount value */
|
|
749
|
-
value: number;
|
|
750
|
-
}
|
|
751
|
-
/**
|
|
752
|
-
* Representation of a Cart Totals.
|
|
753
|
-
*
|
|
754
|
-
* @interface CartTotals
|
|
755
|
-
* @since 0.1.0
|
|
756
|
-
*/
|
|
757
|
-
interface CartTotals {
|
|
758
|
-
/** Cart totals subtotal */
|
|
759
|
-
subtotal: number;
|
|
760
|
-
/** Cart totals shipping cost */
|
|
761
|
-
shippingCost: number;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
/**
|
|
765
|
-
* Representation of a Commerce Product.
|
|
766
|
-
*
|
|
767
|
-
* @typedef Product
|
|
768
|
-
* @template T Product additional info
|
|
769
|
-
* @template U Categories additional info
|
|
770
|
-
* @since 0.1.0
|
|
771
|
-
*/
|
|
772
|
-
type Product<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo> = BaseProduct<T> | ProductDetails<T, U> | CartProduct<T, U>;
|
|
773
|
-
/**
|
|
774
|
-
* Base product attributes.
|
|
775
|
-
*
|
|
776
|
-
* @interface BaseProduct
|
|
777
|
-
* @since 0.1.0
|
|
778
|
-
*/
|
|
779
|
-
interface BaseProduct<T extends AdditionalInfo = AdditionalInfo> {
|
|
780
|
-
/** Product unique identifier */
|
|
781
|
-
productId: string;
|
|
782
|
-
/** The name of the product */
|
|
783
|
-
name: string;
|
|
784
|
-
/** The description of the product */
|
|
785
|
-
description: string;
|
|
786
|
-
/** The type of the product, see {@link ProductType} */
|
|
787
|
-
type: ProductType;
|
|
788
|
-
/** The cover url of the product */
|
|
789
|
-
coverUrl: string;
|
|
790
|
-
/** Product prices, see {@link ProductPrices} */
|
|
791
|
-
prices: ProductPrices;
|
|
792
|
-
/** Indicates if a product can be added directly to cart */
|
|
793
|
-
addDirectlyToCart: boolean;
|
|
794
|
-
/** Indicates if a product is out of service */
|
|
795
|
-
outOfService: boolean;
|
|
796
|
-
/** Indicates if a product is out of stock */
|
|
797
|
-
outOfStock: boolean;
|
|
798
|
-
/** The stock of the product */
|
|
799
|
-
stock: number;
|
|
800
|
-
/** The measure of the product */
|
|
801
|
-
measure: string;
|
|
802
|
-
/** Product attributes, see {@link ProductAttributes} */
|
|
803
|
-
attributes: ProductAttributes;
|
|
804
|
-
/** The suggested price of the product */
|
|
805
|
-
suggestedPrice: string;
|
|
806
|
-
/** Indicates if a product is available */
|
|
807
|
-
available: boolean;
|
|
808
|
-
/** Array of product images, see {@link CDNImage} */
|
|
809
|
-
images: CDNImage[];
|
|
810
|
-
/** The standard time of the product */
|
|
811
|
-
standardTime: string;
|
|
812
|
-
/** Indicates if a product is sponsored */
|
|
813
|
-
sponsored: boolean;
|
|
814
|
-
/** The status of the product, see {@link ProductStatus} */
|
|
815
|
-
status: ProductStatus;
|
|
816
|
-
/** Product additional info */
|
|
817
|
-
additionalInfo?: T;
|
|
818
|
-
/** Up-sell products related to the base product */
|
|
819
|
-
upSelling?: BaseProduct[];
|
|
820
|
-
}
|
|
821
|
-
/**
|
|
822
|
-
* Product prices attributes.
|
|
823
|
-
*
|
|
824
|
-
* @interface ProductPrices
|
|
825
|
-
* @since 0.1.0
|
|
826
|
-
*/
|
|
827
|
-
interface ProductPrices {
|
|
828
|
-
/** Normal price category, see {@link PriceCategory} */
|
|
829
|
-
NORMAL: PriceCategory;
|
|
830
|
-
/** Points price category, see {@link PriceCategory} */
|
|
831
|
-
POINTS: PriceCategory;
|
|
832
|
-
/** Suggested price category, see {@link PriceCategory} */
|
|
833
|
-
SUGGESTED: PriceCategory;
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* Price category attributes.
|
|
837
|
-
*
|
|
838
|
-
* @interface PriceCategory
|
|
629
|
+
* @interface PriceCategory
|
|
839
630
|
* @since 0.1.0
|
|
840
631
|
*/
|
|
841
632
|
interface PriceCategory {
|
|
@@ -1086,6 +877,588 @@ interface CartProduct<T extends AdditionalInfo = AdditionalInfo, U extends Addit
|
|
|
1086
877
|
addedFrom?: string;
|
|
1087
878
|
}
|
|
1088
879
|
|
|
880
|
+
/**
|
|
881
|
+
* Representation of a Commerce Shipping Cost.
|
|
882
|
+
*
|
|
883
|
+
* @interface ShippingCost
|
|
884
|
+
* @since 0.1.0
|
|
885
|
+
*/
|
|
886
|
+
interface ShippingCost<T extends AdditionalInfo = AdditionalInfo> {
|
|
887
|
+
/** Shipping cost product's id */
|
|
888
|
+
productId: string;
|
|
889
|
+
/** Shipping cost's name */
|
|
890
|
+
name: string;
|
|
891
|
+
/** Shipping cost's amount */
|
|
892
|
+
amount: number;
|
|
893
|
+
/** Currency's symbol */
|
|
894
|
+
symbol: string;
|
|
895
|
+
/** Array of shipping cost's taxes, see {@link ShippingCostTax} */
|
|
896
|
+
taxes: ShippingCostTax[];
|
|
897
|
+
/** Shipping cost's price without taxes */
|
|
898
|
+
grossPrice: number;
|
|
899
|
+
/** Shipping cost's price */
|
|
900
|
+
netPrice: number;
|
|
901
|
+
/** Shipping cost's subtotal without taxes */
|
|
902
|
+
subtotalBeforeTaxes: number;
|
|
903
|
+
/** Shipping cost's tax total */
|
|
904
|
+
taxTotal: number;
|
|
905
|
+
/** Shipping cost's discount */
|
|
906
|
+
discounts: any[];
|
|
907
|
+
/** Shipping cost's discount total amount */
|
|
908
|
+
discountTotal: number;
|
|
909
|
+
/** Shipping cost's total */
|
|
910
|
+
total: number;
|
|
911
|
+
/** Shipping cost additional info */
|
|
912
|
+
additionalInfo?: T;
|
|
913
|
+
/** Discount net price */
|
|
914
|
+
discountNetPrice?: number;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Representation of a shipping cost tax.
|
|
918
|
+
*
|
|
919
|
+
* @interface ShippingCostTax
|
|
920
|
+
* @since 0.1.0
|
|
921
|
+
*/
|
|
922
|
+
interface ShippingCostTax {
|
|
923
|
+
/** Tax percentage to be applied */
|
|
924
|
+
percentage: number;
|
|
925
|
+
/** Tax name */
|
|
926
|
+
name: string;
|
|
927
|
+
/** Value added tax rate code */
|
|
928
|
+
vatRateCode: number;
|
|
929
|
+
/** Tax code */
|
|
930
|
+
code: number;
|
|
931
|
+
/** Value added tax rate */
|
|
932
|
+
vatRate: string;
|
|
933
|
+
/** Tax base value */
|
|
934
|
+
taxBase: number;
|
|
935
|
+
/** Tax value */
|
|
936
|
+
value: string;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Representation of a Commerce Shopping Cart.
|
|
941
|
+
*
|
|
942
|
+
* @interface ShoppingCart
|
|
943
|
+
* @template T Shopping cart additional info
|
|
944
|
+
* @template U Product additional info
|
|
945
|
+
* @template V Categories additional info
|
|
946
|
+
* @template W Store additional info
|
|
947
|
+
* @template X Vendor additional info
|
|
948
|
+
* @template Y Catalogues additional info
|
|
949
|
+
* @template Z Shipping cost additional info
|
|
950
|
+
* @since 0.1.0
|
|
951
|
+
*/
|
|
952
|
+
interface ShoppingCart<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo, V extends AdditionalInfo = AdditionalInfo, W extends AdditionalInfo = AdditionalInfo, X extends AdditionalInfo = AdditionalInfo, Y extends AdditionalInfo = AdditionalInfo, Z extends AdditionalInfo = AdditionalInfo> {
|
|
953
|
+
/** Shopping cart unique identifier */
|
|
954
|
+
id: string;
|
|
955
|
+
/** Shopping cart name */
|
|
956
|
+
name: string;
|
|
957
|
+
/** Shopping cart latitude */
|
|
958
|
+
latitude: number;
|
|
959
|
+
/** Shopping cart longitude */
|
|
960
|
+
longitude: number;
|
|
961
|
+
/** Shopping cart price category, see {@link PriceCategoryType}*/
|
|
962
|
+
priceCategory?: PriceCategoryType;
|
|
963
|
+
/** Shopping cart creation date */
|
|
964
|
+
createdAt: string;
|
|
965
|
+
/** Shopping cart update date */
|
|
966
|
+
updatedAt: string;
|
|
967
|
+
/** Shopping cart channel unique identifier */
|
|
968
|
+
channelId: string;
|
|
969
|
+
/** Shopping cart stores, see Objectify<{@link CartStore}> */
|
|
970
|
+
stores: Objectify<CartStore<W, U, V, X, Y>>;
|
|
971
|
+
/** Shopping cart shipping cost */
|
|
972
|
+
shippingCost: ShippingCost<Z> | null;
|
|
973
|
+
/** Shopping cart additional info */
|
|
974
|
+
additional_info?: T;
|
|
975
|
+
/** Shopping cart bill total */
|
|
976
|
+
billTotal: BillTotal;
|
|
977
|
+
/** Shopping cart applied benefits */
|
|
978
|
+
benefits?: ShoppingCartBenefits;
|
|
979
|
+
/** Shopping cart user wallet id */
|
|
980
|
+
benefitsHash?: string;
|
|
981
|
+
/**
|
|
982
|
+
* Shopping cart pick up time, must be in UTC and
|
|
983
|
+
* `YYYY-MM-DD HH:mm:ss` format
|
|
984
|
+
*/
|
|
985
|
+
pickUpTime?: string;
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* Representation of a Alert.
|
|
989
|
+
*
|
|
990
|
+
* @interface Alert
|
|
991
|
+
* @since 0.1.0
|
|
992
|
+
*/
|
|
993
|
+
interface Alert {
|
|
994
|
+
/** Alert error level */
|
|
995
|
+
errorLevel: number;
|
|
996
|
+
/** Alert message */
|
|
997
|
+
message: string;
|
|
998
|
+
/** Alert type */
|
|
999
|
+
type: string;
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Representation of a Cart Store.
|
|
1003
|
+
*
|
|
1004
|
+
* @interface CartStore
|
|
1005
|
+
* @template T Store additional info
|
|
1006
|
+
* @template U Product additional info
|
|
1007
|
+
* @template V Categories additional info
|
|
1008
|
+
* @template W Vendor additional info
|
|
1009
|
+
* @template X Catalogues additional info
|
|
1010
|
+
* @since 0.1.0
|
|
1011
|
+
* @extends {{@link Store}
|
|
1012
|
+
*/
|
|
1013
|
+
interface CartStore<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo, V extends AdditionalInfo = AdditionalInfo, W extends AdditionalInfo = AdditionalInfo, X extends AdditionalInfo = AdditionalInfo> extends Store<T, W, X> {
|
|
1014
|
+
/** The products that belong to the store, see {@link CartProduct} */
|
|
1015
|
+
products: Objectify<CartProduct<U, V>>;
|
|
1016
|
+
/** Cart store's alerts, see {@link Alert} */
|
|
1017
|
+
alerts: Alert[];
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* The possible values of a Bill Total.
|
|
1021
|
+
*
|
|
1022
|
+
* @typedef BillTotal
|
|
1023
|
+
* @since 0.1.0
|
|
1024
|
+
*/
|
|
1025
|
+
type BillTotal = {
|
|
1026
|
+
/** Normal bill total category */
|
|
1027
|
+
NORMAL?: BillTotalCategory;
|
|
1028
|
+
/** Points bill total category */
|
|
1029
|
+
POINTS?: BillTotalCategory;
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* Representation of a Bill Total Category.
|
|
1033
|
+
*
|
|
1034
|
+
* @interface BillTotalCategory
|
|
1035
|
+
* @since 0.1.0
|
|
1036
|
+
*/
|
|
1037
|
+
interface BillTotalCategory {
|
|
1038
|
+
/** Bill total category subtotal without taxes */
|
|
1039
|
+
subtotalBeforeTaxes: number;
|
|
1040
|
+
/** Bill total category total taxes */
|
|
1041
|
+
taxTotal: number;
|
|
1042
|
+
/** Bill total category total */
|
|
1043
|
+
total: number;
|
|
1044
|
+
/** discounts shopping cart */
|
|
1045
|
+
discounts: Discount[];
|
|
1046
|
+
/** Taxes shopping cart */
|
|
1047
|
+
taxes: PriceCategoryTax[];
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Representation of shopping cart discount.
|
|
1051
|
+
*
|
|
1052
|
+
* @interface Discounts
|
|
1053
|
+
* @since 0.1.0
|
|
1054
|
+
*/
|
|
1055
|
+
interface Discount {
|
|
1056
|
+
benefitId: string;
|
|
1057
|
+
/** Benefit wallet id */
|
|
1058
|
+
benefitWalletId: string;
|
|
1059
|
+
/** Discount base value */
|
|
1060
|
+
discountBase: number;
|
|
1061
|
+
/** Whether or not the coupon has taxes */
|
|
1062
|
+
hasTaxes: boolean;
|
|
1063
|
+
/** If the coupon discount has been initialized */
|
|
1064
|
+
isInitialized: boolean;
|
|
1065
|
+
/** The benefit name */
|
|
1066
|
+
name: string;
|
|
1067
|
+
/** The benefit percentage */
|
|
1068
|
+
percentage: number;
|
|
1069
|
+
/** The benefit taxes */
|
|
1070
|
+
taxValue: number;
|
|
1071
|
+
/** The benefit type */
|
|
1072
|
+
type: BenefitTypes;
|
|
1073
|
+
/** The discount value */
|
|
1074
|
+
value: number;
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Representation of a Cart Totals.
|
|
1078
|
+
*
|
|
1079
|
+
* @interface CartTotals
|
|
1080
|
+
* @since 0.1.0
|
|
1081
|
+
*/
|
|
1082
|
+
interface CartTotals {
|
|
1083
|
+
/** Cart totals subtotal */
|
|
1084
|
+
subtotal: number;
|
|
1085
|
+
/** Cart totals shipping cost */
|
|
1086
|
+
shippingCost: number;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Represents a customer in the Masivo system.
|
|
1091
|
+
*/
|
|
1092
|
+
interface MasivoCustomer {
|
|
1093
|
+
/** The unique identifier for the customer. */
|
|
1094
|
+
id: string;
|
|
1095
|
+
/** The name of the customer. */
|
|
1096
|
+
name: string;
|
|
1097
|
+
/** The email address of the customer. */
|
|
1098
|
+
email: string;
|
|
1099
|
+
/** The date of birth of the customer. */
|
|
1100
|
+
dob: string;
|
|
1101
|
+
/** The gender of the customer. */
|
|
1102
|
+
gender: string;
|
|
1103
|
+
/** The date when the customer registered. */
|
|
1104
|
+
registration_date: string;
|
|
1105
|
+
/** The current status of the customer. */
|
|
1106
|
+
status: string;
|
|
1107
|
+
/** Additional metadata related to the customer. */
|
|
1108
|
+
metadata: Metadata;
|
|
1109
|
+
/** The identifier for the customer's tier. */
|
|
1110
|
+
tier_id: string;
|
|
1111
|
+
/** The metrics for the customer. */
|
|
1112
|
+
metrics: MasivoCustomerMetrics;
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Represents metadata information.
|
|
1116
|
+
*
|
|
1117
|
+
* @property {string} [exampleProperty] - Description of the example property.
|
|
1118
|
+
*/
|
|
1119
|
+
interface Metadata {
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Represents the metrics for a Masivo customer.
|
|
1123
|
+
*/
|
|
1124
|
+
interface MasivoCustomerMetrics {
|
|
1125
|
+
/** Metrics for the last month. */
|
|
1126
|
+
last_month: MetricPeriod;
|
|
1127
|
+
/** Metrics for the last quarter. */
|
|
1128
|
+
last_quarter: MetricPeriod;
|
|
1129
|
+
/** Metrics for the last semester */
|
|
1130
|
+
last_semester: MetricPeriod;
|
|
1131
|
+
/** Metrics for the last year. */
|
|
1132
|
+
last_year: MetricPeriod;
|
|
1133
|
+
/** Metrics for the lifetime of the customer. */
|
|
1134
|
+
lifetime: MetricPeriod;
|
|
1135
|
+
/** Metrics for this month */
|
|
1136
|
+
this_month: MetricPeriod;
|
|
1137
|
+
/** Metrics for this quarter */
|
|
1138
|
+
this_quarter: MetricPeriod;
|
|
1139
|
+
/** Metrics for this semester */
|
|
1140
|
+
this_semester: MetricPeriod;
|
|
1141
|
+
/** Metrics for this year */
|
|
1142
|
+
this_year: MetricPeriod;
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Represents the metrics for a specific period.
|
|
1146
|
+
*/
|
|
1147
|
+
interface MetricPeriod {
|
|
1148
|
+
/** The start date of the period. */
|
|
1149
|
+
from: string;
|
|
1150
|
+
/** The date of the last visit within the period. */
|
|
1151
|
+
last_visit: string | null;
|
|
1152
|
+
/** The number of purchases made within the period. */
|
|
1153
|
+
number_of_purchases: number;
|
|
1154
|
+
/** The total amount spent within the period. */
|
|
1155
|
+
spend_total: number;
|
|
1156
|
+
/** The identifier for the tier during the period. */
|
|
1157
|
+
tier_id: string | null;
|
|
1158
|
+
/** The end date of the period. */
|
|
1159
|
+
to: string;
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Represents a Masivo Wallet.
|
|
1163
|
+
*/
|
|
1164
|
+
interface MasivoWallet {
|
|
1165
|
+
/** The unique identifier of the wallet. */
|
|
1166
|
+
id: string;
|
|
1167
|
+
/** The unique identifier of the wallet owner. */
|
|
1168
|
+
owner_id: string;
|
|
1169
|
+
/** An array of wallet totals */
|
|
1170
|
+
totals: WalletTotal[];
|
|
1171
|
+
/** An array of wallet lines */
|
|
1172
|
+
lines: WalletLine[];
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Represents the total amount in a wallet along with reward details.
|
|
1176
|
+
*/
|
|
1177
|
+
interface WalletTotal {
|
|
1178
|
+
/** The total amount in the wallet. */
|
|
1179
|
+
total: number;
|
|
1180
|
+
/** The unique identifier for the reward. */
|
|
1181
|
+
reward_id: string;
|
|
1182
|
+
/** The expiration date of the reward. */
|
|
1183
|
+
expiration_date: string;
|
|
1184
|
+
/** The reward details associated with the wallet. */
|
|
1185
|
+
reward: WalletReward;
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Represents a line item in a wallet.
|
|
1189
|
+
*/
|
|
1190
|
+
interface WalletLine {
|
|
1191
|
+
/** The amount associated with the wallet line. */
|
|
1192
|
+
amount: number;
|
|
1193
|
+
/** The identifier for the reward. */
|
|
1194
|
+
reward_id: string;
|
|
1195
|
+
/** The identifier for the campaign. */
|
|
1196
|
+
campaign_id: string;
|
|
1197
|
+
/** The identifier for the brand, or null if not applicable. */
|
|
1198
|
+
brand_id: string;
|
|
1199
|
+
/** The date and time when the wallet line was issued. */
|
|
1200
|
+
issued_at: string;
|
|
1201
|
+
/** The date and time when the wallet line expires. */
|
|
1202
|
+
expiration_date: string;
|
|
1203
|
+
/** The optional date and time when the reservation expires. */
|
|
1204
|
+
reservation_expires_at?: string;
|
|
1205
|
+
/** The reward object containing detailed information */
|
|
1206
|
+
reward: WalletReward;
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Represents a reward in the wallet.
|
|
1210
|
+
*/
|
|
1211
|
+
interface WalletReward {
|
|
1212
|
+
/** The unique identifier of the reward. */
|
|
1213
|
+
id: string;
|
|
1214
|
+
/** The identifier of the brand associated with the reward, or null if not applicable. */
|
|
1215
|
+
brand_id: string | null;
|
|
1216
|
+
/** The name of the reward. */
|
|
1217
|
+
name: string;
|
|
1218
|
+
/** A description of the reward. */
|
|
1219
|
+
description: string;
|
|
1220
|
+
/** The type of the reward. */
|
|
1221
|
+
type: MasivoRewardType;
|
|
1222
|
+
/** The conditions associated with the reward. */
|
|
1223
|
+
conditions: MasivoCondition[][];
|
|
1224
|
+
/** The attributes of the reward. */
|
|
1225
|
+
attributes: WalletAttribute;
|
|
1226
|
+
/** The media associated with the reward. */
|
|
1227
|
+
media: WalletMedia;
|
|
1228
|
+
/** The status of the reward. */
|
|
1229
|
+
status: string;
|
|
1230
|
+
/** Optional content associated with the reward. */
|
|
1231
|
+
content?: Objectify<MasivoTemplateContent>;
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* Enum representing the types of rewards that can be associated with a wallet.
|
|
1235
|
+
*/
|
|
1236
|
+
type MasivoRewardType = "DISCOUNT" | "POINTS" | "GIFT_CARD" | "PRODUCT";
|
|
1237
|
+
/**
|
|
1238
|
+
* Represents the base structure for a Masivo condition.
|
|
1239
|
+
*/
|
|
1240
|
+
interface MasivoConditionBase {
|
|
1241
|
+
/** The primitive value associated with the condition. */
|
|
1242
|
+
primitive: string;
|
|
1243
|
+
/** The type of the Masivo condition. */
|
|
1244
|
+
type: MasivoConditionType;
|
|
1245
|
+
/** The operator used in the condition */
|
|
1246
|
+
operator: MasivoOperator;
|
|
1247
|
+
/** An optional message indicating why the condition is invalid. */
|
|
1248
|
+
invalidMessage?: string;
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* Type representing the conditions of rewards that can be associated with a wallet.
|
|
1252
|
+
*/
|
|
1253
|
+
type MasivoConditionType = "Current date" | "Registration" | "Birthday" | "Customer number of purchases" | "Customer has made a purchase" | "Customer points balance" | "Customer spend total" | "Customer total spend" | "Ordered at store" | "Ordered in channel" | "Payment method" | "Order includes product" | "Order value" | "Order includes tag" | "Product includes tag" | "Shipping includes tag";
|
|
1254
|
+
type MasivoTransactionType = "CASH" | "DEBIT" | "CREDIT" | "BANK_TRANSFER";
|
|
1255
|
+
/**
|
|
1256
|
+
* Type representing the operators of rewards that can be associated with a wallet.
|
|
1257
|
+
*/
|
|
1258
|
+
type MasivoOperator = "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "equal to" | "not equal to" | "is" | "is not" | "falls within period" | "occurred" | "occurred in the last" | "occurred more than";
|
|
1259
|
+
/**
|
|
1260
|
+
* Type representing the reporting periods for Masivo.
|
|
1261
|
+
*/
|
|
1262
|
+
type MasivoReportingPeriod = "MONTHLY" | "QUARTERLY" | "YEARLY" | "SEMESTERLY";
|
|
1263
|
+
/**
|
|
1264
|
+
* Type representing the possible repeat intervals for a Masivo event.
|
|
1265
|
+
*/
|
|
1266
|
+
type MasivoRepeatInterval = "NONE" | "DAILY" | "WEEKLY" | "FORTNIGHTLY" | "MONTHLY" | "WEEK_OF_MONTH";
|
|
1267
|
+
/**
|
|
1268
|
+
* Represents the attributes of a wallet in the system.
|
|
1269
|
+
*/
|
|
1270
|
+
interface WalletAttribute {
|
|
1271
|
+
/** Conversion factor used to calculate the wallet value. */
|
|
1272
|
+
conversion_factor?: number;
|
|
1273
|
+
/** Value of the applied discount. */
|
|
1274
|
+
discount_value?: number;
|
|
1275
|
+
/** Type of discount, can be fixed or percentage. */
|
|
1276
|
+
discount_type?: "fixed" | "percentage";
|
|
1277
|
+
/** Type of action associated with the wallet, can be shipping, order, or product. */
|
|
1278
|
+
type?: "shipping" | "order" | "product";
|
|
1279
|
+
/** Reward action associated with the wallet. */
|
|
1280
|
+
action?: MasivoRewardAction;
|
|
1281
|
+
/** New amount assigned to the wallet. */
|
|
1282
|
+
new_amount?: number;
|
|
1283
|
+
/** ID of the new product associated with the wallet. */
|
|
1284
|
+
new_product_id?: string;
|
|
1285
|
+
/** Replacement amount assigned to the wallet. */
|
|
1286
|
+
replace_amount?: number;
|
|
1287
|
+
/** ID of the replacement product associated with the wallet. */
|
|
1288
|
+
replace_product_id?: string;
|
|
1289
|
+
/** The ID of the product associated with the reward */
|
|
1290
|
+
item_id?: string;
|
|
1291
|
+
}
|
|
1292
|
+
/**
|
|
1293
|
+
* Type representing the possible actions for Masivo rewards.
|
|
1294
|
+
*/
|
|
1295
|
+
type MasivoRewardAction = "ADD_PRODUCT" | "REPLACE_PRODUCT";
|
|
1296
|
+
/**
|
|
1297
|
+
* Interface representing the media associated with a wallet.
|
|
1298
|
+
*/
|
|
1299
|
+
interface WalletMedia {
|
|
1300
|
+
/** The URL of the thumbnail image. */
|
|
1301
|
+
thumbnail_url: string | null;
|
|
1302
|
+
/** The URL of the cover image. */
|
|
1303
|
+
cover_url: string | null;
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Represents the content of a Masivo template.
|
|
1307
|
+
*/
|
|
1308
|
+
interface MasivoTemplateContent {
|
|
1309
|
+
/** The name of the template content. */
|
|
1310
|
+
name: string;
|
|
1311
|
+
/** The type of the template content */
|
|
1312
|
+
type: MasivoTemplateType;
|
|
1313
|
+
/** The value of the template content */
|
|
1314
|
+
value: string;
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Type representing the types of templates available for Masivo.
|
|
1318
|
+
*/
|
|
1319
|
+
type MasivoTemplateType = "input" | "textarea";
|
|
1320
|
+
/**
|
|
1321
|
+
* Represents a tier in from Masivo.
|
|
1322
|
+
*/
|
|
1323
|
+
interface MasivoTier {
|
|
1324
|
+
/** The unique identifier for the tier. */
|
|
1325
|
+
id: string;
|
|
1326
|
+
/** The name of the tier. */
|
|
1327
|
+
name: string;
|
|
1328
|
+
/** The current status of the tier. */
|
|
1329
|
+
status: string;
|
|
1330
|
+
/** The level of the tier. */
|
|
1331
|
+
level: number;
|
|
1332
|
+
/** A brief description of the tier. */
|
|
1333
|
+
description: string;
|
|
1334
|
+
/** The conditions required to enter the tier. */
|
|
1335
|
+
entry_conditions: MasivoCondition[][];
|
|
1336
|
+
/** The conditions required to exit the tier. */
|
|
1337
|
+
exit_conditions: MasivoCondition[][];
|
|
1338
|
+
/** The identifier for the template associated with the tier. */
|
|
1339
|
+
template_id?: string;
|
|
1340
|
+
/** The content of the template associated with the tier. */
|
|
1341
|
+
content?: Objectify<MasivoTemplateContent>;
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* Represents a redeemable benefit from Masivo in the wallet.
|
|
1345
|
+
*/
|
|
1346
|
+
interface RedeemableBenefit extends WalletTotal {
|
|
1347
|
+
/**The identifier for the brand associated with the benefit */
|
|
1348
|
+
brand_id: string;
|
|
1349
|
+
/** The identifier for the campaign associated with the benefit */
|
|
1350
|
+
campaign_id: string;
|
|
1351
|
+
/** The date and time when the benefit was issued */
|
|
1352
|
+
issued_at: string;
|
|
1353
|
+
/** The amount of the benefit */
|
|
1354
|
+
amount: number;
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* Represents a masivo benefit payload to send to the Masivo API and redeem the benefit.
|
|
1358
|
+
*/
|
|
1359
|
+
interface MasivoBenefitPayload {
|
|
1360
|
+
/** The unique identifier of the reward */
|
|
1361
|
+
reward_id: string;
|
|
1362
|
+
/** The amount of the benefit */
|
|
1363
|
+
amount: number;
|
|
1364
|
+
/** The total of the benefit */
|
|
1365
|
+
total: number;
|
|
1366
|
+
/** The identifier for the brand associated with the benefit */
|
|
1367
|
+
brand_id: string;
|
|
1368
|
+
/** The identifier for the campaign associated with the benefit */
|
|
1369
|
+
campaign_id: string;
|
|
1370
|
+
/** The date and time when the benefit was issued */
|
|
1371
|
+
issued_at: string;
|
|
1372
|
+
/** The date and time when the benefit expires */
|
|
1373
|
+
expiration_date: string;
|
|
1374
|
+
/** The reward in the wallet, see {@link WalletReward} */
|
|
1375
|
+
reward: WalletReward;
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* Interface representing the conditions of a tier from Masivo.
|
|
1379
|
+
*/
|
|
1380
|
+
interface MasivoCondition extends MasivoConditionBase {
|
|
1381
|
+
/** The reporting period for the condition. */
|
|
1382
|
+
reporting_period: MasivoReportingPeriod;
|
|
1383
|
+
/** The value associated with the condition. */
|
|
1384
|
+
value: string | `${string}/${string}`;
|
|
1385
|
+
/** The identifier for the reward associated with the condition. */
|
|
1386
|
+
reward_id?: string;
|
|
1387
|
+
/** Indicates if the condition is valid all day. */
|
|
1388
|
+
allDay?: boolean;
|
|
1389
|
+
/** The start date for the condition */
|
|
1390
|
+
startDate?: string;
|
|
1391
|
+
/** The end date for the condition */
|
|
1392
|
+
endDate?: string;
|
|
1393
|
+
/** The repeat interval for the condition */
|
|
1394
|
+
repeat?: MasivoRepeatInterval;
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Interface representing the conditions from Masivo.
|
|
1398
|
+
*
|
|
1399
|
+
* @interface MasivoCondition
|
|
1400
|
+
* @extends MasivoConditionBase see {@link MasivoConditionBase}
|
|
1401
|
+
*/
|
|
1402
|
+
interface MasivoCondition extends MasivoConditionBase {
|
|
1403
|
+
/** The reporting period for the condition. */
|
|
1404
|
+
reporting_period: MasivoReportingPeriod;
|
|
1405
|
+
/** The value associated with the condition. */
|
|
1406
|
+
value: string | `${string}/${string}`;
|
|
1407
|
+
/** The identifier for the reward associated with the condition. */
|
|
1408
|
+
reward_id?: string;
|
|
1409
|
+
/** Indicates if the condition is valid all day. */
|
|
1410
|
+
allDay?: boolean;
|
|
1411
|
+
/** The start date for the condition */
|
|
1412
|
+
startDate?: string;
|
|
1413
|
+
/** The end date for the condition */
|
|
1414
|
+
endDate?: string;
|
|
1415
|
+
/** The repeat interval for the condition */
|
|
1416
|
+
repeat?: MasivoRepeatInterval;
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Configuration interface for validating Masivo conditions.
|
|
1420
|
+
*/
|
|
1421
|
+
interface ValidateConditionConfig {
|
|
1422
|
+
/** Store information */
|
|
1423
|
+
store?: Store;
|
|
1424
|
+
/** Catalogue identifier */
|
|
1425
|
+
catalogueId?: Catalogue["catalogueId"];
|
|
1426
|
+
/** Payment method name identifier */
|
|
1427
|
+
paymentMethodName?: string;
|
|
1428
|
+
/** The current shopping cart */
|
|
1429
|
+
shoppingCart?: ShoppingCart;
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Interface representing a customer from Masivo
|
|
1433
|
+
*/
|
|
1434
|
+
interface MasivoInfo {
|
|
1435
|
+
/** The customer associated with the loyalty program. */
|
|
1436
|
+
customer: MasivoCustomer;
|
|
1437
|
+
/** The wallet containing the loyalty points and rewards. */
|
|
1438
|
+
wallet: MasivoWallet;
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* ExtendedLoyaltyInfo interface extends the LoyaltyInfo interface to include additional properties
|
|
1442
|
+
* related to loyalty accumulations and redemptions.
|
|
1443
|
+
*
|
|
1444
|
+
* @extends LoyaltyInfo see {@link MasivoInfo}
|
|
1445
|
+
*/
|
|
1446
|
+
interface ExtendedLoyaltyInfo extends MasivoInfo {
|
|
1447
|
+
/** An array of loyalty accumulation records */
|
|
1448
|
+
accumulations: LoyaltyAccumulation[];
|
|
1449
|
+
/** An array of loyalty redemption records*/
|
|
1450
|
+
redemptions: unknown[];
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Interface representing the accumulations in a loyalty wallet.
|
|
1454
|
+
*
|
|
1455
|
+
* @extends WalletLine see {@link WalletLine}
|
|
1456
|
+
*/
|
|
1457
|
+
interface LoyaltyAccumulation extends WalletLine {
|
|
1458
|
+
/** The reward associated with the accumulation */
|
|
1459
|
+
reward: WalletReward;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1089
1462
|
/**
|
|
1090
1463
|
* Wallet user information.
|
|
1091
1464
|
*
|
|
@@ -1190,7 +1563,7 @@ interface Award {
|
|
|
1190
1563
|
* @typedef ShoppingCartBenefits
|
|
1191
1564
|
* @since 0.1.0
|
|
1192
1565
|
*/
|
|
1193
|
-
type ShoppingCartBenefits = Benefit[];
|
|
1566
|
+
type ShoppingCartBenefits = Benefit[] | RedeemableBenefit[];
|
|
1194
1567
|
/**
|
|
1195
1568
|
* The possible values of the benefit type.
|
|
1196
1569
|
*
|
|
@@ -3298,4 +3671,4 @@ interface CardInscription {
|
|
|
3298
3671
|
createdAt?: string;
|
|
3299
3672
|
}
|
|
3300
3673
|
|
|
3301
|
-
export type { ARDocumentType, Account, AdditionalInfo, Alert, Allocation, ArtisnParams, ArtisnPlatform, ArtisnQuery, ArtisnRequest, ArtisnRequestBody, ArtisnRequestHeaders, ArtisnRequestMethod, Award, BODocumentType, BRDocumentType, Banner, BannerBenefits, BannerCoupon, BannerImage, BannerScope, BannerType, BaseBillingData, BaseField, BaseLivingPlace, BaseOrder, BasePaymentMethod, BaseProduct, BaseShippingAddress, BaseUser, BaseWeekDay, Benefit, BenefitData, BenefitTypes, BillTotal, BillTotalCategory, BillingData, CDNImage, CLDocumentType, CODocumentType, CardInscription, CardName, CartProduct, CartProductAnswer, CartProductQuestion, CartStore, CartTotals, Catalogue, Category, CategoryWithProducts, Code, CommonDocumentType, Country, CountryCode, CountryCurrency, CountrySummary, Coupon, CouponCategory, CouponType, CreditCardMapping, CurrencyCodes, DayOfWeek, Days, Delivery, DeliveryTimeUnit, Discount, DocumentType, ECDocumentType, Field, FieldRecord, Gender, GenericStoreLocation, Image, ImageFit, ImageManipulationConfig, ImageToFormat, Injection, InjectionDetail, IntegrationMessage, Issue, IssueAdditionalInfo, IssueHistory, LivingPlace, LivingPlaceToSave, MaritalStatus, Message, MetadataShipping, NewShippingAddress, Notification, NotificationAdditionalInfo, NotificationExtraData, NotificationListItem, NotificationPriority, NotificationStep, NotificationStore, NotificationUser, NotificationVendor, Objectify, OperatorInformation, Order, OrderBillProduct, OrderBillProductAdditionalInfo, OrderBillTotal, OrderCommonFields, OrderDetailShippingCost, OrderDetails, OrderPaymentMethod, OrderProduct, OrderProductAdditionalInfo, OrderProductAttributes, OrderProductBillTotal, OrderProductImage, OrderProductPriceCategory, OrderRetry, OrderRetryPaymentMethod, OrderShoppingCart, OrderStatus, OrderStep, OrderStepAdditionalInfo, OrderStepAdditionalInfoGroup, OrderStore, OrderStoreAdditionalInfo, OrderStoreDelivery, OrderUser, PEDocumentType, PYDocumentType, PaymentMethod, PaymentMethodByOrder, PaymentMethodName, PaymentProvider, PaymentStatus, Phone, PriceCategory, PriceCategoryTax, PriceCategoryType, Product, ProductAnswer, ProductAttributes, ProductCoupon, ProductDetails, ProductPrices, ProductQuestion, ProductStatus, ProductType, RandomImageConfig, ReadValue, Rule, Schedule, Service, Settings, ShippingAddress, ShippingCost, ShippingCostTax, ShoppingCart, ShoppingCartBenefits, Status, StepCategory, StepCode, StepNotification, StepWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, Store, StoreCoupon, StoreCouponDetail, StoreLocation, StorePolygons, Suborder, Tax, TaxCalculation, TaxCalculations, TaxType, Token, TransitionWorkflow, URLImage, USDocumentType, UYDocumentType, UpdatedShippingAddress, User, UserCountry, UserSettings, UserType, VEDocumentType, Vendor, Wallet, WebhookWorkflow, Workflow, ZipCodeField };
|
|
3674
|
+
export type { ARDocumentType, Account, AdditionalInfo, Alert, Allocation, ArtisnParams, ArtisnPlatform, ArtisnQuery, ArtisnRequest, ArtisnRequestBody, ArtisnRequestHeaders, ArtisnRequestMethod, Award, BODocumentType, BRDocumentType, Banner, BannerBenefits, BannerCoupon, BannerImage, BannerScope, BannerType, BaseBillingData, BaseField, BaseLivingPlace, BaseOrder, BasePaymentMethod, BaseProduct, BaseShippingAddress, BaseUser, BaseWeekDay, Benefit, BenefitData, BenefitTypes, BillTotal, BillTotalCategory, BillingData, CDNImage, CLDocumentType, CODocumentType, CardInscription, CardName, CartProduct, CartProductAnswer, CartProductQuestion, CartStore, CartTotals, Catalogue, Category, CategoryWithProducts, Code, CommonDocumentType, Country, CountryCode, CountryCurrency, CountrySummary, Coupon, CouponCategory, CouponType, CreditCardMapping, CurrencyCodes, DayOfWeek, Days, Delivery, DeliveryTimeUnit, Discount, DocumentType, ECDocumentType, ExtendedLoyaltyInfo, Field, FieldRecord, Gender, GenericStoreLocation, Image, ImageFit, ImageManipulationConfig, ImageToFormat, Injection, InjectionDetail, IntegrationMessage, Issue, IssueAdditionalInfo, IssueHistory, LivingPlace, LivingPlaceToSave, LoyaltyAccumulation, MaritalStatus, MasivoBenefitPayload, MasivoCondition, MasivoConditionBase, MasivoConditionType, MasivoCustomer, MasivoCustomerMetrics, MasivoInfo, MasivoOperator, MasivoRepeatInterval, MasivoReportingPeriod, MasivoRewardAction, MasivoRewardType, MasivoTemplateContent, MasivoTemplateType, MasivoTier, MasivoTransactionType, MasivoWallet, Message, Metadata, MetadataShipping, MetricPeriod, NewShippingAddress, Notification, NotificationAdditionalInfo, NotificationExtraData, NotificationListItem, NotificationPriority, NotificationStep, NotificationStore, NotificationUser, NotificationVendor, Objectify, OperatorInformation, Order, OrderBillProduct, OrderBillProductAdditionalInfo, OrderBillTotal, OrderCommonFields, OrderDetailShippingCost, OrderDetails, OrderPaymentMethod, OrderProduct, OrderProductAdditionalInfo, OrderProductAttributes, OrderProductBillTotal, OrderProductImage, OrderProductPriceCategory, OrderRetry, OrderRetryPaymentMethod, OrderShoppingCart, OrderStatus, OrderStep, OrderStepAdditionalInfo, OrderStepAdditionalInfoGroup, OrderStore, OrderStoreAdditionalInfo, OrderStoreDelivery, OrderUser, PEDocumentType, PYDocumentType, PaymentMethod, PaymentMethodByOrder, PaymentMethodName, PaymentProvider, PaymentStatus, Phone, PriceCategory, PriceCategoryTax, PriceCategoryType, Product, ProductAnswer, ProductAttributes, ProductCoupon, ProductDetails, ProductPrices, ProductQuestion, ProductStatus, ProductType, RandomImageConfig, ReadValue, RedeemableBenefit, Rule, Schedule, Service, Settings, ShippingAddress, ShippingCost, ShippingCostTax, ShoppingCart, ShoppingCartBenefits, Status, StepCategory, StepCode, StepNotification, StepWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, Store, StoreCoupon, StoreCouponDetail, StoreLocation, StorePolygons, Suborder, Tax, TaxCalculation, TaxCalculations, TaxType, Token, TransitionWorkflow, URLImage, USDocumentType, UYDocumentType, UpdatedShippingAddress, User, UserCountry, UserSettings, UserType, VEDocumentType, ValidateConditionConfig, Vendor, Wallet, WalletAttribute, WalletLine, WalletMedia, WalletReward, WalletTotal, WebhookWorkflow, Workflow, ZipCodeField };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@artisan-commerce/types",
|
|
3
3
|
"description": "Artisn's types and interfaces library",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.14.0-canary.
|
|
5
|
+
"version": "0.14.0-canary.55",
|
|
6
6
|
"types": "./dist/bundle.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"author": "Luis Eduardo Andrade",
|
|
26
26
|
"license": "MIT",
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "84bec16c67d1912b28b687ea4b1e0e422f4e5332",
|
|
28
28
|
"nx": {
|
|
29
29
|
"targets": {
|
|
30
30
|
"build": {
|