@tillhub/schemas 6.213.0 → 6.215.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 +15 -0
- package/lib/common/permissions.js +9 -1
- 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/transactions/legacy/base.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [6.215.0](https://github.com/tillhub/schemas/compare/v6.214.0...v6.215.0) (2023-05-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **countings:** protocols ([4e235f0](https://github.com/tillhub/schemas/commit/4e235f0))
|
|
7
|
+
* **wallets:** references ([79f22d5](https://github.com/tillhub/schemas/commit/79f22d5))
|
|
8
|
+
|
|
9
|
+
# [6.214.0](https://github.com/tillhub/schemas/compare/v6.213.0...v6.214.0) (2023-05-02)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **permissions:** wallets ([392ee87](https://github.com/tillhub/schemas/commit/392ee87))
|
|
15
|
+
|
|
1
16
|
# [6.213.0](https://github.com/tillhub/schemas/compare/v6.212.0...v6.213.0) (2023-04-27)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -133,7 +133,15 @@ module.exports.staff = {
|
|
|
133
133
|
'staff:staff:orders:others:locked:modify', // allows modifying other staffs' orders (gastro)
|
|
134
134
|
'staff:staff:orders:preview:print', // allows printing previews for unpaid orders (gastro)
|
|
135
135
|
'staff:staff:cart:clear', // Can clear the current cart
|
|
136
|
-
'staff:staff:cart:clear:row' // Can remove items from the cart
|
|
136
|
+
'staff:staff:cart:clear:row', // Can remove items from the cart
|
|
137
|
+
'staff:staff:wallets', // General access and all rights below
|
|
138
|
+
'staff:staff:wallets:create', // Can create wallets
|
|
139
|
+
'staff:staff:wallets:update', // Can update wallets
|
|
140
|
+
'staff:staff:wallets:read', // Can read wallets
|
|
141
|
+
'staff:staff:wallets:assign', // Assign Waiter Wallets to Waiters
|
|
142
|
+
'staff:staff:wallets:transfer', // Transfer cash between the main till and any Waiter Wallet to create the Starting Balance for a Wallet.
|
|
143
|
+
'staff:staff:wallets:discrepancy', // Accept discrepancies for not matching closing balances for individual Waiter Wallets
|
|
144
|
+
'staff:staff:wallets:activation' // Activate and deactivate Waiter Wallets
|
|
137
145
|
]
|
|
138
146
|
}
|
|
139
147
|
}
|
|
@@ -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
|
+
}
|
|
@@ -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`
|