@tillhub/schemas 6.320.0 → 6.321.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,11 @@
|
|
|
1
|
+
# [6.321.0](https://github.com/tillhub/schemas/compare/v6.320.0...v6.321.0) (2024-06-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **promotions:** rename compiled js field ([60eaeba](https://github.com/tillhub/schemas/commit/60eaeba))
|
|
7
|
+
* **transactions:** promotions ([1505e0b](https://github.com/tillhub/schemas/commit/1505e0b))
|
|
8
|
+
|
|
1
9
|
# [6.320.0](https://github.com/tillhub/schemas/compare/v6.319.0...v6.320.0) (2024-06-20)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -26,6 +26,13 @@ module.exports = {
|
|
|
26
26
|
example: '5ad2351d-9a67-45f9-ad4f-0abcbefa9037',
|
|
27
27
|
description: 'The payment_option ressource id'
|
|
28
28
|
},
|
|
29
|
+
payment_option_id: {
|
|
30
|
+
...oneOf({
|
|
31
|
+
type: 'integer',
|
|
32
|
+
example: 131,
|
|
33
|
+
description: 'Legacy id of the payment option'
|
|
34
|
+
})
|
|
35
|
+
},
|
|
29
36
|
payment_option_name: {
|
|
30
37
|
...oneOf({
|
|
31
38
|
type: 'string',
|
|
@@ -88,6 +95,13 @@ module.exports = {
|
|
|
88
95
|
example: 1850,
|
|
89
96
|
description: 'The daily discrepancy between calculated and counted amounts, POS: counted - calculated, not available anymore for non-cash types (e.g. terminal) (in cent-format: 1267 == 12.67€)'
|
|
90
97
|
})
|
|
98
|
+
},
|
|
99
|
+
exchangeRate: {
|
|
100
|
+
...oneOf({
|
|
101
|
+
type: 'number',
|
|
102
|
+
example: 1.403,
|
|
103
|
+
description: 'Exchange rate of the payment option, not used.'
|
|
104
|
+
})
|
|
91
105
|
}
|
|
92
106
|
}
|
|
93
107
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const { oneOf } = require('../../../../../helpers/payload-or-null')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
description: 'Promotion details applied on a transaction',
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
id: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
format: 'uuid',
|
|
11
|
+
example: 'AB3847a66-97dc-4ac2-8e8a-c44920e1f22f',
|
|
12
|
+
description: 'Identifier of the promotion used.'
|
|
13
|
+
},
|
|
14
|
+
name: oneOf({
|
|
15
|
+
type: 'string',
|
|
16
|
+
example: 'Summer Sale',
|
|
17
|
+
maxLength: 128,
|
|
18
|
+
description: 'Name of the promotion.'
|
|
19
|
+
}),
|
|
20
|
+
compiled: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
example: 'IWZ1bmN0aW9uKHQpe2lmKCJvYmplY3QiPT10eXBlb2YgZXhwb3J0cyYmInVuZGVmaW5lZCIhPXR5cGVvZiBtb2R1bGUpbW9kdWxlLmV4cG9ydHM9dCgpO2Vsc2UgaWYoImZ1bmN0aW9uIj09dHlwZW9mIGRlZmluZSYmZGVmaW5lLmFtZClkZWZpbmUoW10sdCk7ZWxzZXsoInVuZGVmaW5lZCIhPXR5cGVvZiB3aW5kb3c/d2luZG93OiJ1bmRlZmluZWQiIT10eXBlb2YgZ2xvYmFsP2dsb2JhbDoidW5kZWZpbmVkIiE9dHlwZW9mIHNlbGY/c2VsZjp0aGlzKS5tYWluPXQoKX19KGZ1bmN0aW9uKCl7cmV0dXJuIGZ1bmN0aW9uKCl7cmV0dXJuIGZ1bmN0aW9uIHQoZSxvLHIpe2Z1bmN0aW9uIG4odSxpKXtpZighb1t1XSl7aWYoIWVbdV0pe3ZhciBzPSJmdW5jdGlvbiI9PXR5cGVvZiByZXF1aXJlJiZyZXF1aXJlO2lmKCFpJiZzKXJldHVybiBzKHUsITApO2lmKGYpcmV0dXJuIGYod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ldHVybiBvO2xldCBsPTA7Zm9yKGxldCB0IG9mIGUpe2NvbnN0IGU9dC5xdHk7aWYoIShNYXRoLmNlaWwoKGwrdC5xdHkpLzEpPD1zKSl7aWYobHx8cyl7Y29uc3Qgcj0xKnMtbCxuPXIqZix1PShlLXIpKih0LmFtb3VudF90b3RhbF9ncm9zcy9lKTt0LnByb21vdGVkX3RvdGFsX2dyb3NzPWEobit1LDIpLHQucHJvbW90YWJsZV9xdHk9cixkZWxldGUgdC5hbW91bnRfdG90YWxfZ3Jvc3Msby5wdXNoKHQpLHM9MH1icmVha31zLT1NYXRoLmZsb29yKChsK2UpLzEpLGw9KGwrZSklMSx0LnByb21vdGVkX3RvdGFsX2dyb3NzPWEoZSpmLDIpLHQucHJvbW90YWJsZV9xdHk9ZSxkZWxldGUgdC5hbW91bnRfdG90YWxfZ3Jvc3Msby5wdXNoKHQpfXJldHVybiBvO2Z1bmN0aW9uIGEodCxlKXtyZXR1cm4gTnVtYmVyKE1hdGgucm91bmQodCsiZSIrZSkrImUtIitlKX19fSx7fV19LHt9LFsxXSkoMSl9KTs=',
|
|
23
|
+
description: 'Base64 of the promotion function'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -6,6 +6,7 @@ const relatedObject = require('../components/embedded/reference/related')
|
|
|
6
6
|
const dependsObject = require('../components/embedded/reference/depends')
|
|
7
7
|
const originObject = require('../components/embedded/reference/origin')
|
|
8
8
|
const gastroOrderOrigin = require('../../../common/gastro_order_origin')
|
|
9
|
+
const promotionObject = require('../components/embedded/promotions/base')
|
|
9
10
|
|
|
10
11
|
module.exports = {
|
|
11
12
|
dev_uuid: {
|
|
@@ -372,6 +373,17 @@ module.exports = {
|
|
|
372
373
|
default: false,
|
|
373
374
|
description: 'If true, the transaction contains items modified by the promotion engine'
|
|
374
375
|
}),
|
|
376
|
+
applied_promotions: oneOf({
|
|
377
|
+
type: 'array',
|
|
378
|
+
description: stripIndents`
|
|
379
|
+
A list of Tillhub promotion details applied to this transaction.
|
|
380
|
+
|
|
381
|
+
V3 promotions will have only 1 entry as they are restricted by a barcode match.
|
|
382
|
+
`,
|
|
383
|
+
items: {
|
|
384
|
+
...promotionObject
|
|
385
|
+
}
|
|
386
|
+
}),
|
|
375
387
|
branch: oneOf({
|
|
376
388
|
type: 'string',
|
|
377
389
|
format: 'uuid',
|