@tillhub/schemas 6.462.0 → 6.464.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.
|
@@ -127,5 +127,15 @@ module.exports = {
|
|
|
127
127
|
description: 'entitles the client account to the Merchant Data Copilot chat (/api/v0/{tenantId}/agent-chat)',
|
|
128
128
|
type: 'boolean',
|
|
129
129
|
default: false
|
|
130
|
+
},
|
|
131
|
+
remote_ordering: {
|
|
132
|
+
description: 'entitles the client account to the remote ordering service and triggers its initial data sync',
|
|
133
|
+
type: 'boolean',
|
|
134
|
+
default: false
|
|
135
|
+
},
|
|
136
|
+
e_invoicing: {
|
|
137
|
+
description: 'entitles the client account to e-invoicing and triggers the e-invoicing provisioning',
|
|
138
|
+
type: 'boolean',
|
|
139
|
+
default: false
|
|
130
140
|
}
|
|
131
141
|
}
|
|
@@ -170,6 +170,7 @@ module.exports = oneOf({
|
|
|
170
170
|
opening_hours_exceptions: {
|
|
171
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`.',
|
|
172
172
|
type: 'array',
|
|
173
|
+
maxItems: 100,
|
|
173
174
|
items: {
|
|
174
175
|
type: 'object',
|
|
175
176
|
additionalProperties: false,
|
|
@@ -189,6 +190,7 @@ module.exports = oneOf({
|
|
|
189
190
|
},
|
|
190
191
|
weekdays: {
|
|
191
192
|
type: 'array',
|
|
193
|
+
uniqueItems: true,
|
|
192
194
|
items: {
|
|
193
195
|
type: 'integer',
|
|
194
196
|
minimum: 0,
|
|
@@ -270,6 +272,46 @@ module.exports = oneOf({
|
|
|
270
272
|
}
|
|
271
273
|
]
|
|
272
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
|
+
}
|
|
273
315
|
}
|
|
274
316
|
]
|
|
275
317
|
}
|
package/package.json
CHANGED
|
@@ -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({
|