@tillhub/schemas 6.461.0 → 6.463.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.
@@ -115,6 +115,12 @@ module.exports = oneOf({
115
115
  { type: 'string' }
116
116
  ]
117
117
  },
118
+ privacy_notice_url: {
119
+ oneOf: [
120
+ { type: 'null' },
121
+ { type: 'string' }
122
+ ]
123
+ },
118
124
  receive_appointment_notifications: {
119
125
  type: 'boolean'
120
126
  },
@@ -164,6 +170,7 @@ module.exports = oneOf({
164
170
  opening_hours_exceptions: {
165
171
  description: 'Additive Open or Closed exceptions over a date range, optionally limited to selected weekdays. Closed is full day only. 0 = Monday … 6 = Sunday. `from` and `to` are required keys on every item: omit neither. Open all-day is `from: null` and `to: null` (both present). Open specific hours requires both as HH:mm. Closed requires `from: null` and `to: null`.',
166
172
  type: 'array',
173
+ maxItems: 100,
167
174
  items: {
168
175
  type: 'object',
169
176
  additionalProperties: false,
@@ -183,6 +190,7 @@ module.exports = oneOf({
183
190
  },
184
191
  weekdays: {
185
192
  type: 'array',
193
+ uniqueItems: true,
186
194
  items: {
187
195
  type: 'integer',
188
196
  minimum: 0,
@@ -264,6 +272,46 @@ module.exports = oneOf({
264
272
  }
265
273
  ]
266
274
  }
275
+ },
276
+ {
277
+ if: {
278
+ properties: { break_from: { type: 'string' } },
279
+ required: ['break_from']
280
+ },
281
+ then: {
282
+ required: ['break_to'],
283
+ properties: { break_to: { type: 'string' } }
284
+ }
285
+ },
286
+ {
287
+ if: {
288
+ properties: { break_to: { type: 'string' } },
289
+ required: ['break_to']
290
+ },
291
+ then: {
292
+ required: ['break_from'],
293
+ properties: { break_from: { type: 'string' } }
294
+ }
295
+ },
296
+ {
297
+ if: {
298
+ properties: { break_from: { type: 'null' } },
299
+ required: ['break_from']
300
+ },
301
+ then: {
302
+ required: ['break_to'],
303
+ properties: { break_to: { type: 'null' } }
304
+ }
305
+ },
306
+ {
307
+ if: {
308
+ properties: { break_to: { type: 'null' } },
309
+ required: ['break_to']
310
+ },
311
+ then: {
312
+ required: ['break_from'],
313
+ properties: { break_from: { type: 'null' } }
314
+ }
267
315
  }
268
316
  ]
269
317
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.461.0",
3
+ "version": "6.463.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",
@@ -239,6 +239,75 @@ test('Configurations: opening_hours_exceptions rejects invalid HH:mm times', fun
239
239
  t.end()
240
240
  })
241
241
 
242
+ test('Configurations: opening_hours_exceptions rejects a one-sided break', function (t) {
243
+ t.plan(5)
244
+ const openHours = {
245
+ type: 'open',
246
+ start_date: '2026-12-20',
247
+ end_date: '2026-12-20',
248
+ from: '10:00',
249
+ to: '18:00'
250
+ }
251
+ t.notOk(validateUpdatePayload({
252
+ reservations: {
253
+ opening_hours_exceptions: [{ ...openHours, break_from: '12:00' }]
254
+ }
255
+ }), 'break_from string requires break_to')
256
+ t.notOk(validateUpdatePayload({
257
+ reservations: {
258
+ opening_hours_exceptions: [{ ...openHours, break_to: '13:00' }]
259
+ }
260
+ }), 'break_to string requires break_from')
261
+ t.notOk(validateUpdatePayload({
262
+ reservations: {
263
+ opening_hours_exceptions: [{ ...openHours, break_from: null }]
264
+ }
265
+ }), 'break_from null requires break_to')
266
+ t.notOk(validateUpdatePayload({
267
+ reservations: {
268
+ opening_hours_exceptions: [{ ...openHours, break_to: null }]
269
+ }
270
+ }), 'break_to null requires break_from')
271
+ t.ok(validateUpdatePayload({
272
+ reservations: {
273
+ opening_hours_exceptions: [{ ...openHours, break_from: null, break_to: null }]
274
+ }
275
+ }), 'both break boundaries may be null')
276
+ t.end()
277
+ })
278
+
279
+ test('Configurations: opening_hours_exceptions rejects duplicate weekdays and lists past 100 items', function (t) {
280
+ t.plan(2)
281
+ const duplicateWeekday = validateUpdatePayload({
282
+ reservations: {
283
+ opening_hours_exceptions: [{
284
+ type: 'closed',
285
+ start_date: '2026-01-01',
286
+ end_date: '2026-01-02',
287
+ weekdays: [1, 1],
288
+ from: null,
289
+ to: null
290
+ }]
291
+ }
292
+ })
293
+ t.notOk(duplicateWeekday, 'weekdays must be unique')
294
+
295
+ const items = []
296
+ for (let index = 0; index < 101; index++) {
297
+ items.push({
298
+ type: 'closed',
299
+ start_date: '2026-01-01',
300
+ end_date: '2026-01-01',
301
+ from: null,
302
+ to: null
303
+ })
304
+ }
305
+ t.notOk(validateUpdatePayload({
306
+ reservations: { opening_hours_exceptions: items }
307
+ }), 'opening_hours_exceptions is limited to 100 items')
308
+ t.end()
309
+ })
310
+
242
311
  test('Configurations: payloads without opening_hours_exceptions remain valid', function (t) {
243
312
  t.plan(1)
244
313
  const valid = validateUpdatePayload({
@@ -250,6 +319,20 @@ test('Configurations: payloads without opening_hours_exceptions remain valid', f
250
319
  t.end()
251
320
  })
252
321
 
322
+ test('Configurations: reservations customization accepts privacy_notice_url as string or null', function (t) {
323
+ t.plan(3)
324
+ ;['https://example.com/privacy', null].forEach(function (privacyNoticeUrl) {
325
+ const valid = validateUpdatePayload({
326
+ reservations: { customization: { privacy_notice_url: privacyNoticeUrl } }
327
+ })
328
+ t.ok(valid, ajv.errorsText(validateUpdatePayload.errors))
329
+ })
330
+ t.notOk(validateUpdatePayload({
331
+ reservations: { customization: { privacy_notice_url: 123 } }
332
+ }), 'privacy_notice_url must be a string or null')
333
+ t.end()
334
+ })
335
+
253
336
  test('Configurations: interfaces seeds scanner_apis.zebra.enabled when scanner_apis is absent', function (t) {
254
337
  t.plan(2)
255
338
  const ajvWithDefaults = new Ajv({ useDefaults: true })