@tillhub/schemas 6.100.2 → 6.103.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,31 @@
1
+ # [6.103.0](https://github.com/tillhub/schemas/compare/v6.102.0...v6.103.0) (2021-11-08)
2
+
3
+
4
+ ### Features
5
+
6
+ * **product_addons:** Extend add-ons with editable quantity functionality ([#645](https://github.com/tillhub/schemas/issues/645)) ([ba8a564](https://github.com/tillhub/schemas/commit/ba8a564))
7
+
8
+ # [6.102.0](https://github.com/tillhub/schemas/compare/v6.101.0...v6.102.0) (2021-11-03)
9
+
10
+
11
+ ### Features
12
+
13
+ * **pricebook:** add lowest_price, highest_price ([2c55b20](https://github.com/tillhub/schemas/commit/2c55b20))
14
+
15
+ # [6.101.0](https://github.com/tillhub/schemas/compare/v6.100.3...v6.101.0) (2021-10-29)
16
+
17
+
18
+ ### Features
19
+
20
+ * **pricebooks:** add branch groups #API-1115 ([fac9fd0](https://github.com/tillhub/schemas/commit/fac9fd0)), closes [#API-1115](https://github.com/tillhub/schemas/issues/API-1115)
21
+
22
+ ## [6.100.3](https://github.com/tillhub/schemas/compare/v6.100.2...v6.100.3) (2021-10-22)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **products:** q is required property in products search request chema ([#641](https://github.com/tillhub/schemas/issues/641)) ([ceb3019](https://github.com/tillhub/schemas/commit/ceb3019))
28
+
1
29
  ## [6.100.2](https://github.com/tillhub/schemas/compare/v6.100.1...v6.100.2) (2021-10-22)
2
30
 
3
31
 
@@ -38,7 +38,7 @@ module.exports = {
38
38
  }
39
39
  }
40
40
  ),
41
- quantity: {
41
+ stock_quantity: {
42
42
  type: 'number',
43
43
  description: 'How much of the product stock will be moved (defaults to 1 - only important if it affects stock). This value can be negative number!',
44
44
  default: 1
@@ -53,6 +53,11 @@ module.exports = {
53
53
  description: 'Can the cashier edit the quantity of the addon selected (only important if it affects stock)',
54
54
  default: false
55
55
  },
56
+ max_quantity: {
57
+ type: 'number',
58
+ description: 'Maximum count the product stock will be moved. Related to the allow_quantity_edit - only if it set to true',
59
+ default: 1
60
+ },
56
61
  order_index: {
57
62
  type: 'number',
58
63
  description: 'Display the Addon in a specific order',
@@ -2,43 +2,30 @@ const { oneOf } = require('../../helpers/payload-or-null')
2
2
 
3
3
  module.exports = {
4
4
  client_id: {
5
- description: 'An identifier used locally on POS for their own reference.',
6
- oneOf: [
7
- {
8
- type: 'string',
9
- maxLength: 128
10
- },
11
- {
12
- type: 'null'
13
- }
14
- ]
5
+ description: 'An identifier used locally on POS for their own reference. Guaranteed to be there',
6
+ type: 'string',
7
+ maxLength: 128
15
8
  },
16
- balance_client_id: {
9
+ balance_client_id: oneOf({
17
10
  type: 'string',
18
11
  maxLength: 128,
19
- description: 'A reference to the balance this exports belongs to.'
20
- },
21
- balance_number: {
22
- ...oneOf({
23
- type: 'integer',
24
- example: 5,
25
- description: 'The associated balance\'s counting number (receipt number) of this export'
26
- })
27
- },
28
- branch_custom_id: {
29
- ...oneOf({
30
- type: 'integer',
31
- example: 7,
32
- description: 'The branch number'
33
- })
34
- },
35
- register_custom_id: {
36
- ...oneOf({
37
- type: 'integer',
38
- example: 11,
39
- description: 'The register number'
40
- })
41
- },
12
+ description: 'A reference to the balance this exports belongs to. Can be omitted for archives.'
13
+ }),
14
+ balance_number: oneOf({
15
+ type: 'integer',
16
+ example: 5,
17
+ description: 'The associated balance\'s counting number (receipt number) of this export. Can be omitted for archives.'
18
+ }),
19
+ branch_custom_id: oneOf({
20
+ type: 'integer',
21
+ example: 7,
22
+ description: 'The branch number'
23
+ }),
24
+ register_custom_id: oneOf({
25
+ type: 'integer',
26
+ example: 11,
27
+ description: 'The register number'
28
+ }),
42
29
  register: {
43
30
  type: 'string',
44
31
  format: 'uuid',
@@ -65,47 +52,30 @@ module.exports = {
65
52
  export: {
66
53
  type: 'object',
67
54
  properties: {
68
- transaction_number_first: {
69
- type: 'integer',
70
- example: 15,
71
- description: 'The first TSE transaction number in this export'
72
- },
73
- transaction_number_last: {
74
- type: 'integer',
75
- example: 19,
76
- description: 'The last TSE transaction number in this export'
77
- },
78
- date_start: {
79
- description: 'Daterange start of the export.',
55
+ date_start: oneOf({
56
+ description: 'Daterange start of the export, omitted for archives.',
80
57
  type: 'string',
81
58
  format: 'date-time',
82
59
  example: '2020-10-17T08:12:04.849Z'
83
- },
60
+ }),
84
61
  date_end: {
85
62
  description: 'Daterange end of the export.',
86
63
  type: 'string',
87
64
  format: 'date-time',
88
65
  example: '2020-10-17T21:12:04.849Z'
89
66
  },
90
- url: {
67
+ url: oneOf({
91
68
  description: 'URL of the uploaded export tar file.',
92
69
  type: 'string',
93
70
  format: 'uri'
94
- },
71
+ }),
95
72
  type: {
96
73
  type: 'string',
97
74
  'enum': [
98
75
  'archive',
99
- 'number',
100
- 'number_interval',
101
76
  'time_period'
102
77
  ],
103
78
  default: 'time_period'
104
- },
105
- client_id: {
106
- description: 'An identifier used locally on the POS for their own reference.',
107
- type: 'string',
108
- maxLength: 128
109
79
  }
110
80
  }
111
81
  }
@@ -9,7 +9,7 @@ module.exports = {
9
9
  additionalProperties: false,
10
10
  required: [
11
11
  'tse_serial_number',
12
- 'balance_client_id'
12
+ 'export'
13
13
  ],
14
14
  properties: base,
15
15
  type: 'object'
@@ -29,9 +29,9 @@ module.exports = {
29
29
  type: 'string',
30
30
  description: 'Defines which price is chosen by default when conflict',
31
31
  enum: [
32
- 'default',
33
- 'pricebook',
34
- 'user'
32
+ 'user',
33
+ 'lowest_price',
34
+ 'highest_price'
35
35
  ]
36
36
  }),
37
37
  inheritance: oneOf({
@@ -23,6 +23,14 @@ module.exports = {
23
23
  format: 'uuid'
24
24
  }
25
25
  }),
26
+ branch_groups: oneOf({
27
+ description: 'If defined then only these branch groups (plus specified locations if any) will be using this price book',
28
+ type: 'array',
29
+ items: {
30
+ type: 'string',
31
+ format: 'uuid'
32
+ }
33
+ }),
26
34
  active: {
27
35
  type: 'boolean'
28
36
  },
@@ -4,6 +4,9 @@ module.exports = {
4
4
  type: 'object',
5
5
  // additional properties are a little bit of a danger zone of not being validated by the upstream service
6
6
  additionalProperties: true,
7
+ required: [
8
+ 'q'
9
+ ],
7
10
  properties: {
8
11
  q: {
9
12
  type: 'string',
@@ -33,6 +33,14 @@ module.exports = {
33
33
  maxLength: 3
34
34
  },
35
35
  quantity: {
36
+ type: 'number',
37
+ description: 'Number of times the addon is applied to the cart item. Respects the max_quantity setting on the Addon',
38
+ example: 3.6,
39
+ minimum: -32767.000,
40
+ maximum: 32767.000,
41
+ multipleOf: 0.001
42
+ },
43
+ stock_quantity: {
36
44
  type: 'number',
37
45
  description: 'The quantity of this addon, e.g. 1 pc or 0.125kg - this does never affect the price (only used for stock).',
38
46
  example: 3.6,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.100.2",
3
+ "version": "6.103.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",