@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/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.7.0-canary.40](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/builders@0.7.0-canary.39...@artisan-commerce/builders@0.7.0-canary.40) (2022-04-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **shoppingcart:** bugfix shoppingCart ([9e22bf2](https://bitbucket.org/tradesystem/artisn_sdk/commit/9e22bf2d19583738febd7d57e798f86baf57fdaa))
12
+
13
+
14
+
6
15
  ## [0.7.0-canary.39](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/builders@0.7.0-canary.38...@artisan-commerce/builders@0.7.0-canary.39) (2022-03-07)
7
16
 
8
17
  **Note:** Version bump only for package @artisan-commerce/builders
@@ -142826,7 +142826,8 @@ const buildBillTotalNormalCategory = (overrides = {}) => {
142826
142826
  return __spreadValues$5({
142827
142827
  subtotalBeforeTaxes,
142828
142828
  taxTotal,
142829
- total
142829
+ total,
142830
+ discounts: genDiscounts(1)
142830
142831
  }, overrides);
142831
142832
  };
142832
142833
  const buildBillTotal = (overrides = {}) => {
@@ -142895,6 +142896,30 @@ const buildShippingCostTax = (overrides = {}) => {
142895
142896
  const genShippingCostTaxes = (quantity) => {
142896
142897
  return genItems(buildShippingCostTax, quantity);
142897
142898
  };
142899
+ const buildDiscount = (overrides = {}) => {
142900
+ const benefitTypes = [
142901
+ "ALTER_DELIVERY",
142902
+ "DISCOUNT_FIXED",
142903
+ "DISCOUNT_PERCENTAGE",
142904
+ "PRODUCT"
142905
+ ];
142906
+ const type = chooseRandom(benefitTypes);
142907
+ return __spreadValues$5({
142908
+ benefitId: Number(genId()),
142909
+ benefitWalletId: Number(genId()),
142910
+ discountBase: genNumber(100),
142911
+ hasTaxes: genBiasBoolean(0.5),
142912
+ isInitialized: genBiasBoolean(0.5),
142913
+ name: genWord(),
142914
+ percentage: genNumber(100),
142915
+ taxValue: genNumber(100),
142916
+ type,
142917
+ value: genNumber(100)
142918
+ }, overrides);
142919
+ };
142920
+ const genDiscounts = (quantity) => {
142921
+ return genItems(buildDiscount, quantity);
142922
+ };
142898
142923
 
142899
142924
  var shoppingCart_builder = /*#__PURE__*/Object.freeze({
142900
142925
  __proto__: null,
@@ -142905,7 +142930,9 @@ var shoppingCart_builder = /*#__PURE__*/Object.freeze({
142905
142930
  buildShoppingCart: buildShoppingCart,
142906
142931
  buildShippingCost: buildShippingCost,
142907
142932
  buildShippingCostTax: buildShippingCostTax,
142908
- genShippingCostTaxes: genShippingCostTaxes
142933
+ genShippingCostTaxes: genShippingCostTaxes,
142934
+ buildDiscount: buildDiscount,
142935
+ genDiscounts: genDiscounts
142909
142936
  });
142910
142937
 
142911
142938
  var __defProp$4 = Object.defineProperty;