@tillhub/schemas 6.101.0 → 6.105.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,37 @@
1
+ # [6.105.0](https://github.com/tillhub/schemas/compare/v6.104.0...v6.105.0) (2021-12-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **abocard-systems:** fixes due to linter ([49ddbc3](https://github.com/tillhub/schemas/commit/49ddbc3))
7
+
8
+
9
+ ### Features
10
+
11
+ * **abocard:** Add "discount_type" and "selling_price_method" ([#649](https://github.com/tillhub/schemas/issues/649)) ([b2024de](https://github.com/tillhub/schemas/commit/b2024de))
12
+ * **prices:** add actual prices schema #API-1257 ([2260e72](https://github.com/tillhub/schemas/commit/2260e72)), closes [#API-1257](https://github.com/tillhub/schemas/issues/API-1257)
13
+
14
+ # [6.104.0](https://github.com/tillhub/schemas/compare/v6.103.0...v6.104.0) (2021-12-07)
15
+
16
+
17
+ ### Features
18
+
19
+ * **safes:** add pos_to_safe_cancel ([2f0dfda](https://github.com/tillhub/schemas/commit/2f0dfda))
20
+
21
+ # [6.103.0](https://github.com/tillhub/schemas/compare/v6.102.0...v6.103.0) (2021-11-08)
22
+
23
+
24
+ ### Features
25
+
26
+ * **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))
27
+
28
+ # [6.102.0](https://github.com/tillhub/schemas/compare/v6.101.0...v6.102.0) (2021-11-03)
29
+
30
+
31
+ ### Features
32
+
33
+ * **pricebook:** add lowest_price, highest_price ([2c55b20](https://github.com/tillhub/schemas/commit/2c55b20))
34
+
1
35
  # [6.101.0](https://github.com/tillhub/schemas/compare/v6.100.3...v6.101.0) (2021-10-29)
2
36
 
3
37
 
@@ -231,7 +231,28 @@ const request = {
231
231
  description: 'Defines whether assigning a customer is required for creation actions within this system.',
232
232
  type: 'boolean',
233
233
  default: 'false'
234
- })
234
+ }),
235
+ discount_type: oneOf(
236
+ {
237
+ description: `
238
+ the calculation type of the discount of the Purpose Product (Zweck/Artikel).
239
+ * \`relative\` - stores discount absolute in currency of system
240
+ * \`absolute\` - stores relative discount value in percent (e.g.: 12,58%) to allow two decimals on percent if necessary (which wouldn’t be possible with a rate)
241
+ `,
242
+ type: 'string',
243
+ enum: ['relative', 'absolute']
244
+ },
245
+ { default: null }
246
+ ),
247
+ selling_price_method: {
248
+ description: `
249
+ "static", "dynamic" configuration of selling price.
250
+ * \`static\` - For "static" we use the current behavior of our implementation.
251
+ * \`dynamic\` - For "dynamic" we calculate the selling price according to this document
252
+ `,
253
+ enum: ['static', 'dynamic'],
254
+ default: 'static'
255
+ }
235
256
  }
236
257
 
237
258
  const response = {
@@ -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',
@@ -36,7 +36,8 @@ module.exports.request = {
36
36
  transfer_type: {
37
37
  type: 'string',
38
38
  enum: [
39
- 'pos_to_safe'
39
+ 'pos_to_safe',
40
+ 'pos_to_safe_cancel'
40
41
  ]
41
42
  }
42
43
  }
@@ -37,6 +37,7 @@ module.exports = {
37
37
  'safe_to_safe',
38
38
  'safe_to_bank',
39
39
  'pos_to_safe',
40
+ 'pos_to_safe_cancel',
40
41
  'safe_to_expense'
41
42
  ]
42
43
  },
@@ -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({
@@ -159,6 +159,10 @@ module.exports.prices = {
159
159
  }
160
160
  }
161
161
  }
162
+ },
163
+ actual: {
164
+ query: require('./prices/actual/query'),
165
+ response: require('./prices/actual/response')
162
166
  }
163
167
  }
164
168
 
@@ -0,0 +1,34 @@
1
+ module.exports = {
2
+ $id: 'https://schemas.tillhub.com/v1/products.prices.actual.query.schema.json',
3
+ $schema: 'http://json-schema.org/draft-07/schema#',
4
+ additionalProperties: false,
5
+ type: 'object',
6
+ required: [
7
+ 'location'
8
+ ],
9
+ properties: {
10
+ product_id: {
11
+ description: 'Product ID (required if no "product_custom_id" provided)',
12
+ type: 'string',
13
+ format: 'uuid',
14
+ example: 'fd4bac62-937b-445f-b7bf-fb9e653de50f'
15
+ },
16
+ product_custom_id: {
17
+ description: 'Product custom ID',
18
+ type: 'string',
19
+ example: '936835 1234'
20
+ },
21
+ location: {
22
+ description: 'Product location',
23
+ type: 'string',
24
+ format: 'uuid',
25
+ example: '69ac1b92-7956-43d8-8620-e556299b5023'
26
+ },
27
+ quantity: {
28
+ description: 'Product quantity (to search among product scaled price embedded in product only)',
29
+ type: 'integer',
30
+ minimum: 0,
31
+ example: 3
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,16 @@
1
+ const priceBookEntryBase = require('../book/entry').base
2
+
3
+ module.exports = {
4
+ $id: 'https://schemas.tillhub.com/v1/products.prices.actual.response.schema.json',
5
+ $schema: 'http://json-schema.org/draft-07/schema#',
6
+ additionalProperties: false,
7
+ type: 'object',
8
+ required: [
9
+ ],
10
+ properties: {
11
+ amount_net: priceBookEntryBase.amount_net,
12
+ amount_gross: priceBookEntryBase.amount_gross,
13
+ rate: priceBookEntryBase.rate,
14
+ currency: priceBookEntryBase.currency
15
+ }
16
+ }
@@ -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.101.0",
3
+ "version": "6.105.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",