@artisan-commerce/builders 0.7.0-canary.39 → 0.7.0-canary.40

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { Account, Banner, BannerCoupon, BannerBenefits, BannerImage, BillingData, Catalogue, Category, CategoryWithProducts, CommonDocumentType, ARDocumentType, BODocumentType, BRDocumentType, CLDocumentType, CODocumentType, ECDocumentType, PYDocumentType, PEDocumentType, UYDocumentType, VEDocumentType, USDocumentType, RandomImageConfig, CountryCode, DocumentType, CountrySummary, CountryCurrency, Country, Benefit, Award, Wallet, StoreCoupon, ProductCoupon, BenefitData, Coupon, CouponCategory, Code, Token, StoreCouponDetail, StepCategory, StepCode, Issue, IssueAdditionalInfo, IssueHistory, Workflow, StepNotification, StepWorkflow, WebhookWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, TransitionWorkflow, URLImage, CDNImage, Notification, NotificationUser, NotificationStore, NotificationStep, NotificationAdditionalInfo, NotificationExtraData, NotificationListItem, OrderStatus, Allocation, BaseOrder, OrderDetails, OrderStep, OrderStepAdditionalInfo, OrderStepAdditionalInfoGroup, OrderDetailShippingCost, OrderRetry, Status, OrderPaymentMethod, OrderShoppingCart, OrderStoreAdditionalInfo, OrderStoreDelivery, OrderStore, OrderProductAttributes, OrderProductAdditionalInfo, OrderProductImage, OrderBillProductAdditionalInfo, TaxCalculation, TaxCalculations, OrderProductPriceCategory, OrderProduct, OrderBillProduct, OrderProductBillTotal, OrderBillTotal, OrderAdditionalInfo, MetadataShipping, BaseField, ZipCodeField, IntegrationMessage, InjectionDetail, OrderUser, OperatorInformation, Suborder, PaymentMethodByOrder, OrderRetryPaymentMethod, BasePaymentMethod, PaymentMethod, PaymentProvider, CreditCardMapping, CardInscription, PriceCategoryTax, PriceCategory, BaseProduct, ProductAnswer, ProductQuestion, ProductDetails, CartProductAnswer, CartProductQuestion, CartProduct, Settings, UserSettings, Field, Rule, Message, LivingPlace, ShippingAddress, BillTotalCategory, BillTotal, CartStore, Objectify, ShoppingCart, ShippingCost, ShippingCostTax, Store, AdditionalStoreInformation, Delivery, Schedule, Service, GenericStoreLocation, StoreLocation, User, Phone, Vendor } from '@artisan-commerce/types';
1
+ import { Account, Banner, BannerCoupon, BannerBenefits, BannerImage, BillingData, Catalogue, Category, CategoryWithProducts, CommonDocumentType, ARDocumentType, BODocumentType, BRDocumentType, CLDocumentType, CODocumentType, ECDocumentType, PYDocumentType, PEDocumentType, UYDocumentType, VEDocumentType, USDocumentType, RandomImageConfig, CountryCode, DocumentType, CountrySummary, CountryCurrency, Country, Benefit, Award, Wallet, StoreCoupon, ProductCoupon, BenefitData, Coupon, CouponCategory, Code, Token, StoreCouponDetail, StepCategory, StepCode, Issue, IssueAdditionalInfo, IssueHistory, Workflow, StepNotification, StepWorkflow, WebhookWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, TransitionWorkflow, URLImage, CDNImage, Notification, NotificationUser, NotificationStore, NotificationStep, NotificationAdditionalInfo, NotificationExtraData, NotificationListItem, OrderStatus, Allocation, BaseOrder, OrderDetails, OrderStep, OrderStepAdditionalInfo, OrderStepAdditionalInfoGroup, OrderDetailShippingCost, OrderRetry, Status, OrderPaymentMethod, OrderShoppingCart, OrderStoreAdditionalInfo, OrderStoreDelivery, OrderStore, OrderProductAttributes, OrderProductAdditionalInfo, OrderProductImage, OrderBillProductAdditionalInfo, TaxCalculation, TaxCalculations, OrderProductPriceCategory, OrderProduct, OrderBillProduct, OrderProductBillTotal, OrderBillTotal, OrderAdditionalInfo, MetadataShipping, BaseField, ZipCodeField, IntegrationMessage, InjectionDetail, OrderUser, OperatorInformation, Suborder, PaymentMethodByOrder, OrderRetryPaymentMethod, BasePaymentMethod, PaymentMethod, PaymentProvider, CreditCardMapping, CardInscription, PriceCategoryTax, PriceCategory, BaseProduct, ProductAnswer, ProductQuestion, ProductDetails, CartProductAnswer, CartProductQuestion, CartProduct, Settings, UserSettings, Field, Rule, Message, LivingPlace, ShippingAddress, BillTotalCategory, BillTotal, CartStore, Objectify, ShoppingCart, ShippingCost, ShippingCostTax, Discount, Store, AdditionalStoreInformation, Delivery, Schedule, Service, GenericStoreLocation, StoreLocation, User, Phone, Vendor } from '@artisan-commerce/types';
2
2
 
3
3
  /**
4
4
  * Generates Account object with random data.
@@ -2664,6 +2664,16 @@ declare const buildShippingCostTax: (overrides?: Partial<ShippingCostTax>) => Sh
2664
2664
  * see {@link ShippingCostTax}
2665
2665
  */
2666
2666
  declare const genShippingCostTaxes: (quantity?: number | undefined) => ShippingCostTax[];
2667
+ /**
2668
+ * Generates Discount object with random data.
2669
+ *
2670
+ * @since 0.1.0
2671
+ * @param {Partial<Discount>} overrides Properties to override
2672
+ * a {@link Discount}
2673
+ * @returns {Discount} A {@link Discount} object
2674
+ */
2675
+ declare const buildDiscount: (overrides?: Partial<Discount>) => Discount;
2676
+ declare const genDiscounts: (quantity?: number | undefined) => Discount[];
2667
2677
 
2668
2678
  declare const shoppingCart_builder_buildBillTotalNormalCategory: typeof buildBillTotalNormalCategory;
2669
2679
  declare const shoppingCart_builder_buildBillTotal: typeof buildBillTotal;
@@ -2673,6 +2683,8 @@ declare const shoppingCart_builder_buildShoppingCart: typeof buildShoppingCart;
2673
2683
  declare const shoppingCart_builder_buildShippingCost: typeof buildShippingCost;
2674
2684
  declare const shoppingCart_builder_buildShippingCostTax: typeof buildShippingCostTax;
2675
2685
  declare const shoppingCart_builder_genShippingCostTaxes: typeof genShippingCostTaxes;
2686
+ declare const shoppingCart_builder_buildDiscount: typeof buildDiscount;
2687
+ declare const shoppingCart_builder_genDiscounts: typeof genDiscounts;
2676
2688
  declare namespace shoppingCart_builder {
2677
2689
  export {
2678
2690
  shoppingCart_builder_buildBillTotalNormalCategory as buildBillTotalNormalCategory,
@@ -2683,6 +2695,8 @@ declare namespace shoppingCart_builder {
2683
2695
  shoppingCart_builder_buildShippingCost as buildShippingCost,
2684
2696
  shoppingCart_builder_buildShippingCostTax as buildShippingCostTax,
2685
2697
  shoppingCart_builder_genShippingCostTaxes as genShippingCostTaxes,
2698
+ shoppingCart_builder_buildDiscount as buildDiscount,
2699
+ shoppingCart_builder_genDiscounts as genDiscounts,
2686
2700
  };
2687
2701
  }
2688
2702
 
@@ -142822,7 +142822,8 @@ const buildBillTotalNormalCategory = (overrides = {}) => {
142822
142822
  return __spreadValues$5({
142823
142823
  subtotalBeforeTaxes,
142824
142824
  taxTotal,
142825
- total
142825
+ total,
142826
+ discounts: genDiscounts(1)
142826
142827
  }, overrides);
142827
142828
  };
142828
142829
  const buildBillTotal = (overrides = {}) => {
@@ -142891,6 +142892,30 @@ const buildShippingCostTax = (overrides = {}) => {
142891
142892
  const genShippingCostTaxes = (quantity) => {
142892
142893
  return genItems(buildShippingCostTax, quantity);
142893
142894
  };
142895
+ const buildDiscount = (overrides = {}) => {
142896
+ const benefitTypes = [
142897
+ "ALTER_DELIVERY",
142898
+ "DISCOUNT_FIXED",
142899
+ "DISCOUNT_PERCENTAGE",
142900
+ "PRODUCT"
142901
+ ];
142902
+ const type = chooseRandom(benefitTypes);
142903
+ return __spreadValues$5({
142904
+ benefitId: Number(genId()),
142905
+ benefitWalletId: Number(genId()),
142906
+ discountBase: genNumber(100),
142907
+ hasTaxes: genBiasBoolean(0.5),
142908
+ isInitialized: genBiasBoolean(0.5),
142909
+ name: genWord(),
142910
+ percentage: genNumber(100),
142911
+ taxValue: genNumber(100),
142912
+ type,
142913
+ value: genNumber(100)
142914
+ }, overrides);
142915
+ };
142916
+ const genDiscounts = (quantity) => {
142917
+ return genItems(buildDiscount, quantity);
142918
+ };
142894
142919
 
142895
142920
  var shoppingCart_builder = /*#__PURE__*/Object.freeze({
142896
142921
  __proto__: null,
@@ -142901,7 +142926,9 @@ var shoppingCart_builder = /*#__PURE__*/Object.freeze({
142901
142926
  buildShoppingCart: buildShoppingCart,
142902
142927
  buildShippingCost: buildShippingCost,
142903
142928
  buildShippingCostTax: buildShippingCostTax,
142904
- genShippingCostTaxes: genShippingCostTaxes
142929
+ genShippingCostTaxes: genShippingCostTaxes,
142930
+ buildDiscount: buildDiscount,
142931
+ genDiscounts: genDiscounts
142905
142932
  });
142906
142933
 
142907
142934
  var __defProp$4 = Object.defineProperty;