@tillhub/schemas 6.337.0 → 6.339.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 +14 -0
- package/lib/v1/configurations/items/payments.js +5 -0
- package/lib/v1/products/base.js +6 -60
- package/lib/v1/products/properties/children.js +50 -0
- package/lib/v1/products/properties/images.js +52 -0
- package/lib/v1/products/properties/options.js +67 -0
- package/lib/v1/transactions/legacy/items/base.js +8 -8
- package/lib/v1/transactions/legacy/payments/base.js +7 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [6.339.0](https://github.com/tillhub/schemas/compare/v6.338.0...v6.339.0) (2024-09-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **configuration:** split payment feature flag ([adeb0b1](https://github.com/tillhub/schemas/commit/adeb0b1))
|
|
7
|
+
|
|
8
|
+
# [6.338.0](https://github.com/tillhub/schemas/compare/v6.337.0...v6.338.0) (2024-08-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **transactions:** cart_item ([ff21d8f](https://github.com/tillhub/schemas/commit/ff21d8f))
|
|
14
|
+
|
|
1
15
|
# [6.337.0](https://github.com/tillhub/schemas/compare/v6.336.0...v6.337.0) (2024-08-19)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -39,6 +39,11 @@ module.exports = {
|
|
|
39
39
|
format: 'uuid'
|
|
40
40
|
}
|
|
41
41
|
}),
|
|
42
|
+
allow_split_by_person: oneOf({
|
|
43
|
+
description: 'If true, allows split by person',
|
|
44
|
+
default: false,
|
|
45
|
+
type: 'boolean'
|
|
46
|
+
}),
|
|
42
47
|
allow_refund_split: oneOf({
|
|
43
48
|
description: 'If true, allows multiple payments on negative cart totals, e.g. undefined + cash (e.g. health insurance case).',
|
|
44
49
|
default: false,
|
package/lib/v1/products/base.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const { anyOf, oneOf } = require('../../helpers/payload-or-null')
|
|
2
2
|
const locationType = require('../../common/location_type')
|
|
3
3
|
const customProperties = require('../../common/custom_properties')
|
|
4
|
+
const productImages = require('./properties/images')
|
|
5
|
+
const productChildren = require('./properties/children')
|
|
6
|
+
const productOptions = require('./properties/options')
|
|
4
7
|
|
|
5
8
|
const stockConfigurationLocation = {
|
|
6
9
|
type: 'array',
|
|
@@ -89,6 +92,8 @@ const request = {
|
|
|
89
92
|
}
|
|
90
93
|
]
|
|
91
94
|
},
|
|
95
|
+
options: productOptions,
|
|
96
|
+
children: productChildren,
|
|
92
97
|
tags: {
|
|
93
98
|
anyOf: [
|
|
94
99
|
{
|
|
@@ -547,63 +552,7 @@ const request = {
|
|
|
547
552
|
}
|
|
548
553
|
]
|
|
549
554
|
},
|
|
550
|
-
images:
|
|
551
|
-
oneOf: [
|
|
552
|
-
{
|
|
553
|
-
type: 'object',
|
|
554
|
-
additionalProperties: false,
|
|
555
|
-
properties: {
|
|
556
|
-
'original': oneOf({
|
|
557
|
-
type: 'string',
|
|
558
|
-
format: 'uri'
|
|
559
|
-
}, { default: null }),
|
|
560
|
-
'1x': oneOf({
|
|
561
|
-
type: 'string',
|
|
562
|
-
format: 'uri'
|
|
563
|
-
}, { default: null }),
|
|
564
|
-
'2x': oneOf({
|
|
565
|
-
type: 'string',
|
|
566
|
-
format: 'uri'
|
|
567
|
-
}, { default: null }),
|
|
568
|
-
'3x': oneOf({
|
|
569
|
-
type: 'string',
|
|
570
|
-
format: 'uri'
|
|
571
|
-
}, { default: null }),
|
|
572
|
-
lia_1x: oneOf({
|
|
573
|
-
type: 'string',
|
|
574
|
-
format: 'uri'
|
|
575
|
-
}, { default: null }),
|
|
576
|
-
lia_2x: oneOf({
|
|
577
|
-
type: 'string',
|
|
578
|
-
format: 'uri'
|
|
579
|
-
}, { default: null }),
|
|
580
|
-
lia_3x: oneOf({
|
|
581
|
-
type: 'string',
|
|
582
|
-
format: 'uri'
|
|
583
|
-
}, { default: null }),
|
|
584
|
-
square_1x: oneOf({
|
|
585
|
-
type: 'string',
|
|
586
|
-
format: 'uri'
|
|
587
|
-
}, { default: null }),
|
|
588
|
-
square_2x: oneOf({
|
|
589
|
-
type: 'string',
|
|
590
|
-
format: 'uri'
|
|
591
|
-
}, { default: null }),
|
|
592
|
-
square_3x: oneOf({
|
|
593
|
-
type: 'string',
|
|
594
|
-
format: 'uri'
|
|
595
|
-
}, { default: null }),
|
|
596
|
-
avatar: {
|
|
597
|
-
type: 'string',
|
|
598
|
-
format: 'uri'
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
type: 'null'
|
|
604
|
-
}
|
|
605
|
-
]
|
|
606
|
-
},
|
|
555
|
+
images: productImages,
|
|
607
556
|
insert_id: {
|
|
608
557
|
type: 'integer'
|
|
609
558
|
},
|
|
@@ -738,9 +687,6 @@ const request = {
|
|
|
738
687
|
type: 'string',
|
|
739
688
|
format: 'uuid'
|
|
740
689
|
}
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
type: 'null'
|
|
744
690
|
}),
|
|
745
691
|
components: {
|
|
746
692
|
description: 'An array of components for composed product (the type is "composed_product")',
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const { oneOf } = require('../../../helpers/payload-or-null')
|
|
2
|
+
const productImages = require('./images')
|
|
3
|
+
|
|
4
|
+
module.exports = oneOf({
|
|
5
|
+
description: 'Available children for variant parent products',
|
|
6
|
+
type: 'array',
|
|
7
|
+
items: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
id: {
|
|
11
|
+
description: 'Product ressource for full child product',
|
|
12
|
+
type: 'string',
|
|
13
|
+
format: 'uuid'
|
|
14
|
+
},
|
|
15
|
+
name: oneOf({
|
|
16
|
+
description: 'Name of the child product',
|
|
17
|
+
type: 'string',
|
|
18
|
+
example: 'Shirt S rot'
|
|
19
|
+
}),
|
|
20
|
+
custom_id: oneOf({
|
|
21
|
+
description: 'Product number of the child product',
|
|
22
|
+
type: 'string',
|
|
23
|
+
example: 'P0000001046TEST280824-1'
|
|
24
|
+
}),
|
|
25
|
+
attributes: oneOf({
|
|
26
|
+
type: 'object',
|
|
27
|
+
description: 'A dictionary <string, string> describing all values for the specific child',
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
maxProperties: 32,
|
|
30
|
+
patternProperties: {
|
|
31
|
+
'^.{1,256}$': { type: 'string' }
|
|
32
|
+
},
|
|
33
|
+
example: {
|
|
34
|
+
'Color': 'blue',
|
|
35
|
+
'Size': 'S'
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
images: productImages,
|
|
39
|
+
barcodes: oneOf({
|
|
40
|
+
description: 'Product barcodes',
|
|
41
|
+
type: 'array',
|
|
42
|
+
items: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
maxLength: 1024,
|
|
45
|
+
example: 'ABC-abc-1234'
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const { oneOf } = require('../../../helpers/payload-or-null')
|
|
2
|
+
|
|
3
|
+
module.exports = oneOf({
|
|
4
|
+
type: 'object',
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
properties: {
|
|
7
|
+
'original': oneOf({
|
|
8
|
+
type: 'string',
|
|
9
|
+
format: 'uri'
|
|
10
|
+
}, { default: null }),
|
|
11
|
+
'1x': oneOf({
|
|
12
|
+
type: 'string',
|
|
13
|
+
format: 'uri'
|
|
14
|
+
}, { default: null }),
|
|
15
|
+
'2x': oneOf({
|
|
16
|
+
type: 'string',
|
|
17
|
+
format: 'uri'
|
|
18
|
+
}, { default: null }),
|
|
19
|
+
'3x': oneOf({
|
|
20
|
+
type: 'string',
|
|
21
|
+
format: 'uri'
|
|
22
|
+
}, { default: null }),
|
|
23
|
+
lia_1x: oneOf({
|
|
24
|
+
type: 'string',
|
|
25
|
+
format: 'uri'
|
|
26
|
+
}, { default: null }),
|
|
27
|
+
lia_2x: oneOf({
|
|
28
|
+
type: 'string',
|
|
29
|
+
format: 'uri'
|
|
30
|
+
}, { default: null }),
|
|
31
|
+
lia_3x: oneOf({
|
|
32
|
+
type: 'string',
|
|
33
|
+
format: 'uri'
|
|
34
|
+
}, { default: null }),
|
|
35
|
+
square_1x: oneOf({
|
|
36
|
+
type: 'string',
|
|
37
|
+
format: 'uri'
|
|
38
|
+
}, { default: null }),
|
|
39
|
+
square_2x: oneOf({
|
|
40
|
+
type: 'string',
|
|
41
|
+
format: 'uri'
|
|
42
|
+
}, { default: null }),
|
|
43
|
+
square_3x: oneOf({
|
|
44
|
+
type: 'string',
|
|
45
|
+
format: 'uri'
|
|
46
|
+
}, { default: null }),
|
|
47
|
+
avatar: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
format: 'uri'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
})
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const { oneOf } = require('../../../helpers/payload-or-null')
|
|
2
|
+
|
|
3
|
+
module.exports = oneOf({
|
|
4
|
+
description: 'Available options for variant parent products',
|
|
5
|
+
type: 'array',
|
|
6
|
+
items: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
description: 'Describes a single option with all potential values',
|
|
9
|
+
patternProperties: {
|
|
10
|
+
'^.{1,256}$': { // e.g. 'Size'
|
|
11
|
+
type: 'array',
|
|
12
|
+
items: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
example: 'L'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
example: {
|
|
19
|
+
Size: [
|
|
20
|
+
'L',
|
|
21
|
+
'M',
|
|
22
|
+
'S'
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
examples: [
|
|
27
|
+
[
|
|
28
|
+
{
|
|
29
|
+
Color: [
|
|
30
|
+
'blue',
|
|
31
|
+
'green',
|
|
32
|
+
'red'
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
Size: [
|
|
37
|
+
'L',
|
|
38
|
+
'M',
|
|
39
|
+
'S'
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
{
|
|
45
|
+
Keyboard: [
|
|
46
|
+
'English',
|
|
47
|
+
'French',
|
|
48
|
+
'German'
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
Memory: [
|
|
53
|
+
'8GB',
|
|
54
|
+
'16GB',
|
|
55
|
+
'32GB'
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
Hardrive: [
|
|
60
|
+
'512GB',
|
|
61
|
+
'1TB',
|
|
62
|
+
'2TB'
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
]
|
|
67
|
+
})
|
|
@@ -721,22 +721,22 @@ module.exports = {
|
|
|
721
721
|
type: 'object',
|
|
722
722
|
description: 'Item property changes triggered by a user decision.',
|
|
723
723
|
properties: {
|
|
724
|
-
tax_switched: {
|
|
724
|
+
tax_switched: oneOf({
|
|
725
725
|
type: 'boolean'
|
|
726
|
-
},
|
|
726
|
+
}),
|
|
727
727
|
action: oneOf({
|
|
728
728
|
type: 'object',
|
|
729
729
|
properties: {
|
|
730
|
-
tax: {
|
|
730
|
+
tax: oneOf({
|
|
731
731
|
type: 'string',
|
|
732
732
|
format: 'uuid'
|
|
733
|
-
},
|
|
734
|
-
default: {
|
|
733
|
+
}),
|
|
734
|
+
default: oneOf({
|
|
735
735
|
type: 'boolean'
|
|
736
|
-
},
|
|
737
|
-
name: {
|
|
736
|
+
}),
|
|
737
|
+
name: oneOf({
|
|
738
738
|
type: 'string'
|
|
739
|
-
}
|
|
739
|
+
})
|
|
740
740
|
}
|
|
741
741
|
})
|
|
742
742
|
}
|
|
@@ -270,12 +270,7 @@ module.exports = {
|
|
|
270
270
|
}),
|
|
271
271
|
_amount_total: oneOf({
|
|
272
272
|
description: stripIndents`
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
NOTE: The intention to use this without tip and change can not be realized as of 2023.
|
|
276
|
-
|
|
277
|
-
2023: Equal to \'_amount_given\' and \'_amount_requested\'.
|
|
278
|
-
|
|
273
|
+
Equals to \'_amount_requested\' + \'_tip_total\'.
|
|
279
274
|
`,
|
|
280
275
|
type: 'number',
|
|
281
276
|
minimum: -1000000,
|
|
@@ -295,9 +290,8 @@ module.exports = {
|
|
|
295
290
|
be payed e.g. 49.98, but the customer has given 50,00. This
|
|
296
291
|
is usually of interest in cash payments, or when when customers
|
|
297
292
|
gave fewer amount than they ought to pay.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
293
|
+
|
|
294
|
+
Equals to given amount (requested + tips + change)
|
|
301
295
|
`,
|
|
302
296
|
example: '50.00',
|
|
303
297
|
type: 'number',
|
|
@@ -308,11 +302,8 @@ module.exports = {
|
|
|
308
302
|
_amount_requested: oneOf({
|
|
309
303
|
description: stripIndents`
|
|
310
304
|
The amount that was requested to e.g. a card payment terminal - thus it includes the proposed tip amount.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
NOTE: The intention to use this without tip and change can not be realized as of 2023.
|
|
314
|
-
|
|
315
|
-
2023: Equal to \'_amount_total\' and \'_amount_given\'.
|
|
305
|
+
|
|
306
|
+
Equals to requested amount (tips are not included)
|
|
316
307
|
`,
|
|
317
308
|
example: '49.98',
|
|
318
309
|
type: 'number',
|
|
@@ -321,11 +312,8 @@ module.exports = {
|
|
|
321
312
|
multipleOf: 0.01
|
|
322
313
|
}),
|
|
323
314
|
_amount_change: oneOf({
|
|
324
|
-
description: stripIndents`
|
|
325
|
-
|
|
326
|
-
NOTE: usually NULL - as change is tx top level an should currently not be attributed to a single payment (of potentially many).
|
|
327
|
-
|
|
328
|
-
2023: Change can be set on a payment ONLY if top level change is agreed to be 0 .
|
|
315
|
+
description: stripIndents`
|
|
316
|
+
Equals to change of this payment (change on transaction still has total change for all payments)
|
|
329
317
|
`,
|
|
330
318
|
example: '49.98',
|
|
331
319
|
type: 'number',
|