@tillhub/schemas 6.121.0 → 6.124.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,24 @@
1
+ # [6.124.0](https://github.com/tillhub/schemas/compare/v6.123.0...v6.124.0) (2022-03-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * **discounts:** Discounts export ([#677](https://github.com/tillhub/schemas/issues/677)) ([ced1b07](https://github.com/tillhub/schemas/commit/ced1b07))
7
+
8
+ # [6.123.0](https://github.com/tillhub/schemas/compare/v6.122.0...v6.123.0) (2022-02-25)
9
+
10
+
11
+ ### Features
12
+
13
+ * **carts:** make 'tax' and 'vat_rate' conditional required, add 'acc… ([#674](https://github.com/tillhub/schemas/issues/674)) ([d4e00b6](https://github.com/tillhub/schemas/commit/d4e00b6)), closes [#API-1373](https://github.com/tillhub/schemas/issues/API-1373)
14
+
15
+ # [6.122.0](https://github.com/tillhub/schemas/compare/v6.121.0...v6.122.0) (2022-02-22)
16
+
17
+
18
+ ### Features
19
+
20
+ * **carts:** add detailed schema #API-1394 ([#673](https://github.com/tillhub/schemas/issues/673)) ([774c03b](https://github.com/tillhub/schemas/commit/774c03b)), closes [#API-1394](https://github.com/tillhub/schemas/issues/API-1394) [#API-1394](https://github.com/tillhub/schemas/issues/API-1394)
21
+
1
22
  # [6.121.0](https://github.com/tillhub/schemas/compare/v6.120.0...v6.121.0) (2022-02-21)
2
23
 
3
24
 
@@ -0,0 +1,63 @@
1
+ module.exports.request = {
2
+ $id: 'https://schemas.tillhub.com/v0/analytics.discounts.request.schema.json',
3
+ $schema: 'http://json-schema.org/draft-07/schema#',
4
+ type: 'object',
5
+ 'additionalProperties': false,
6
+ 'properties': {
7
+ 'limit': {
8
+ 'type': 'string',
9
+ 'maxLength': 4
10
+ },
11
+ 'format': {
12
+ 'type': 'string',
13
+ 'enum': [
14
+ 'csv'
15
+ ]
16
+ },
17
+ 'start': {
18
+ 'oneOf': [
19
+ {
20
+ 'type': 'string',
21
+ 'format': 'date'
22
+ },
23
+ {
24
+ 'type': 'string',
25
+ 'format': 'date-time'
26
+ }
27
+ ]
28
+ },
29
+ 'end': {
30
+ 'oneOf': [
31
+ {
32
+ 'type': 'string',
33
+ 'format': 'date'
34
+ },
35
+ {
36
+ 'type': 'string',
37
+ 'format': 'date-time'
38
+ }
39
+ ]
40
+ },
41
+ 'discount': {
42
+ 'type': 'string'
43
+ },
44
+ 'product': {
45
+ 'type': 'string'
46
+ },
47
+ 'branch': {
48
+ 'type': 'string'
49
+ },
50
+ 'discount_rate': {
51
+ 'type': 'string'
52
+ },
53
+ 'export_map': {
54
+ 'type': 'object',
55
+ 'properties': {
56
+ 'fields': {
57
+ 'type': 'object'
58
+ }
59
+ }
60
+ }
61
+ },
62
+ 'required': []
63
+ }
@@ -1,3 +1,4 @@
1
1
  module.exports = {
2
+ discounts: require('./discounts'),
2
3
  snapshots: require('./snapshots')
3
4
  }
@@ -0,0 +1,182 @@
1
+ const { oneOf } = require('../../helpers/payload-or-null')
2
+ const items = require('./items').create
3
+
4
+ module.exports = {
5
+ date: {
6
+ description: 'Date of this cart',
7
+ example: '2022-02-20T19:41:07.736Z',
8
+ ...oneOf({
9
+ type: 'string',
10
+ format: 'date-time'
11
+ })
12
+ },
13
+ done_at: {
14
+ description: 'Date when this cart was used in a transaction (currently). If date is not null, this cart must not be used.',
15
+ example: '2022-02-21T16:14:55.076Z',
16
+ ...oneOf({
17
+ type: 'string',
18
+ format: 'date-time'
19
+ })
20
+ },
21
+ branch: {
22
+ description: 'The branch cart belongs to',
23
+ example: '0eb9ad65-63e5-445e-a7c2-3e13591011de',
24
+ ...oneOf({
25
+ type: 'string',
26
+ format: 'uuid'
27
+ })
28
+ },
29
+ register: {
30
+ description: 'The register cart belongs to',
31
+ example: 'ede968cc-1ea1-4710-8d81-97d5a5fb166e',
32
+ ...oneOf({
33
+ type: 'string',
34
+ format: 'uuid'
35
+ })
36
+ },
37
+ cashier_staff: {
38
+ description: 'Cashier who handled the cart',
39
+ example: 'bcd84d35-f887-4c35-bdad-291a154802a7',
40
+ ...oneOf({
41
+ type: 'string',
42
+ format: 'uuid'
43
+ })
44
+ },
45
+ temporary_staff: {
46
+ description: 'Staff who was lending permissions temporarily (in case that \'cashier_staff\' did not have that permission)',
47
+ example: 'f925ce8c-fd80-40e5-bac4-b269a04bda6f',
48
+ ...oneOf({
49
+ type: 'string',
50
+ format: 'uuid'
51
+ })
52
+ },
53
+ currency: {
54
+ description: 'Currency being used',
55
+ example: 'EUR',
56
+ ...oneOf({
57
+ type: 'string',
58
+ minLength: 3,
59
+ maxLength: 3
60
+ })
61
+ },
62
+ custom_id: {
63
+ description: 'User defined (human readable) identifier for the cart, e.g. counting number 1, 2, 3 ...',
64
+ example: '17',
65
+ ...oneOf({
66
+ type: 'string',
67
+ maxLength: 128
68
+ })
69
+ },
70
+ client_id: {
71
+ description: 'Producer side unique identifier to resolve downstream mapping targets, e.g. GUID or UUID',
72
+ example: '00060968000420200624004214945',
73
+ ...oneOf({
74
+ type: 'string',
75
+ minLength: 12,
76
+ maxLength: 64
77
+ })
78
+ },
79
+ cart_id: {
80
+ description: 'Cart ID',
81
+ example: '4553332',
82
+ ...oneOf({
83
+ type: 'string',
84
+ maxLength: 128
85
+ })
86
+ },
87
+ external_reference_id: {
88
+ description: 'Cart ID in external system',
89
+ example: '4433fg44ghnh4dfdf322',
90
+ ...oneOf({
91
+ type: 'string',
92
+ maxLength: 128
93
+ })
94
+ },
95
+ lps: {
96
+ description: 'Lean Payment System: If TRUE the client application will process this cart with minimal validation and without forced property fetching. Use on at your own risk.',
97
+ ...oneOf({
98
+ type: 'boolean'
99
+ })
100
+ },
101
+ instant_checkout: {
102
+ description: 'If TRUE this cart will be checked out immediately and thus landing on the payment screen.',
103
+ ...oneOf({
104
+ type: 'boolean'
105
+ })
106
+ },
107
+ immutable: {
108
+ description: 'If TRUE this cart will not be editable, thus a user can not remove nor add new items.',
109
+ ...oneOf({
110
+ type: 'boolean'
111
+ })
112
+ },
113
+ customer: {
114
+ description: 'Customer ID cart belongs to',
115
+ example: '55ec2da5-f9a4-4868-8f00-65ae0804a9d3',
116
+ ...oneOf({
117
+ type: 'string',
118
+ format: 'uuid'
119
+ })
120
+ },
121
+ customer_name: {
122
+ description: 'Customer name',
123
+ example: 'Morpheus',
124
+ ...oneOf({
125
+ type: 'string',
126
+ maxLength: 64
127
+ })
128
+ },
129
+ customer_description: {
130
+ description: 'Customer description',
131
+ example: 'Color pills seller',
132
+ ...oneOf({
133
+ type: 'string',
134
+ maxLength: 128
135
+ })
136
+ },
137
+ customer_number: {
138
+ description: 'Customer number',
139
+ example: '322223',
140
+ ...oneOf({
141
+ type: 'string',
142
+ maxLength: 128
143
+ })
144
+ },
145
+ name: {
146
+ description: 'Cart name',
147
+ example: 'For the chosen one',
148
+ ...oneOf({
149
+ type: 'string',
150
+ maxLength: 128
151
+ })
152
+ },
153
+ description: {
154
+ description: 'Cart description',
155
+ example: 'Red or blue',
156
+ ...oneOf({
157
+ type: 'string',
158
+ maxLength: 512
159
+ })
160
+ },
161
+ comments: {
162
+ description: 'Additional comments',
163
+ example: 'Just funny choice',
164
+ ...oneOf({
165
+ type: 'string',
166
+ maxLength: 4096
167
+ })
168
+ },
169
+ items,
170
+ metadata: {
171
+ description: 'Additional meta data',
172
+ type: 'object'
173
+ },
174
+ opened_at: {
175
+ description: 'Date when this cart was opened. If date is not null, this cart must not be used.',
176
+ example: '2022-02-19T00:00:00.001Z',
177
+ ...oneOf({
178
+ type: 'string',
179
+ format: 'date-time'
180
+ })
181
+ }
182
+ }
@@ -0,0 +1,30 @@
1
+ const baseObject = require('../../common/base')
2
+ const commonResponse = require('../../common/response')
3
+ const base = require('./base')
4
+
5
+ module.exports = {
6
+ request: {
7
+ $id: 'https://schemas.tillhub.com/v1/carts.create.request.schema.json',
8
+ $schema: 'http://json-schema.org/draft-07/schema#',
9
+ type: 'object',
10
+ additionalProperties: false,
11
+ required: [
12
+ 'items'
13
+ ],
14
+ properties: base
15
+ },
16
+ response: {
17
+ $id: 'https://schemas.tillhub.com/v1/carts.create.response.schema.json',
18
+ $schema: 'http://json-schema.org/draft-07/schema#',
19
+ ...commonResponse({
20
+ resultItems: {
21
+ type: 'object',
22
+ additionalProperties: false,
23
+ properties: {
24
+ ...baseObject(),
25
+ ...base
26
+ }
27
+ }
28
+ })
29
+ }
30
+ }
@@ -1,8 +1,3 @@
1
-
2
- module.exports.create = {
3
- request: require('./create.request')
4
- }
5
-
6
- module.exports.patch = {
7
- request: require('./patch.request')
8
- }
1
+ module.exports.create = require('./create')
2
+ module.exports.read = require('./read')
3
+ module.exports.patch = require('./patch')