@tillhub/schemas 6.238.0 → 6.240.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,17 @@
1
+ # [6.240.0](https://github.com/tillhub/schemas/compare/v6.239.0...v6.240.0) (2023-07-31)
2
+
3
+
4
+ ### Features
5
+
6
+ * **services:** add schema for POST services ([#836](https://github.com/tillhub/schemas/issues/836)) ([ac40de8](https://github.com/tillhub/schemas/commit/ac40de8))
7
+
8
+ # [6.239.0](https://github.com/tillhub/schemas/compare/v6.238.0...v6.239.0) (2023-07-28)
9
+
10
+
11
+ ### Features
12
+
13
+ * **branches:** external_rewards ([c18a2b8](https://github.com/tillhub/schemas/commit/c18a2b8))
14
+
1
15
  # [6.238.0](https://github.com/tillhub/schemas/compare/v6.237.0...v6.238.0) (2023-07-27)
2
16
 
3
17
 
@@ -412,38 +412,32 @@ module.exports = {
412
412
  type: 'null'
413
413
  }]
414
414
  },
415
- configurations: oneOf({
416
- description: 'Replacement of configuration (unknown usage).',
415
+ external_rewards: oneOf({
416
+ description: 'Branch specific settinmgs for external reward systems',
417
417
  type: 'object',
418
418
  additionalProperties: false,
419
419
  properties: {
420
- external_rewards: oneOf({
420
+ coop: oneOf({
421
421
  type: 'object',
422
- additionalProperties: false,
422
+ description: 'Branch configuration object for Swiss Coop - data is used on transactions',
423
423
  properties: {
424
- coop: oneOf({
425
- type: 'object',
426
- description: 'Branch configuration object for Swiss Coop - data is used on transactions',
427
- properties: {
428
- store_eain: {
429
- type: 'string',
430
- description: 'Coop identity of this Tillhub branch.',
431
- example: '7640147960015'
432
- },
433
- store_name: oneOf({
434
- type: 'string',
435
- maxLength: 128,
436
- description: 'Name of this branch within the Coop context.',
437
- example: 'Coop Supermarkt Riehen Schmiedgasse',
438
- default: '{name}'
439
- }),
440
- store_sap_number: oneOf({
441
- type: 'string',
442
- pattern: '^[0-9]{4}$',
443
- description: 'Tillhub branch SAP number if available.',
444
- example: '000001'
445
- })
446
- }
424
+ store_eain: {
425
+ type: 'string',
426
+ description: 'Coop identity of this Tillhub branch.',
427
+ example: '7640147960015'
428
+ },
429
+ store_name: oneOf({
430
+ type: 'string',
431
+ maxLength: 128,
432
+ description: 'Name of this branch within the Coop context.',
433
+ example: 'Coop Supermarkt Riehen Schmiedgasse',
434
+ default: '{name}'
435
+ }),
436
+ store_sap_number: oneOf({
437
+ type: 'string',
438
+ pattern: '^[0-9]{4}$',
439
+ description: 'Tillhub branch SAP number if available.',
440
+ example: '000001'
447
441
  })
448
442
  }
449
443
  })
package/lib/v0/index.js CHANGED
@@ -75,5 +75,6 @@ module.exports.product_addons = require('./product_addons')
75
75
  module.exports.product_addon_groups = require('./product_addon_groups')
76
76
  module.exports.configurations = require('./configurations')
77
77
  module.exports.service_categories = require('./service_categories')
78
+ module.exports.services = require('./services')
78
79
 
79
80
  // hygen:injection - Please, don't delete this line: when running the cli for schema resources the new routes will be automatically added here.
@@ -0,0 +1,34 @@
1
+ const base = require('../products/create')
2
+ const { oneOf } = require('../../helpers/payload-or-null')
3
+
4
+ module.exports = {
5
+ ...base,
6
+ properties: {
7
+ ...base.properties,
8
+ name: {
9
+ description: 'The name of the service',
10
+ type: 'string',
11
+ example: 'Haircut'
12
+ },
13
+ category: oneOf({
14
+ description: 'The UUID of the category that the service belogs to',
15
+ type: 'string',
16
+ format: 'uuid',
17
+ example: '05297f58-3408-44d0-8bf4-125d4e86c08a'
18
+ }),
19
+ duration: {
20
+ description: 'the duration of the service in mintues',
21
+ type: 'integer',
22
+ minimum: 5,
23
+ maximum: 1440,
24
+ example: 30
25
+ },
26
+ 'linked_product': {
27
+ description: 'The UUID of the product associated with the service',
28
+ type: 'string',
29
+ format: 'uuid',
30
+ example: '05297f58-3408-44d0-8bf4-125d4e86c08a'
31
+ }
32
+ },
33
+ required: ['name', 'duration', 'linked_product']
34
+ }
@@ -0,0 +1,22 @@
1
+ const request = require('./create.request')
2
+ const commonResponse = require('../../common/response')
3
+
4
+ const response = {
5
+ ...request,
6
+ required: [],
7
+ properties: {
8
+ id: {
9
+ description: 'The service ID',
10
+ type: 'string',
11
+ format: 'uuid',
12
+ example: '05297f58-3408-44d0-8bf4-125d4e86c08a'
13
+ },
14
+ ...request.properties
15
+ }
16
+ }
17
+
18
+ module.exports = {
19
+ $id: 'https://schemas.tillhub.com/v0/services.create.response.schema.json',
20
+ $schema: 'http://json-schema.org/draft-07/schema#',
21
+ ...commonResponse({ resultItems: response })
22
+ }
@@ -0,0 +1,4 @@
1
+ module.exports.create = {
2
+ request: require('./create.request'),
3
+ response: require('./create.response')
4
+ }
@@ -739,7 +739,7 @@ module.exports = {
739
739
  point_base_amount: {
740
740
  type: 'integer',
741
741
  description: stripIndents`
742
- 'Total value of the sale that qualifies for superpoints (campaign items and vouchers excluded)
742
+ 'Total value of the sale that qualifies for superpoints (campaign items, tips and vouchers excluded)
743
743
 
744
744
  as long as net items are not supported this is identical to \'total_amount\'.
745
745
  `,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.238.0",
3
+ "version": "6.240.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",
@@ -0,0 +1,20 @@
1
+ const test = require('tape')
2
+ const validate = require('../../helpers/validate-schema')
3
+
4
+ test('Services V0: create request schema validation', t => {
5
+ t.plan(2)
6
+ const createRequest = require('../../../lib/v0/services').create.request
7
+ const { valid, error } = validate(createRequest)
8
+ t.ok(valid, 'create request schema is valid')
9
+ t.error(error, 'should not get any error')
10
+ t.end()
11
+ })
12
+
13
+ test('Services V0: create response schema validation', t => {
14
+ t.plan(2)
15
+ const createResponse = require('../../../lib/v0/services').create.response
16
+ const { valid, error } = validate(createResponse)
17
+ t.ok(valid, 'create response schema is valid')
18
+ t.error(error, 'should not get any error')
19
+ t.end()
20
+ })