@tillhub/schemas 6.208.0 → 6.210.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.210.0](https://github.com/tillhub/schemas/compare/v6.209.0...v6.210.0) (2023-04-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * **branchMms:** update branch & add branchMms ([e9d5821](https://github.com/tillhub/schemas/commit/e9d5821))
7
+ * **mmsbranch:** fix typo ([d35d641](https://github.com/tillhub/schemas/commit/d35d641))
8
+
9
+ # [6.209.0](https://github.com/tillhub/schemas/compare/v6.208.0...v6.209.0) (2023-04-18)
10
+
11
+
12
+ ### Features
13
+
14
+ * **pricelists:** schema for new pricelists endpoint ([7254752](https://github.com/tillhub/schemas/commit/7254752))
15
+
1
16
  # [6.208.0](https://github.com/tillhub/schemas/compare/v6.207.0...v6.208.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',
@@ -0,0 +1,160 @@
1
+ const { oneOf } = require('../../helpers/payload-or-null')
2
+
3
+ module.exports = {
4
+ branch_id: {
5
+ description: 'The id of the parent branch.',
6
+ type: 'string',
7
+ format: 'uuid'
8
+ },
9
+ mms_id: oneOf({
10
+ description: 'The id of the branch that identifies it in Mms.',
11
+ type: 'string',
12
+ format: 'uuid'
13
+ }),
14
+ created_by: oneOf({
15
+ description: 'When was created the branch in Mms.',
16
+ type: 'string',
17
+ maxLength: 255,
18
+ minLength: 1
19
+ }),
20
+ updated_by: oneOf({
21
+ description: 'Last time it was updated in Mms.',
22
+ type: 'string',
23
+ maxLength: 255,
24
+ minLength: 1
25
+ }),
26
+ scope: oneOf({
27
+ description: 'The scope from Mms.',
28
+ type: 'string',
29
+ format: 'uuid'
30
+ }),
31
+ attributes: oneOf({
32
+ description: 'The attributes of the branch.',
33
+ type: 'object'
34
+ }),
35
+ vat_id: oneOf({
36
+ description: 'The vat id.',
37
+ type: 'string',
38
+ maxLength: 255,
39
+ minLength: 1
40
+ }),
41
+ commercial_register_number: oneOf({
42
+ description: 'The commercial register number.',
43
+ type: 'string',
44
+ maxLength: 255,
45
+ minLength: 1
46
+ }),
47
+ creditor_id: oneOf({
48
+ description: 'The creditor id.',
49
+ type: 'string',
50
+ maxLength: 255,
51
+ minLength: 1
52
+ }),
53
+ court_of_jurisdiction: oneOf({
54
+ description: 'The court of jurisdiction.',
55
+ type: 'string',
56
+ maxLength: 255,
57
+ minLength: 1
58
+ }),
59
+ company_name_short: oneOf({
60
+ description: 'The short company name.',
61
+ type: 'string',
62
+ maxLength: 1024,
63
+ minLength: 1
64
+ }),
65
+ company_description: oneOf({
66
+ description: 'The company description.',
67
+ type: 'string',
68
+ maxLength: 16384,
69
+ minLength: 1
70
+ }),
71
+ registration_authority: oneOf({
72
+ description: 'The registration authority.',
73
+ type: 'string',
74
+ maxLength: 255,
75
+ minLength: 1
76
+ }),
77
+ legal_entity_type: oneOf({
78
+ description: 'The legal entity type.',
79
+ type: 'string',
80
+ maxLength: 255,
81
+ minLength: 1
82
+ }),
83
+ country_of_registration: oneOf({
84
+ description: 'The country of registration.',
85
+ type: 'string',
86
+ maxLength: 255,
87
+ minLength: 1
88
+ }),
89
+ countries_of_operations: oneOf({
90
+ description: 'The countries of operations.',
91
+ type: 'array',
92
+ items: {
93
+ type: 'string'
94
+ }
95
+ }),
96
+ date_of_foundation: oneOf({
97
+ description: 'The date of foundation.',
98
+ type: 'string',
99
+ maxLength: 255,
100
+ minLength: 1
101
+ }),
102
+ website: oneOf({
103
+ description: 'The website.',
104
+ type: 'string',
105
+ maxLength: 255,
106
+ minLength: 1
107
+ }),
108
+ sector: oneOf({
109
+ description: 'The sector.',
110
+ type: 'string',
111
+ maxLength: 255,
112
+ minLength: 1
113
+ }),
114
+ contacts: oneOf({
115
+ description: 'The contacts.',
116
+ type: 'object'
117
+ }),
118
+ unzer_identifier_records: oneOf({
119
+ description: 'The unzer identifier records.',
120
+ type: 'object'
121
+ }),
122
+ state: oneOf({
123
+ description: 'The state.',
124
+ type: 'string',
125
+ maxLength: 255,
126
+ minLength: 1
127
+ }),
128
+ contracts: oneOf({
129
+ description: 'The contracts.',
130
+ type: 'object'
131
+ }),
132
+ units: oneOf({
133
+ description: 'The uuids of units.',
134
+ type: 'array',
135
+ items: {
136
+ type: 'string',
137
+ format: 'uuid'
138
+ }
139
+ }),
140
+ sales_streams: oneOf({
141
+ description: 'The uuids of sales streams.',
142
+ type: 'array',
143
+ items: {
144
+ type: 'string',
145
+ format: 'uuid'
146
+ }
147
+ }),
148
+ type: oneOf({
149
+ description: 'The type.',
150
+ type: 'string',
151
+ maxLength: 255,
152
+ minLength: 1
153
+ }),
154
+ unit_unzer_id: oneOf({
155
+ description: 'The unit unzer id.',
156
+ type: 'string',
157
+ maxLength: 255,
158
+ minLength: 1
159
+ })
160
+ }
@@ -18,6 +18,32 @@ module.exports = {
18
18
  }
19
19
  ]
20
20
  },
21
+ created_at: {
22
+ description: 'When the branch was created. It was added for creating branches coming from MMS',
23
+ oneOf: [
24
+ {
25
+ type: 'string',
26
+ format: 'date-time',
27
+ example: '2019-03-17T21:12:04.849Z'
28
+ },
29
+ {
30
+ type: 'null'
31
+ }
32
+ ]
33
+ },
34
+ updated_at: {
35
+ description: 'When the branch was last updated. It was added for creating branches coming from MMS',
36
+ oneOf: [
37
+ {
38
+ type: 'string',
39
+ format: 'date-time',
40
+ example: '2019-03-17T21:12:04.849Z'
41
+ },
42
+ {
43
+ type: 'null'
44
+ }
45
+ ]
46
+ },
21
47
  phonenumbers: {
22
48
  description: 'A number of valid types of phone numbers for a branch.',
23
49
  anyOf: [
@@ -1,6 +1,18 @@
1
1
  const baseObject = require('../../common/base')
2
2
  const commonResponse = require('../../common/response')
3
3
  const base = require('./base')
4
+ const baseMms = require('./base-mms')
5
+
6
+ module.exports.mms = {
7
+ $id: 'https://schemas.tillhub.com/v0/branches.create.mms.schema.json',
8
+ $schema: 'http://json-schema.org/draft-07/schema#',
9
+ additionalProperties: false,
10
+ required: [
11
+ 'branch_id'
12
+ ],
13
+ properties: baseMms,
14
+ type: 'object'
15
+ }
4
16
 
5
17
  module.exports.request = {
6
18
  $id: 'https://schemas.tillhub.com/v0/branches.create.request.schema.json',
@@ -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.208.0",
3
+ "version": "6.210.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",