@tillhub/schemas 6.207.0 → 6.209.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,18 @@
1
+ # [6.209.0](https://github.com/tillhub/schemas/compare/v6.208.0...v6.209.0) (2023-04-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * **pricelists:** schema for new pricelists endpoint ([7254752](https://github.com/tillhub/schemas/commit/7254752))
7
+
8
+ # [6.208.0](https://github.com/tillhub/schemas/compare/v6.207.0...v6.208.0) (2023-04-18)
9
+
10
+
11
+ ### Features
12
+
13
+ * **configurations:** tips ([15da363](https://github.com/tillhub/schemas/commit/15da363))
14
+ * **configurations:** tips ([6a85257](https://github.com/tillhub/schemas/commit/6a85257))
15
+
1
16
  # [6.207.0](https://github.com/tillhub/schemas/compare/v6.206.0...v6.207.0) (2023-04-18)
2
17
 
3
18
 
@@ -0,0 +1,113 @@
1
+ const { oneOf } = require('../helpers/payload-or-null')
2
+ const { timezone } = require('../common/timezones')
3
+
4
+ const dateRange = {
5
+ type: 'object',
6
+ additionalProperties: false,
7
+ required: [
8
+ 'enabled'
9
+ ],
10
+ properties: {
11
+ enabled: {
12
+ type: 'boolean',
13
+ description: 'disables or activates the date range',
14
+ default: true
15
+ },
16
+ tz: oneOf({
17
+ deprecated: true,
18
+ type: 'string',
19
+ description: 'specifies the timezone for a data range',
20
+ enum: timezone.iana,
21
+ default: null
22
+ }),
23
+ start: oneOf({
24
+ type: 'object',
25
+ additionalProperties: false,
26
+ required: [
27
+ 'enabled'
28
+ ],
29
+ properties: {
30
+ enabled: {
31
+ type: 'boolean',
32
+ description: 'disables or activates the start of a date range',
33
+ default: true
34
+ },
35
+ value: oneOf({
36
+ type: 'string',
37
+ format: 'date-time',
38
+ description: 'starting time of a date range',
39
+ example: '2021-09-23T08:19:02.059Z',
40
+ default: null // == distant past
41
+ })
42
+ }
43
+ }),
44
+ end: oneOf({
45
+ type: 'object',
46
+ additionalProperties: false,
47
+ required: [
48
+ 'enabled'
49
+ ],
50
+ properties: {
51
+ enabled: {
52
+ type: 'boolean',
53
+ description: 'disables or activates the end of a date range',
54
+ default: true
55
+ },
56
+ value: oneOf({
57
+ type: 'string',
58
+ format: 'date-time',
59
+ description: 'starting time of a date range',
60
+ example: '2021-10-03T14:20:31.011Z',
61
+ default: null // == distant future
62
+ })
63
+ }
64
+ })
65
+ }
66
+ }
67
+
68
+ const dayTimeSlot = {
69
+ type: 'object',
70
+ additionalProperties: false,
71
+ required: [
72
+ 'enabled'
73
+ ],
74
+ properties: {
75
+ enabled: {
76
+ type: 'boolean',
77
+ description: 'disables or activates a set slot',
78
+ default: true
79
+ },
80
+ start: oneOf({
81
+ type: 'string',
82
+ pattern: '([0-1][0-9]|2[0-3]):[0-5][0-9]',
83
+ example: '08:30',
84
+ description: 'daytime for the start of an active time slot',
85
+ default: '00:00'
86
+ }),
87
+ end: oneOf({
88
+ type: 'string',
89
+ pattern: '([0-1][0-9]|2[0-3]):[0-5][0-9]',
90
+ example: '09:15',
91
+ description: 'daytime for the end of an active time slot',
92
+ default: '23:59'
93
+ })
94
+ }
95
+ }
96
+
97
+ const dayTimeSlots = oneOf({
98
+ type: 'object',
99
+ additionalProperties: false,
100
+ properties: {
101
+ slots: oneOf({
102
+ description: 'A number of timeslots for a specific day. Not enforced - but overlaps are not encouraged',
103
+ type: 'array',
104
+ items: dayTimeSlot
105
+ })
106
+ }
107
+ })
108
+
109
+ module.exports = {
110
+ dateRange,
111
+ dayTimeSlot,
112
+ dayTimeSlots
113
+ }
@@ -1,110 +1,5 @@
1
1
  const { oneOf } = require('../helpers/payload-or-null')
2
- const { timezone } = require('../common/timezones')
3
-
4
- const dateRange = {
5
- type: 'object',
6
- additionalProperties: false,
7
- required: [
8
- 'enabled'
9
- ],
10
- properties: {
11
- enabled: {
12
- type: 'boolean',
13
- description: 'disables or activates the date range',
14
- default: true
15
- },
16
- tz: oneOf({
17
- deprecated: true,
18
- type: 'string',
19
- description: 'specifies the timezone for a data range',
20
- enum: timezone.iana,
21
- default: null
22
- }),
23
- start: oneOf({
24
- type: 'object',
25
- additionalProperties: false,
26
- required: [
27
- 'enabled'
28
- ],
29
- properties: {
30
- enabled: {
31
- type: 'boolean',
32
- description: 'disables or activates the start of a date range',
33
- default: true
34
- },
35
- value: oneOf({
36
- type: 'string',
37
- format: 'date-time',
38
- description: 'starting time of a date range',
39
- example: '2021-09-23T08:19:02.059Z',
40
- default: null // == distant past
41
- })
42
- }
43
- }),
44
- end: oneOf({
45
- type: 'object',
46
- additionalProperties: false,
47
- required: [
48
- 'enabled'
49
- ],
50
- properties: {
51
- enabled: {
52
- type: 'boolean',
53
- description: 'disables or activates the end of a date range',
54
- default: true
55
- },
56
- value: oneOf({
57
- type: 'string',
58
- format: 'date-time',
59
- description: 'starting time of a date range',
60
- example: '2021-10-03T14:20:31.011Z',
61
- default: null // == distant future
62
- })
63
- }
64
- })
65
- }
66
- }
67
-
68
- const dayTimeSlot = {
69
- type: 'object',
70
- additionalProperties: false,
71
- required: [
72
- 'enabled'
73
- ],
74
- properties: {
75
- enabled: {
76
- type: 'boolean',
77
- description: 'disables or activates a set slot',
78
- default: true
79
- },
80
- start: oneOf({
81
- type: 'string',
82
- pattern: '([0-1][0-9]|2[0-3]):[0-5][0-9]',
83
- example: '08:30',
84
- description: 'daytime for the start of an active time slot',
85
- default: '00:00'
86
- }),
87
- end: oneOf({
88
- type: 'string',
89
- pattern: '([0-1][0-9]|2[0-3]):[0-5][0-9]',
90
- example: '09:15',
91
- description: 'daytime for the end of an active time slot',
92
- default: '23:59'
93
- })
94
- }
95
- }
96
-
97
- const dayTimeSlots = oneOf({
98
- type: 'object',
99
- additionalProperties: false,
100
- properties: {
101
- slots: oneOf({
102
- description: 'A number of timeslots for a specific day. Not enforced - but overlaps are not encouraged',
103
- type: 'array',
104
- items: dayTimeSlot
105
- })
106
- }
107
- })
2
+ const { dateRange, dayTimeSlots } = require('./date_time_constraints')
108
3
 
109
4
  module.exports = {
110
5
  type: 'object',
@@ -11,11 +11,8 @@ const tipsCartItemTemplate = {
11
11
  example: '43847a66-97dc-4ac2-8e8a-c44920e1f22f'
12
12
  },
13
13
  product_name: {
14
- default: null,
15
- ...oneOf({
16
- type: 'string',
17
- description: 'Name of the product, e.g. Shop-owner\'s Tip.'
18
- })
14
+ type: 'string',
15
+ description: 'Name of the product, e.g. Shop-owner\'s Tip.'
19
16
  },
20
17
  product_number: {
21
18
  default: null,
@@ -54,10 +51,13 @@ const tipsCartItemTemplate = {
54
51
  example: 'a3847a66-97dc-4ac2-8e8a-c44920e1f22f'
55
52
  },
56
53
  tax: {
57
- type: 'string',
58
- format: 'uuid',
59
- description: 'The Tillhub tax resource reference ID.',
60
- example: '33847a66-97dc-4ac2-8e8a-c44920e1f22f'
54
+ default: null,
55
+ ...oneOf({
56
+ type: 'string',
57
+ format: 'uuid',
58
+ description: 'The Tillhub tax resource reference ID. If NULL, the source items are used to define tax rates',
59
+ example: '33847a66-97dc-4ac2-8e8a-c44920e1f22f'
60
+ })
61
61
  }
62
62
  }
63
63
  }
@@ -215,3 +215,5 @@ module.exports.bulk = {
215
215
  }
216
216
  }
217
217
  }
218
+
219
+ module.exports.pricelist = require('./pricelist/index')
@@ -0,0 +1,12 @@
1
+ const commonResponse = require('../../../common/response')
2
+ module.exports = {
3
+ get: {
4
+ all: {
5
+ response: {
6
+ $id: 'https://schemas.tillhub.com/v1/products.pricelist.get-all.response.schema.json',
7
+ $schema: 'http://json-schema.org/draft-07/schema#',
8
+ ...commonResponse({ resultItems: require('./response') }, { hasCursor: true })
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,103 @@
1
+ const { oneOf } = require('../../../helpers/payload-or-null')
2
+ const { dateRange, dayTimeSlots } = require('../../../common/date_time_constraints')
3
+
4
+ module.exports = {
5
+ type: 'object',
6
+ additionalProperties: false,
7
+ properties: {
8
+ product: {
9
+ description: 'The reference to the product',
10
+ type: 'string',
11
+ format: 'uuid'
12
+ },
13
+ type: {
14
+ description: 'Type of the product prices',
15
+ type: 'string',
16
+ enum: [
17
+ 'scaled',
18
+ 'branch',
19
+ 'time-based'
20
+ ],
21
+ example: 'scaled'
22
+ },
23
+ created_at: {
24
+ type: 'string',
25
+ format: 'date-time',
26
+ example: '2018-11-04T23:18:43.075Z'
27
+ },
28
+ updated_at: {
29
+ type: 'string',
30
+ format: 'date-time',
31
+ example: '2018-11-04T23:18:43.075Z'
32
+ },
33
+ deleted: {
34
+ type: 'boolean',
35
+ default: false
36
+ },
37
+ net: {
38
+ ...oneOf({
39
+ description: 'The net sales price is the price without sales tax.',
40
+ example: '27633.02',
41
+ type: 'number',
42
+ minimum: 0,
43
+ maximum: 1000000,
44
+ multipleOf: 0.01
45
+ })
46
+ },
47
+ gross: {
48
+ ...oneOf({
49
+ description: 'The gross sales price is the price that the customer pays, including sales tax.',
50
+ example: '27633.02',
51
+ type: 'number',
52
+ minimum: 0,
53
+ maximum: 1000000,
54
+ multipleOf: 0.01
55
+ })
56
+ },
57
+ currency: {
58
+ ...oneOf({
59
+ type: 'string',
60
+ description: 'The three letter [ISO currency](https://en.wikipedia.org/wiki/ISO_4217) of this item.',
61
+ example: 'EUR',
62
+ minLength: 3,
63
+ maxLength: 3
64
+ })
65
+ },
66
+ price_book: oneOf({
67
+ description: 'The reference to the price book',
68
+ type: 'string',
69
+ format: 'uuid'
70
+ }),
71
+ quantity: oneOf({
72
+ description: 'The price is applied if quantity of items in cart is bigger or equal to this number. If 0, then it represents default pricing.',
73
+ type: 'number',
74
+ minimum: 0,
75
+ example: 0
76
+ }),
77
+ date_range: oneOf({
78
+ description: 'a single range with optional start and end date',
79
+ dateRange
80
+ }),
81
+ day_of_week: oneOf({
82
+ type: 'object',
83
+ description: 'specifies daytime slots based on weekdays',
84
+ additionalProperties: false,
85
+ required: [
86
+ 'enabled'
87
+ ],
88
+ properties: {
89
+ enabled: {
90
+ type: 'boolean',
91
+ default: true
92
+ },
93
+ monday: dayTimeSlots,
94
+ tuesday: dayTimeSlots,
95
+ wednesday: dayTimeSlots,
96
+ thursday: dayTimeSlots,
97
+ friday: dayTimeSlots,
98
+ saturday: dayTimeSlots,
99
+ sunday: dayTimeSlots
100
+ }
101
+ })
102
+ }
103
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.207.0",
3
+ "version": "6.209.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",