@tillhub/schemas 6.102.0 → 6.106.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 +40 -0
- package/lib/v0/loyalty_abocard_systems/base.js +22 -1
- package/lib/v0/product_addons/base.js +6 -1
- package/lib/v0/safes/book.js +2 -1
- package/lib/v0/safes_log_book/base.js +1 -0
- package/lib/v1/carts/items/create.js +2 -1
- package/lib/v1/products/index.js +4 -0
- package/lib/v1/products/prices/actual/query.js +34 -0
- package/lib/v1/products/prices/actual/response.js +16 -0
- package/lib/v1/transactions/components/embedded/addon/base.js +8 -0
- package/lib/v1/transactions/components/embedded/discount/base.js +5 -2
- package/lib/v1/transactions/components/embedded/voucher/base.js +7 -1
- package/lib/v1/transactions/legacy/items/base.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
+
# [6.106.0](https://github.com/tillhub/schemas/compare/v6.105.0...v6.106.0) (2021-12-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **transactions:** items ([876dc02](https://github.com/tillhub/schemas/commit/876dc02))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **transactions:** legacy ([eb5ae77](https://github.com/tillhub/schemas/commit/eb5ae77))
|
|
12
|
+
* **transactions:** legacy ([910471b](https://github.com/tillhub/schemas/commit/910471b))
|
|
13
|
+
|
|
14
|
+
# [6.105.0](https://github.com/tillhub/schemas/compare/v6.104.0...v6.105.0) (2021-12-13)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **abocard-systems:** fixes due to linter ([49ddbc3](https://github.com/tillhub/schemas/commit/49ddbc3))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **abocard:** Add "discount_type" and "selling_price_method" ([#649](https://github.com/tillhub/schemas/issues/649)) ([b2024de](https://github.com/tillhub/schemas/commit/b2024de))
|
|
25
|
+
* **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)
|
|
26
|
+
|
|
27
|
+
# [6.104.0](https://github.com/tillhub/schemas/compare/v6.103.0...v6.104.0) (2021-12-07)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* **safes:** add pos_to_safe_cancel ([2f0dfda](https://github.com/tillhub/schemas/commit/2f0dfda))
|
|
33
|
+
|
|
34
|
+
# [6.103.0](https://github.com/tillhub/schemas/compare/v6.102.0...v6.103.0) (2021-11-08)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* **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))
|
|
40
|
+
|
|
1
41
|
# [6.102.0](https://github.com/tillhub/schemas/compare/v6.101.0...v6.102.0) (2021-11-03)
|
|
2
42
|
|
|
3
43
|
|
|
@@ -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
|
-
|
|
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',
|
package/lib/v0/safes/book.js
CHANGED
package/lib/v1/products/index.js
CHANGED
|
@@ -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,
|
|
@@ -88,7 +88,8 @@ module.exports = {
|
|
|
88
88
|
'sconto',
|
|
89
89
|
'item',
|
|
90
90
|
'promotion',
|
|
91
|
-
'voucher'
|
|
91
|
+
'voucher',
|
|
92
|
+
'product_voucher'
|
|
92
93
|
]
|
|
93
94
|
}),
|
|
94
95
|
name: {
|
|
@@ -132,7 +133,9 @@ module.exports = {
|
|
|
132
133
|
'item',
|
|
133
134
|
'customer',
|
|
134
135
|
'promotion',
|
|
135
|
-
'sconto'
|
|
136
|
+
'sconto',
|
|
137
|
+
'voucher',
|
|
138
|
+
'product_voucher'
|
|
136
139
|
]
|
|
137
140
|
},
|
|
138
141
|
{
|
|
@@ -123,6 +123,10 @@ module.exports = {
|
|
|
123
123
|
maxLength: 2048,
|
|
124
124
|
description: 'Messages from voucher processing.'
|
|
125
125
|
},
|
|
126
|
+
creation: oneOf({
|
|
127
|
+
type: 'object',
|
|
128
|
+
description: 'Client specified container to store created abocards and/or vouchers.'
|
|
129
|
+
}),
|
|
126
130
|
type: {
|
|
127
131
|
type: 'string',
|
|
128
132
|
description: 'Mainly legacy support for Fleurop flows.',
|
|
@@ -136,7 +140,9 @@ module.exports = {
|
|
|
136
140
|
'tillhub_create', // formerly 6
|
|
137
141
|
'tillhub_recharge', // formerly 7
|
|
138
142
|
'tillhub_reedeem', // formerly 8
|
|
139
|
-
'tillhub_percentage' // formerly 9
|
|
143
|
+
'tillhub_percentage', // formerly 9
|
|
144
|
+
'tillhub_product', // ...
|
|
145
|
+
'tillhub_abocard_sell' // ...
|
|
140
146
|
]
|
|
141
147
|
},
|
|
142
148
|
status: {
|
|
@@ -285,7 +285,6 @@ module.exports = {
|
|
|
285
285
|
})
|
|
286
286
|
},
|
|
287
287
|
discounts: {
|
|
288
|
-
deprecated: true,
|
|
289
288
|
...oneOf({
|
|
290
289
|
type: 'array',
|
|
291
290
|
items: {
|
|
@@ -306,7 +305,8 @@ module.exports = {
|
|
|
306
305
|
'sconto', // originated from rounding currencies that do not use a 0.01 physical unit, e.g. CHF
|
|
307
306
|
'item', // discounts that can only be used per item
|
|
308
307
|
'promotion', // originated from applying the outcome of a promotion
|
|
309
|
-
'voucher' // originated from applying a percentage voucher
|
|
308
|
+
'voucher', // originated from applying a percentage voucher
|
|
309
|
+
'product_voucher' // originated from applying a voucher bound to a product
|
|
310
310
|
],
|
|
311
311
|
description: 'The group type of discount (type was taken)'
|
|
312
312
|
},
|
|
@@ -410,6 +410,8 @@ module.exports = {
|
|
|
410
410
|
'voucher_is_locked', // If is_voucher, indicates the locked state within the API
|
|
411
411
|
'voucher_message', // If is_voucher, collected messages from voucher processing API calls
|
|
412
412
|
'voucher_title', // If is_voucher, a currently not used custom title
|
|
413
|
+
'voucher_linked_product', // If is_voucher and of type product, the id of the affected product
|
|
414
|
+
'voucher_creation', // If is_voucher and it involves creation of vocuhers or abocards - a stringified JSON of the relevant contents
|
|
413
415
|
/*
|
|
414
416
|
the voucher_type enum:
|
|
415
417
|
[
|