@reactionary/core 0.3.16 → 0.3.17

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/initialization.js CHANGED
@@ -2,13 +2,13 @@ function createInitialRequestContext() {
2
2
  return {
3
3
  languageContext: {
4
4
  locale: "en",
5
- currencyCode: "USD"
5
+ currencyCode: "EUR"
6
6
  },
7
7
  storeIdentifier: {
8
8
  key: "the-good-store"
9
9
  },
10
10
  taxJurisdiction: {
11
- countryCode: "US",
11
+ countryCode: "DK",
12
12
  stateCode: "",
13
13
  countyCode: "",
14
14
  cityCode: ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/core",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "main": "index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "dependencies": {
@@ -19,7 +19,8 @@ class PriceProvider extends BaseProvider {
19
19
  unitPrice: {
20
20
  value: -1,
21
21
  currency: this.context.languageContext.currencyCode
22
- }
22
+ },
23
+ onSale: false
23
24
  };
24
25
  return price;
25
26
  }
@@ -13,6 +13,7 @@ const TieredPriceSchema = z.looseObject({
13
13
  const PriceSchema = BaseModelSchema.extend({
14
14
  identifier: PriceIdentifierSchema,
15
15
  unitPrice: MonetaryAmountSchema,
16
+ onSale: z.boolean().default(false).meta({ description: "Whether the price is currently discounted. This can be used to indicate if the unitPrice reflects a discount compared to the list price. In B2B the price might differ, due to customer specific pricing, but not necessarily because it is on sale." }),
16
17
  tieredPrices: z.array(TieredPriceSchema)
17
18
  });
18
19
  export {
@@ -567,6 +567,7 @@ export declare const PriceSchema: z.ZodObject<{
567
567
  ZWL: "ZWL";
568
568
  }>;
569
569
  }, z.core.$loose>;
570
+ onSale: z.ZodDefault<z.ZodBoolean>;
570
571
  tieredPrices: z.ZodArray<z.ZodObject<{
571
572
  minimumQuantity: z.ZodNumber;
572
573
  price: z.ZodObject<{