@tillhub/schemas 6.264.0 → 6.266.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,32 @@
1
+ # [6.266.0](https://github.com/tillhub/schemas/compare/v6.265.0...v6.266.0) (2023-10-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * **pricelist:** rebuild customer handling ([e915bcd](https://github.com/tillhub/schemas/commit/e915bcd))
7
+ * **prices:** add customer bound type to list entries ([7b3409f](https://github.com/tillhub/schemas/commit/7b3409f))
8
+ * **prices:** list ([07778e9](https://github.com/tillhub/schemas/commit/07778e9))
9
+ * **products:** prices ([36165fd](https://github.com/tillhub/schemas/commit/36165fd))
10
+ * **transactions:** customer ([cf6e687](https://github.com/tillhub/schemas/commit/cf6e687))
11
+
12
+ # [6.265.0](https://github.com/tillhub/schemas/compare/v6.264.0...v6.265.0) (2023-10-16)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **staff:** put array length validation in place, now only array of length 7 is valid ([b4ac285](https://github.com/tillhub/schemas/commit/b4ac285))
18
+ * **transactions_v1:** import of external module was not pointing to correct path ([1418414](https://github.com/tillhub/schemas/commit/1418414))
19
+
20
+
21
+ ### Features
22
+
23
+ * **configurations:** carts ([78f6819](https://github.com/tillhub/schemas/commit/78f6819))
24
+ * **configurations:** payments ([2dd438d](https://github.com/tillhub/schemas/commit/2dd438d))
25
+ * **customers:** rename price_book_id to price_book ([#881](https://github.com/tillhub/schemas/issues/881)) ([17c4f3b](https://github.com/tillhub/schemas/commit/17c4f3b))
26
+ * **encryption:** adjust ([3c8c5e4](https://github.com/tillhub/schemas/commit/3c8c5e4))
27
+ * **shift_plan:** change schema a bit, move it out of branch and treat it as stand alone entity ([3bc439f](https://github.com/tillhub/schemas/commit/3bc439f))
28
+ * **transactions:** legacy ([23a8964](https://github.com/tillhub/schemas/commit/23a8964)), closes [Security#2](https://github.com/Security/issues/2)
29
+
1
30
  # [6.264.0](https://github.com/tillhub/schemas/compare/v6.263.0...v6.264.0) (2023-09-28)
2
31
 
3
32
 
@@ -1,7 +1,3 @@
1
1
  module.exports.create = require('./create')
2
2
  module.exports.read = require('./read')
3
3
  module.exports.update = require('./update')
4
- module.exports.shift_plan = {
5
- read: require('./shift_plan/read'),
6
- update: require('./shift_plan/update')
7
- }
@@ -426,8 +426,8 @@ module.exports = {
426
426
  format: 'uuid'
427
427
  })
428
428
  },
429
- price_book_id: {
430
- description: 'in cases where the customer is going to have personal pricebook (like for discounts in pharmacy by personal insurance number), price_book_id is required',
429
+ price_book: {
430
+ description: 'in cases where the customer is going to have personal pricebook (like for discounts in pharmacy by personal insurance number), price_book is required',
431
431
  ...oneOf({
432
432
  type: 'string',
433
433
  format: 'uuid'
package/lib/v0/index.js CHANGED
@@ -76,5 +76,6 @@ 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
78
  module.exports.services = require('./services')
79
+ module.exports.shift_plan = require('./shift_plan')
79
80
 
80
81
  // 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,37 @@
1
+ module.exports = {
2
+ shift_plan_enabled: {
3
+ type: 'boolean'
4
+ },
5
+ shift_plan: {
6
+ type: 'array',
7
+ items: {
8
+ type: 'object',
9
+ additionalProperties: false,
10
+ properties: {
11
+ staff_member_id: {
12
+ type: 'string',
13
+ format: 'uuid'
14
+ },
15
+ date: {
16
+ type: 'string',
17
+ format: 'date'
18
+ },
19
+ plan: {
20
+ type: 'array',
21
+ items: {
22
+ type: 'object',
23
+ additionalProperties: false,
24
+ properties: {
25
+ start: {
26
+ type: 'string'
27
+ },
28
+ end: {
29
+ type: 'string'
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,2 @@
1
+ module.exports.update = require('./update')
2
+ module.exports.read = require('./read')
@@ -1,4 +1,4 @@
1
- const commonResponse = require('../../../common/response')
1
+ const commonResponse = require('../../common/response')
2
2
  const base = require('./base')
3
3
 
4
4
  module.exports.response = {
@@ -1,4 +1,4 @@
1
- const commonResponse = require('../../../common/response')
1
+ const commonResponse = require('../../common/response')
2
2
  const base = require('./base')
3
3
 
4
4
  module.exports.request = {
@@ -525,6 +525,8 @@ module.exports = {
525
525
  individual_work_plan: {
526
526
  description: 'Custom schedule for this staff member.',
527
527
  type: 'array',
528
+ minItems: 7,
529
+ maxItems: 7,
528
530
  items: {
529
531
  type: 'object',
530
532
  properties: {
@@ -142,6 +142,12 @@ module.exports = {
142
142
  maxLength: 128
143
143
  })
144
144
  },
145
+ customer_price_book: oneOf({
146
+ type: 'string',
147
+ format: 'uuid',
148
+ description: 'The Tillhub pricebook resource asscociated with the customer at that moment',
149
+ example: '512448db-5e6c-4fcf-bd70-f8a5e56fa269'
150
+ }),
145
151
  name: {
146
152
  description: 'Cart name',
147
153
  example: 'For the chosen one',
@@ -167,10 +173,24 @@ module.exports = {
167
173
  })
168
174
  },
169
175
  items,
170
- metadata: {
176
+ metadata: oneOf({
177
+ type: 'object',
171
178
  description: 'Additional meta data',
172
- type: 'object'
173
- },
179
+ properties: {
180
+ customer: oneOf({
181
+ type: 'object',
182
+ description: 'Additional data for a customer',
183
+ properties: {
184
+ price_book: oneOf({
185
+ type: 'string',
186
+ format: 'uuid',
187
+ description: 'The Tillhub pricebook resource asscociated with the customer at that moment',
188
+ example: '512448db-5e6c-4fcf-bd70-f8a5e56fa269'
189
+ })
190
+ }
191
+ })
192
+ }
193
+ }),
174
194
  opened_at: {
175
195
  description: 'Date when this cart was opened. If date is not null, this cart must not be used.',
176
196
  example: '2022-02-19T00:00:00.001Z',
@@ -45,18 +45,21 @@ module.exports = oneOf({
45
45
  description: 'In case of refund - specifies if modicications are forbidden',
46
46
  type: 'boolean',
47
47
  default: false
48
- }),
49
- items: oneOf({
50
- type: 'object',
51
- additionalProperties: false,
52
- properties: {
53
- allow_editing: oneOf({
54
- description: 'In case of refund items - specifies if quantity and price can be edited',
55
- type: 'boolean',
56
- default: false
57
- })
58
- }
59
- })
48
+ }) // ,
49
+ // *
50
+ // * ### the follwing is already defined and used from 'configurations.settings.revision_safety.allow_editing_refund_items' ###
51
+ // *
52
+ // items: oneOf({
53
+ // type: 'object',
54
+ // additionalProperties: false,
55
+ // properties: {
56
+ // allow_editing: oneOf({
57
+ // description: 'In case of refund items - specifies if quantity and price can be edited',
58
+ // type: 'boolean',
59
+ // default: false
60
+ // })
61
+ // }
62
+ // })
60
63
  }
61
64
  })
62
65
  }
@@ -40,6 +40,16 @@ module.exports = {
40
40
  description: 'If true, allows entering values for split payments that are higher than the remaining price - thus potentially handing back cash (legacy behavior).',
41
41
  default: false,
42
42
  type: 'boolean'
43
+ }),
44
+ allow_change_on_undefined: oneOf({
45
+ description: 'If true, allows entering values for split payments that are higher than the remaining price - thus potentially handing back cash (legacy behavior).',
46
+ default: false,
47
+ type: 'boolean'
48
+ }),
49
+ trigger_amount_on_undefined: oneOf({
50
+ description: 'If true, will ask for the amount on undefined payment types (rather than setting the total price of the cart).',
51
+ default: false,
52
+ type: 'boolean'
43
53
  })
44
54
  }
45
55
  }
@@ -1,3 +1,4 @@
1
+ const { oneOf } = require('../../helpers/payload-or-null')
1
2
  const items = require('./items').create
2
3
 
3
4
  module.exports = {
@@ -258,7 +259,22 @@ module.exports = {
258
259
  ]
259
260
  },
260
261
  items,
261
- metadata: {
262
- type: 'object'
263
- }
262
+ metadata: oneOf({
263
+ type: 'object',
264
+ description: 'Additional meta data',
265
+ properties: {
266
+ customer: oneOf({
267
+ type: 'object',
268
+ description: 'Additional data for a customer',
269
+ properties: {
270
+ price_book: oneOf({
271
+ type: 'string',
272
+ format: 'uuid',
273
+ description: 'The Tillhub pricebook resource asscociated with the customer at that moment',
274
+ example: '512448db-5e6c-4fcf-bd70-f8a5e56fa269'
275
+ })
276
+ }
277
+ })
278
+ }
279
+ })
264
280
  }
@@ -14,6 +14,7 @@ module.exports = {
14
14
  description: 'Type of the product prices',
15
15
  type: 'string',
16
16
  enum: [
17
+ 'customer', // defined by pricebook when of type 'customer'
17
18
  'scaled', // defined by product
18
19
  'branch', // defined by product
19
20
  'time-based', // defined by pricebook-entry
@@ -38,5 +38,15 @@ module.exports = {
38
38
  deleted: {
39
39
  type: 'boolean',
40
40
  default: false
41
- }
41
+ },
42
+ type: oneOf({
43
+ description: 'Defines type of price books, e.g. bound-to-customer',
44
+ type: 'string',
45
+ enum: [
46
+ 'general',
47
+ 'customer'
48
+ ],
49
+ example: 'customer',
50
+ default: 'general'
51
+ })
42
52
  }
@@ -552,6 +552,12 @@ module.exports = {
552
552
  display: oneOf({
553
553
  type: 'string',
554
554
  example: 'Alexander von Müller'
555
+ }),
556
+ price_book: oneOf({
557
+ type: 'string',
558
+ format: 'uuid',
559
+ description: 'The Tillhub pricebook resource asscociated with the customer at that moment',
560
+ example: '512448db-5e6c-4fcf-bd70-f8a5e56fa269'
555
561
  })
556
562
  }
557
563
  }),
@@ -622,140 +628,5 @@ module.exports = {
622
628
  type: 'number'
623
629
  }
624
630
  }
625
- }),
626
- external_rewards: oneOf({
627
- type: 'object',
628
- description: 'Necessary data to handle an external reward triggered by a transaction.',
629
- additionalProperties: false,
630
- properties: {
631
- coop: oneOf({
632
- type: 'object',
633
- description: 'Delta object for Swiss Coop',
634
- properties: {
635
- used_campaign_multiplier: {
636
- type: 'integer',
637
- description: 'Tillhub internal storage to calculate refunds properly.',
638
- minimum: 1,
639
- maximum: 100,
640
- default: 1
641
- },
642
- current_balance: oneOf({
643
- type: 'integer',
644
- description: 'Current balance if known via the online validation process.',
645
- minimum: 0,
646
- maximum: 120000,
647
- default: null
648
- }),
649
- supercard: {
650
- type: 'string',
651
- description: 'Supercard number, always required.',
652
- example: '762250103984932838'
653
- },
654
- app_id: oneOf({
655
- type: 'string',
656
- description: 'GS1 AppID, Null for EAN13 cards.',
657
- example: '000001'
658
- }),
659
- guid: oneOf({
660
- type: 'string',
661
- description: 'GS1 Card GUID, Null for EAN13 cards.',
662
- example: '50269DCFF3AD18A0E10080000A050151'
663
- }),
664
- client_info: {
665
- type: 'object',
666
- description: 'Info about the store / Tillhub branch.',
667
- properties: {
668
- store_eain: {
669
- type: 'string',
670
- description: 'Coop identity of this Tillhub branch.',
671
- example: '7640147960015'
672
- },
673
- store_name: {
674
- type: 'string',
675
- maxLength: 128,
676
- description: 'Name of this Tillhub branch.',
677
- example: 'Coop Supermarkt Riehen Schmiedgasse'
678
- },
679
- store_sap_number: oneOf({
680
- type: 'string',
681
- pattern: '^[0-9]{4}$',
682
- description: 'Tillhub branch SAP number if available.',
683
- example: '000001'
684
- }),
685
- terminal_id: oneOf({
686
- type: 'string',
687
- description: 'Tillhub custom register name.',
688
- example: 'Kasse 1'
689
- })
690
- }
691
- },
692
- purchase_info: {
693
- type: 'object',
694
- description: 'Info about the store / Tillhub branch.',
695
- properties: {
696
- bonus_points: oneOf({
697
- type: 'integer',
698
- description: 'Bonus Points to be booked - Free Points preferred, use NULL here untill specified otherwise (2023-07).',
699
- minimum: -12000,
700
- maximum: 12000,
701
- default: null
702
- }),
703
- free_points: {
704
- type: 'integer',
705
- description: 'Free Points - preferrably used over Bonus Points. (Current points x campaign multiplier) - refund points',
706
- minimum: -12000,
707
- maximum: 12000,
708
- default: 0
709
- },
710
- timestamp: {
711
- type: 'string',
712
- format: 'date-time',
713
- example: '2018-01-29T14:55:05.000Z',
714
- description: 'Date of the purchase = transaction date'
715
- },
716
- timestamp_end: {
717
- type: 'string',
718
- format: 'date-time',
719
- example: '2018-01-29T14:55:05.000Z',
720
- description: 'Date of the purchase = transaction date'
721
- },
722
- total_items: {
723
- type: 'integer',
724
- description: 'Number of cart items in the transaction that are not campaign products or vouchers.',
725
- minimum: 0,
726
- maximum: 99
727
- },
728
- employee_flag: {
729
- type: 'boolean',
730
- description: 'Marks a Coop employee, not yet relevantm, send \'false\'.',
731
- default: false
732
- },
733
- total_amount: {
734
- type: 'integer',
735
- description: 'Total value of the sale in Swiss Rappen including ALL cart items, including refunds, excluding tips.',
736
- minimum: -2400000,
737
- maximum: 2400000
738
- },
739
- point_base_amount: {
740
- type: 'integer',
741
- description: stripIndents`
742
- 'Total value of the sale that qualifies for superpoints (campaign items, tips and vouchers excluded)
743
-
744
- as long as net items are not supported this is identical to \'total_amount\'.
745
- `,
746
- minimum: -2400000,
747
- maximum: 2400000
748
- },
749
- bon_nr: {
750
- type: 'integer',
751
- description: 'Tillhub transaction number.',
752
- minimum: 0,
753
- maximum: 32000
754
- }
755
- }
756
- }
757
- }
758
- })
759
- }
760
631
  })
761
632
  }
@@ -1,4 +1,5 @@
1
1
  const { getEvent } = require('../../../common/webhooks')
2
+ const { oneOf } = require('../../../helpers/payload-or-null')
2
3
  const statusCreate = require('../../statuses/create.request')
3
4
  const base = require('./base')
4
5
  const response = require('./response')
@@ -33,7 +34,23 @@ module.exports.request = {
33
34
  },
34
35
  status: {
35
36
  ...statusCreate
36
- }
37
+ },
38
+ external_rewards: oneOf({
39
+ type: 'object',
40
+ description: 'Payback data that should be decrypted.',
41
+ additionalProperties: false,
42
+ properties: {
43
+ payback_data: {
44
+ type: 'string', // Base64
45
+ maxLength: 16384,
46
+ examples: [
47
+ 'MEQCIAy4P9k+7x9saDO0uRZ4El8QwN+qTgYiv1DIaJIMWRiuAiAt+saFDGjK2Yi5Cxgy7PprXQ5O0seRgx4ltdpW9REvwA==',
48
+ 'AUUwulkISDlfOMNro8Lx4aepbWinXgiHwGt9/xfb+WmyfAXnzAeBQmCfsRPheW/LKDlWVQWFUdvl7mXsh/vGx1vSLRiq6jn9qmL1fSGFRCrIos1U7X6dWxCr3VVZFXMILey6iuNw9i7HwNFSpyrpVOXFSDCdmKtYDfMMWD0JDAsKSFUTEbCay2yCtDEIOt/sELi6uiRwUoifztlTIt7wDNPdFrGxgJF17d2AJ4ah5V8kGTAzFygjGT8gCfTUbumKtGAJsvou+NqHAp4bb9K8+fTVG5rxw/OWux5GXmbtcxZQ3RX5IGurcsUv/kXFK+uGj7uUsCyEfq71uCxVs04Kig=='
49
+ ],
50
+ description: 'Payback data that should be decrypted..'
51
+ }
52
+ }
53
+ })
37
54
  }
38
55
  }
39
56
 
@@ -1,3 +1,4 @@
1
+ const { stripIndents } = require('common-tags')
1
2
  const { oneOf } = require('../../../helpers/payload-or-null')
2
3
  const dateObject = require('../../../common/date_object')
3
4
  const statusResponse = require('../../statuses/response')
@@ -59,6 +60,164 @@ module.exports = {
59
60
  },
60
61
  status: {
61
62
  ...statusResponse
63
+ },
64
+ external_rewards: {
65
+ anyOf: [
66
+ {
67
+ type: 'object',
68
+ description: 'If data can not be decrypted - they are stored here - Base64.',
69
+ additionalProperties: false,
70
+ properties: {
71
+ payback_data: {
72
+ type: 'string', // Base64
73
+ maxLength: 16384,
74
+ examples: [
75
+ 'MEQCIAy4P9k+7x9saDO0uRZ4El8QwN+qTgYiv1DIaJIMWRiuAiAt+saFDGjK2Yi5Cxgy7PprXQ5O0seRgx4ltdpW9REvwA==',
76
+ 'AUUwulkISDlfOMNro8Lx4aepbWinXgiHwGt9/xfb+WmyfAXnzAeBQmCfsRPheW/LKDlWVQWFUdvl7mXsh/vGx1vSLRiq6jn9qmL1fSGFRCrIos1U7X6dWxCr3VVZFXMILey6iuNw9i7HwNFSpyrpVOXFSDCdmKtYDfMMWD0JDAsKSFUTEbCay2yCtDEIOt/sELi6uiRwUoifztlTIt7wDNPdFrGxgJF17d2AJ4ah5V8kGTAzFygjGT8gCfTUbumKtGAJsvou+NqHAp4bb9K8+fTVG5rxw/OWux5GXmbtcxZQ3RX5IGurcsUv/kXFK+uGj7uUsCyEfq71uCxVs04Kig=='
77
+ ],
78
+ description: 'If payback data can not be decrypted - they are stored here - Base64.'
79
+ }
80
+ }
81
+ },
82
+ {
83
+ type: 'object',
84
+ description: 'Necessary data to handle an external reward triggered by a transaction.',
85
+ additionalProperties: false,
86
+ properties: {
87
+ coop: oneOf({
88
+ type: 'object',
89
+ description: 'Delta object for Swiss Coop',
90
+ properties: {
91
+ used_campaign_multiplier: {
92
+ type: 'integer',
93
+ description: 'Tillhub internal storage to calculate refunds properly.',
94
+ minimum: 1,
95
+ maximum: 100,
96
+ default: 1
97
+ },
98
+ current_balance: oneOf({
99
+ type: 'integer',
100
+ description: 'Current balance if known via the online validation process.',
101
+ minimum: 0,
102
+ maximum: 120000,
103
+ default: null
104
+ }),
105
+ supercard: {
106
+ type: 'string',
107
+ description: 'Supercard number, always required.',
108
+ example: '762250103984932838'
109
+ },
110
+ app_id: oneOf({
111
+ type: 'string',
112
+ description: 'GS1 AppID, Null for EAN13 cards.',
113
+ example: '000001'
114
+ }),
115
+ guid: oneOf({
116
+ type: 'string',
117
+ description: 'GS1 Card GUID, Null for EAN13 cards.',
118
+ example: '50269DCFF3AD18A0E10080000A050151'
119
+ }),
120
+ client_info: {
121
+ type: 'object',
122
+ description: 'Info about the store / Tillhub branch.',
123
+ properties: {
124
+ store_eain: {
125
+ type: 'string',
126
+ description: 'Coop identity of this Tillhub branch.',
127
+ example: '7640147960015'
128
+ },
129
+ store_name: {
130
+ type: 'string',
131
+ maxLength: 128,
132
+ description: 'Name of this Tillhub branch.',
133
+ example: 'Coop Supermarkt Riehen Schmiedgasse'
134
+ },
135
+ store_sap_number: oneOf({
136
+ type: 'string',
137
+ pattern: '^[0-9]{4}$',
138
+ description: 'Tillhub branch SAP number if available.',
139
+ example: '000001'
140
+ }),
141
+ terminal_id: oneOf({
142
+ type: 'string',
143
+ description: 'Tillhub custom register name.',
144
+ example: 'Kasse 1'
145
+ })
146
+ }
147
+ },
148
+ purchase_info: {
149
+ type: 'object',
150
+ description: 'Info about the store / Tillhub branch.',
151
+ properties: {
152
+ bonus_points: oneOf({
153
+ type: 'integer',
154
+ description: 'Bonus Points to be booked - Free Points preferred, use NULL here untill specified otherwise (2023-07).',
155
+ minimum: -12000,
156
+ maximum: 12000,
157
+ default: null
158
+ }),
159
+ free_points: {
160
+ type: 'integer',
161
+ description: 'Free Points - preferrably used over Bonus Points. (Current points x campaign multiplier) - refund points',
162
+ minimum: -12000,
163
+ maximum: 12000,
164
+ default: 0
165
+ },
166
+ timestamp: {
167
+ type: 'string',
168
+ format: 'date-time',
169
+ example: '2018-01-29T14:55:05.000Z',
170
+ description: 'Date of the purchase = transaction date'
171
+ },
172
+ timestamp_end: {
173
+ type: 'string',
174
+ format: 'date-time',
175
+ example: '2018-01-29T14:55:05.000Z',
176
+ description: 'Date of the purchase = transaction date'
177
+ },
178
+ total_items: {
179
+ type: 'integer',
180
+ description: 'Number of cart items in the transaction that are not campaign products or vouchers.',
181
+ minimum: 0,
182
+ maximum: 99
183
+ },
184
+ employee_flag: {
185
+ type: 'boolean',
186
+ description: 'Marks a Coop employee, not yet relevantm, send \'false\'.',
187
+ default: false
188
+ },
189
+ total_amount: {
190
+ type: 'integer',
191
+ description: 'Total value of the sale in Swiss Rappen including ALL cart items, including refunds, excluding tips.',
192
+ minimum: -2400000,
193
+ maximum: 2400000
194
+ },
195
+ point_base_amount: {
196
+ type: 'integer',
197
+ description: stripIndents`
198
+ 'Total value of the sale that qualifies for superpoints (campaign items, tips and vouchers excluded)
199
+
200
+ as long as net items are not supported this is identical to \'total_amount\'.
201
+ `,
202
+ minimum: -2400000,
203
+ maximum: 2400000
204
+ },
205
+ bon_nr: {
206
+ type: 'integer',
207
+ description: 'Tillhub transaction number.',
208
+ minimum: 0,
209
+ maximum: 32000
210
+ }
211
+ }
212
+ }
213
+ }
214
+ })
215
+ }
216
+ },
217
+ {
218
+ type: 'null'
219
+ }
220
+ ]
62
221
  }
63
222
  }
64
223
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.264.0",
3
+ "version": "6.266.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,11 @@
1
+ const test = require('tape')
2
+ const validate = require('../helpers/validate-schema')
3
+
4
+ test('Shift Plan V0: update schema validation', function (t) {
5
+ t.plan(2)
6
+ const updateRequest = require('../../lib/v0/shift_plan').update.request
7
+ const { valid, error } = validate(updateRequest)
8
+ t.ok(valid, 'update schema is valid')
9
+ t.error(error, 'should not get any error')
10
+ t.end()
11
+ })
@@ -1,46 +0,0 @@
1
- module.exports = {
2
- shift_plan_enabled: {
3
- type: 'boolean'
4
- },
5
- plan: {
6
- type: 'array',
7
- items: {
8
- type: 'object',
9
- additionalProperties: false,
10
- properties: {
11
- user: {
12
- type: 'string',
13
- format: 'uuid'
14
- },
15
- time_ranges: {
16
- type: 'array',
17
- items: {
18
- type: 'object',
19
- additionalProperties: false,
20
- properties: {
21
- date: {
22
- type: 'string',
23
- format: 'date'
24
- },
25
- times: {
26
- type: 'array',
27
- items: {
28
- type: 'object',
29
- additionalProperties: false,
30
- properties: {
31
- start: {
32
- type: 'string'
33
- },
34
- end: {
35
- type: 'string'
36
- }
37
- }
38
- }
39
- }
40
- }
41
- }
42
- }
43
- }
44
- }
45
- }
46
- }