@tillhub/schemas 6.145.0 → 6.146.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,10 @@
|
|
|
1
|
+
# [6.146.0](https://github.com/tillhub/schemas/compare/v6.145.0...v6.146.0) (2022-06-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **carts:** add addons to cart item #API-1540 ([bcdb080](https://github.com/tillhub/schemas/commit/bcdb080)), closes [#API-1540](https://github.com/tillhub/schemas/issues/API-1540)
|
|
7
|
+
|
|
1
8
|
# [6.145.0](https://github.com/tillhub/schemas/compare/v6.144.0...v6.145.0) (2022-06-22)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { anyOf, oneOf } = require('../../../helpers/payload-or-null')
|
|
2
2
|
const productServiceAnswerObject = require('../../transactions/components/embedded/product_service_answer/base')
|
|
3
|
+
const addonObject = require('../../transactions/components/embedded/addon/base')
|
|
3
4
|
const returnReason = require('../../transactions/components/embedded/return/return_reason')
|
|
4
5
|
const voucherObject = require('../../transactions/components/embedded/voucher/base')
|
|
5
6
|
const customProperties = require('../../../common/custom_properties')
|
|
@@ -130,7 +131,7 @@ const externalDiscounts = {
|
|
|
130
131
|
]
|
|
131
132
|
},
|
|
132
133
|
{
|
|
133
|
-
description: 'discount based on value, e.g. 10 EUR = 10. Client should will subtract this from the
|
|
134
|
+
description: 'discount based on value, e.g. 10 EUR = 10. Client should will subtract this from the volume of that cart item.',
|
|
134
135
|
additionalProperties: false,
|
|
135
136
|
type: 'object',
|
|
136
137
|
properties: {
|
|
@@ -174,7 +175,7 @@ const externalDiscounts = {
|
|
|
174
175
|
]
|
|
175
176
|
},
|
|
176
177
|
{
|
|
177
|
-
description: 'discount based on amount total, e.g. 10 EUR = 10. Clients do no calculations and will
|
|
178
|
+
description: 'discount based on amount total, e.g. 10 EUR = 10. Clients do no calculations and will subtract this value from a cart item.',
|
|
178
179
|
additionalProperties: false,
|
|
179
180
|
properties: {
|
|
180
181
|
amount_total: {
|
|
@@ -446,6 +447,12 @@ const base = {
|
|
|
446
447
|
...masterData
|
|
447
448
|
}
|
|
448
449
|
|
|
450
|
+
const addons = oneOf({
|
|
451
|
+
description: 'The list of applied addons',
|
|
452
|
+
type: 'array',
|
|
453
|
+
items: addonObject
|
|
454
|
+
})
|
|
455
|
+
|
|
449
456
|
const externalCart = {
|
|
450
457
|
additionalProperties: false,
|
|
451
458
|
type: 'object',
|
|
@@ -505,6 +512,7 @@ const externalCart = {
|
|
|
505
512
|
minimum: 0,
|
|
506
513
|
maximum: 1
|
|
507
514
|
},
|
|
515
|
+
addons,
|
|
508
516
|
discounts: externalDiscounts,
|
|
509
517
|
...base
|
|
510
518
|
},
|
|
@@ -566,6 +574,7 @@ const cartOfIds = {
|
|
|
566
574
|
type: 'string',
|
|
567
575
|
maxLength: 128
|
|
568
576
|
},
|
|
577
|
+
addons,
|
|
569
578
|
discounts: externalDiscounts
|
|
570
579
|
},
|
|
571
580
|
required: [
|
|
@@ -708,6 +717,7 @@ const internalCart = {
|
|
|
708
717
|
})
|
|
709
718
|
},
|
|
710
719
|
...base,
|
|
720
|
+
addons,
|
|
711
721
|
discounts: internalDiscounts,
|
|
712
722
|
attributes: {
|
|
713
723
|
default: null,
|
|
@@ -19,7 +19,7 @@ module.exports = {
|
|
|
19
19
|
}),
|
|
20
20
|
price: {
|
|
21
21
|
type: 'number',
|
|
22
|
-
description: 'The fixed price for any addon, completely
|
|
22
|
+
description: 'The fixed price for any addon, completely independent on the quantity.',
|
|
23
23
|
example: 0.99,
|
|
24
24
|
minimum: -1000000,
|
|
25
25
|
maximum: 1000000,
|