@tillhub/schemas 6.214.0 → 6.216.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 +18 -0
- package/lib/v0/cashier_counting_protocols/base.js +8 -1
- package/lib/v1/balances/legacy/base.js +4 -0
- package/lib/v1/balances/legacy/embedded/wallet_data/base.js +22 -0
- package/lib/v1/balances/legacy/embedded/wallet_data/wallet.js +25 -0
- package/lib/v1/configurations/items/products.js +41 -0
- package/lib/v1/transactions/legacy/base.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# [6.216.0](https://github.com/tillhub/schemas/compare/v6.215.0...v6.216.0) (2023-05-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **configurations:** products ([7454cc0](https://github.com/tillhub/schemas/commit/7454cc0))
|
|
7
|
+
* **configurations:** products ([cf8184c](https://github.com/tillhub/schemas/commit/cf8184c))
|
|
8
|
+
* **configurations:** products ([b5b62d1](https://github.com/tillhub/schemas/commit/b5b62d1))
|
|
9
|
+
* **configurations:** products ([83dc63f](https://github.com/tillhub/schemas/commit/83dc63f))
|
|
10
|
+
|
|
11
|
+
# [6.215.0](https://github.com/tillhub/schemas/compare/v6.214.0...v6.215.0) (2023-05-17)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **countings:** protocols ([4e235f0](https://github.com/tillhub/schemas/commit/4e235f0))
|
|
17
|
+
* **wallets:** references ([79f22d5](https://github.com/tillhub/schemas/commit/79f22d5))
|
|
18
|
+
|
|
1
19
|
# [6.214.0](https://github.com/tillhub/schemas/compare/v6.213.0...v6.214.0) (2023-05-02)
|
|
2
20
|
|
|
3
21
|
|
|
@@ -45,6 +45,11 @@ module.exports = {
|
|
|
45
45
|
}),
|
|
46
46
|
default: null
|
|
47
47
|
},
|
|
48
|
+
wallet: oneOf({
|
|
49
|
+
type: 'string',
|
|
50
|
+
format: 'uuid',
|
|
51
|
+
description: 'Id of the Tillhub wallet resource - applicable to counting type: wallet'
|
|
52
|
+
}),
|
|
48
53
|
client_id: oneOf({
|
|
49
54
|
type: 'string',
|
|
50
55
|
description: 'A client definable ID for the purpose of syncing to a client or used in analytics for e.g. transactions that created a product offline and done transactions offline before they received a backend ID.',
|
|
@@ -195,7 +200,9 @@ module.exports = {
|
|
|
195
200
|
type: 'string',
|
|
196
201
|
enum: [
|
|
197
202
|
'opening',
|
|
198
|
-
'cashing_up'
|
|
203
|
+
'cashing_up',
|
|
204
|
+
'wallet_open',
|
|
205
|
+
'wallet_close'
|
|
199
206
|
]
|
|
200
207
|
},
|
|
201
208
|
counting_date: {
|
|
@@ -7,6 +7,7 @@ const balanceExpensesObject = require('./embedded/expenses/base')
|
|
|
7
7
|
const balancePaymentsObject = require('./embedded/payments/base')
|
|
8
8
|
const balanceCashUnitsObject = require('./embedded/cash_units/base')
|
|
9
9
|
const balanceTipsObject = require('./embedded/tips/base')
|
|
10
|
+
const balanceWalletDataObject = require('./embedded/wallet_data/base')
|
|
10
11
|
const balanceExtendedObject = require('./embedded/extended')
|
|
11
12
|
const balanceMetadataObject = require('./embedded/metadata')
|
|
12
13
|
|
|
@@ -284,5 +285,8 @@ module.exports = {
|
|
|
284
285
|
}),
|
|
285
286
|
_metadata: oneOf({
|
|
286
287
|
...balanceMetadataObject
|
|
288
|
+
}),
|
|
289
|
+
wallet_data: oneOf({
|
|
290
|
+
...balanceWalletDataObject
|
|
287
291
|
})
|
|
288
292
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { oneOf } = require('../../../../../helpers/payload-or-null')
|
|
2
|
+
const currencyAmount = require('../../../../../common/currency_amount')
|
|
3
|
+
const balanceWalletObject = require('./wallet')
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
description: 'Balance stats for waiter wallets',
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
outstanding_total: oneOf({
|
|
11
|
+
description: 'The outstanding cash from all wallets at the time of the balance',
|
|
12
|
+
...currencyAmount
|
|
13
|
+
}),
|
|
14
|
+
wallets: oneOf({
|
|
15
|
+
type: 'array',
|
|
16
|
+
description: 'Wallet balance objects',
|
|
17
|
+
items: {
|
|
18
|
+
...balanceWalletObject
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { oneOf } = require('../../../../../helpers/payload-or-null')
|
|
2
|
+
const currencyAmount = require('../../../../../common/currency_amount')
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
description: 'Cash balance for a specific wallet',
|
|
6
|
+
additionalProperties: false,
|
|
7
|
+
type: 'object',
|
|
8
|
+
required: [
|
|
9
|
+
'id'
|
|
10
|
+
],
|
|
11
|
+
properties: {
|
|
12
|
+
id: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
example: '860defb8-5598-421d-9da4-f0826e767536',
|
|
15
|
+
format: 'uuid',
|
|
16
|
+
description: 'The Tillhub wallet resource ID'
|
|
17
|
+
},
|
|
18
|
+
outstanding: {
|
|
19
|
+
...oneOf({
|
|
20
|
+
description: 'The outstanding cash for this wallet at the time of the balance',
|
|
21
|
+
...currencyAmount
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -45,6 +45,47 @@ module.exports = {
|
|
|
45
45
|
})
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
pricelist: oneOf({
|
|
49
|
+
type: 'object',
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
properties: {
|
|
52
|
+
type_precedence: oneOf({
|
|
53
|
+
type: 'object',
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
properties: {
|
|
56
|
+
enabled: {
|
|
57
|
+
description: 'If true - price type precedence should be respected.',
|
|
58
|
+
type: 'boolean',
|
|
59
|
+
default: true
|
|
60
|
+
},
|
|
61
|
+
priorities: oneOf({
|
|
62
|
+
description: 'Price types sorted by priority.',
|
|
63
|
+
type: 'array',
|
|
64
|
+
uniqueItems: true,
|
|
65
|
+
default: ['scaled', 'time-based', 'branch'],
|
|
66
|
+
items: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
enum: [
|
|
69
|
+
'time-based',
|
|
70
|
+
'branch',
|
|
71
|
+
'scaled'
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
conflict_resolution: oneOf({
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: 'Defines which price is chosen by default when conflicts remain with or without type precedence.',
|
|
80
|
+
default: 'lowest_price',
|
|
81
|
+
enum: [
|
|
82
|
+
'user', // present the options to the cashier
|
|
83
|
+
'lowest_price',
|
|
84
|
+
'highest_price'
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
48
89
|
product_id_template: {
|
|
49
90
|
description: 'A Tillhub string pattern that allows for parameterized product id generation',
|
|
50
91
|
oneOf: [
|
|
@@ -376,6 +376,11 @@ module.exports = {
|
|
|
376
376
|
format: 'uuid',
|
|
377
377
|
description: 'Id of the Tillhub register resource'
|
|
378
378
|
}),
|
|
379
|
+
wallet: oneOf({
|
|
380
|
+
type: 'string',
|
|
381
|
+
format: 'uuid',
|
|
382
|
+
description: 'Id of the Tillhub wallet resource'
|
|
383
|
+
}),
|
|
379
384
|
_type: oneOf({
|
|
380
385
|
type: 'string',
|
|
381
386
|
description: stripIndents`
|