@tillhub/schemas 6.131.0 → 6.134.0

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
@@ -1,3 +1,24 @@
1
+ # [6.134.0](https://github.com/tillhub/schemas/compare/v6.133.0...v6.134.0) (2022-04-05)
2
+
3
+
4
+ ### Features
5
+
6
+ * **products:** configuration ([3050bd5](https://github.com/tillhub/schemas/commit/3050bd5))
7
+
8
+ # [6.133.0](https://github.com/tillhub/schemas/compare/v6.132.0...v6.133.0) (2022-04-01)
9
+
10
+
11
+ ### Features
12
+
13
+ * **carts:** add more information about data integrity validation #API-1461 ([19e065b](https://github.com/tillhub/schemas/commit/19e065b)), closes [#API-1461](https://github.com/tillhub/schemas/issues/API-1461)
14
+
15
+ # [6.132.0](https://github.com/tillhub/schemas/compare/v6.131.0...v6.132.0) (2022-03-30)
16
+
17
+
18
+ ### Features
19
+
20
+ * **configurations:** payments ([a96eb88](https://github.com/tillhub/schemas/commit/a96eb88))
21
+
1
22
  # [6.131.0](https://github.com/tillhub/schemas/compare/v6.130.0...v6.131.0) (2022-03-29)
2
23
 
3
24
 
@@ -13,7 +13,7 @@ const masterData = {
13
13
  })
14
14
  },
15
15
  tax: {
16
- description: 'Tax rate ID',
16
+ description: 'Tax rate ID. If not present, the "vat_rate" must be present. The active tax with such ID must be defined in the system',
17
17
  type: 'string',
18
18
  format: 'uuid'
19
19
  },
@@ -23,7 +23,7 @@ const masterData = {
23
23
  format: 'uuid'
24
24
  },
25
25
  account_number: {
26
- description: 'Account number',
26
+ description: 'Account number. The only one active account with the same number must be defined in the system (does not apply when "account" value is present)',
27
27
  ...oneOf({
28
28
  type: 'string'
29
29
  })
@@ -498,7 +498,7 @@ const externalCart = {
498
498
  ...amount
499
499
  },
500
500
  vat_rate: {
501
- description: 'VAT rate',
501
+ description: 'VAT rate in the range 0-1. Required when "tax" value is not present. The only one active VAT with the same rate must be defined in the system (does not apply when "tax" value is present)',
502
502
  example: 0.12,
503
503
  type: 'number',
504
504
  minimum: 0,
@@ -618,7 +618,7 @@ const internalCart = {
618
618
  })
619
619
  },
620
620
  vat_rate: {
621
- description: 'VAT rate',
621
+ description: 'VAT rate in the range 0-1. Required when "tax" value is not present. The only one active VAT with the same rate must be defined in the system (does not apply when "tax" value is present)',
622
622
  example: 0.12,
623
623
  type: 'number',
624
624
  minimum: 0,
@@ -21,6 +21,11 @@ module.exports = {
21
21
  description: 'If true, allows multiple payments on negative cart totals, e.g. undefined + cash (e.g. health insurance case).',
22
22
  default: false,
23
23
  type: 'boolean'
24
+ }),
25
+ allow_change_on_cards: oneOf({
26
+ description: 'If true, allows entering values for split payments that are higher than the remaining price - thus potentially handing back cash (legacy behavior).',
27
+ default: false,
28
+ type: 'boolean'
24
29
  })
25
30
  }
26
31
  }
@@ -188,7 +188,14 @@ module.exports = {
188
188
  ]
189
189
  },
190
190
  allow_zero_prices: {
191
- description: 'If true, a product can be added to the cart with 0.0 as price or its price can be changed to 0.0.',
191
+ deprecated: true,
192
+ description: stripIndents`
193
+ If true, a product can be added to the cart with 0.0 as price or its price can be changed to 0.0.
194
+
195
+ NOTE: Hard validation will be removed entirely!
196
+ Behavior will be driven by 'v1/products.configuration.pricing.request_input'
197
+ and 'v1/products.configuration.pricing.zero_input_allowed'.
198
+ `,
192
199
  oneOf: [
193
200
  {
194
201
  type: 'null'
@@ -1,3 +1,4 @@
1
+ const { stripIndents } = require('common-tags')
1
2
  module.exports = {
2
3
  description: 'Defines various product behaviours.',
3
4
  default: {
@@ -12,6 +13,7 @@ module.exports = {
12
13
  additionalProperties: true,
13
14
  properties: {
14
15
  allow_zero_prices: {
16
+ deprecated: true,
15
17
  description: 'Allow adding this product to a cart if it has no price.',
16
18
  type: 'boolean'
17
19
  },
@@ -19,8 +21,27 @@ module.exports = {
19
21
  type: 'object',
20
22
  properties: {
21
23
  allow_is_free: {
24
+ deprecated: true,
22
25
  description: 'If an eligible price is 0 define whether the user is prompted to enter a price or whether the price can stay 0, to essentially be a freebie.',
23
26
  type: 'boolean'
27
+ },
28
+ request_input: {
29
+ type: 'boolean',
30
+ default: false,
31
+ description: stripIndents`
32
+ If true, request cashier input - regardless of the current price value, but pre-filled with it.
33
+
34
+ NOTE: If false and price is 0 - adds item with 0 price automatically.
35
+ `
36
+ },
37
+ zero_input_allowed: {
38
+ type: 'boolean',
39
+ default: false,
40
+ description: stripIndents`
41
+ Defines whether a requested price input can be confirmed with a zero value or not.
42
+
43
+ NOTE: Does not affect any zero price behavior directly, just the input validation when 'request_input'=true.
44
+ `
24
45
  }
25
46
  }
26
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.131.0",
3
+ "version": "6.134.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",