@tillhub/schemas 6.126.0 → 6.127.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,16 @@
1
+ # [6.127.0](https://github.com/tillhub/schemas/compare/v6.126.0...v6.127.0) (2022-03-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **functions:** vouchers ([caa53d9](https://github.com/tillhub/schemas/commit/caa53d9))
7
+
8
+
9
+ ### Features
10
+
11
+ * **functions:** discounted_voucher ([f8ed802](https://github.com/tillhub/schemas/commit/f8ed802))
12
+ * **transactions:** references ([4a70818](https://github.com/tillhub/schemas/commit/4a70818))
13
+
1
14
  # [6.126.0](https://github.com/tillhub/schemas/compare/v6.125.0...v6.126.0) (2022-03-15)
2
15
 
3
16
 
@@ -59,7 +59,7 @@ const linkedVoucherPayload = {
59
59
  additionalProperties: false,
60
60
  type: 'object',
61
61
  required: [
62
- 'products'
62
+ 'linked_voucher'
63
63
  ],
64
64
  properties: {
65
65
  linked_voucher: {
@@ -120,6 +120,59 @@ const linkedVoucherPayload = {
120
120
  }
121
121
  }
122
122
 
123
+ const discountedVoucherPayload = {
124
+ description: 'Specific description of the discounted voucher function (1 specific voucher added together with a negative amount product).',
125
+ additionalProperties: false,
126
+ type: 'object',
127
+ required: [
128
+ 'discounted_voucher'
129
+ ],
130
+ properties: {
131
+ discounted_voucher: {
132
+ type: 'object',
133
+ description: 'Describes the necessary fields to sell voucher that is discounted by an additional product.',
134
+ additionalProperties: false,
135
+ properties: {
136
+ action: {
137
+ type: 'string',
138
+ format: 'uuid',
139
+ description: 'The primaray voucher action ressource ID.',
140
+ example: 'efe039d8-e38d-4333-86d8-48334da189a8'
141
+ },
142
+ amount: {
143
+ example: 50.0,
144
+ description: 'The primaray voucher amount (.2Decimal e.g. 50.00€).',
145
+ type: 'number',
146
+ minimum: 0,
147
+ maximum: 1000000,
148
+ multipleOf: 0.01
149
+ },
150
+ linked_product: {
151
+ type: 'string',
152
+ format: 'uuid',
153
+ description: 'The additional product ressource ID.',
154
+ example: 'fc7cc46a-ebe2-4b62-9b1b-0f849680b49'
155
+ },
156
+ linked_amount: {
157
+ example: 10.0,
158
+ description: 'The unit price of the linked product.',
159
+ type: 'number',
160
+ minimum: 0,
161
+ maximum: 1000000,
162
+ multipleOf: 0.01
163
+ },
164
+ linked_quantity: {
165
+ example: -1,
166
+ description: 'The quantity of the linked product (typically -1) to act as a discount.',
167
+ type: 'integer',
168
+ minimum: -16,
169
+ maximum: 0
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
+
123
176
  const configurationProperties = {
124
177
  description: {
125
178
  oneOf: [
@@ -327,50 +380,74 @@ module.exports = {
327
380
  enum: [
328
381
  'instant_checkout',
329
382
  'add_to_cart',
330
- 'linked_voucher'
383
+ 'linked_voucher',
384
+ 'discounted_voucher'
331
385
  ]
332
386
  }
333
387
  },
334
- if: {
335
- properties: {
336
- class: {
337
- type: 'string',
338
- enum: [
339
- 'instant_checkout',
340
- 'add_to_cart'
341
- ]
342
- }
343
- }
344
- },
345
- then: {
346
- properties: {
347
- ...configurationProperties,
348
- payload: {
349
- ...oneOf(instantCheckoutPayload)
350
- }
351
- }
352
- },
353
- else: {
354
- if: {
355
- properties: {
356
- class: {
357
- type: 'string',
358
- enum: [
359
- 'linked_voucher'
360
- ]
388
+ allOf: [
389
+ {
390
+ if: {
391
+ properties: {
392
+ class: {
393
+ type: 'string',
394
+ enum: [
395
+ 'instant_checkout',
396
+ 'add_to_cart'
397
+ ]
398
+ }
399
+ }
400
+ },
401
+ then: {
402
+ properties: {
403
+ ...configurationProperties,
404
+ payload: {
405
+ ...oneOf(instantCheckoutPayload)
406
+ }
361
407
  }
362
408
  }
363
409
  },
364
- then: {
365
- properties: {
366
- ...configurationProperties,
367
- payload: {
368
- ...oneOf(linkedVoucherPayload)
410
+ {
411
+ if: {
412
+ properties: {
413
+ class: {
414
+ type: 'string',
415
+ enum: [
416
+ 'linked_voucher'
417
+ ]
418
+ }
419
+ }
420
+ },
421
+ then: {
422
+ properties: {
423
+ ...configurationProperties,
424
+ payload: {
425
+ ...oneOf(linkedVoucherPayload)
426
+ }
369
427
  }
370
428
  }
371
429
  },
372
- else: false // further if-else statements add in here, as a nested prop
373
- }
430
+ {
431
+ if: {
432
+ properties: {
433
+ class: {
434
+ type: 'string',
435
+ enum: [
436
+ 'discounted_voucher'
437
+ ]
438
+ }
439
+ }
440
+ },
441
+ then: {
442
+ properties: {
443
+ ...configurationProperties,
444
+ payload: {
445
+ ...oneOf(discountedVoucherPayload)
446
+ }
447
+ }
448
+ }
449
+ }
450
+ ]
374
451
  },
375
452
  locations: {
376
453
  anyOf: [
@@ -19,7 +19,8 @@ module.exports = {
19
19
  'canceled_expense',
20
20
  'canceled_deposit',
21
21
  'canceled_bank_expense',
22
- 'canceled_bank_deposit'
22
+ 'canceled_bank_deposit',
23
+ 'linked_item'
23
24
  ]
24
25
  },
25
26
  id: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.126.0",
3
+ "version": "6.127.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",