@pacp/spec 2.0.0 → 2.0.1

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.
Files changed (2) hide show
  1. package/dist/pacp.schema.json +884 -247
  2. package/package.json +1 -1
@@ -1,205 +1,382 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://cdn.jsdelivr.net/npm/@pacp/spec@latest/dist/pacp.schema.json",
4
- "title": "PACP",
4
+ "title": "PACP v2.0.1",
5
5
  "oneOf": [
6
- { "$ref": "#/$defs/catalog_document" },
7
- { "$ref": "#/$defs/product_document" }
6
+ {
7
+ "$ref": "#/$defs/catalog_document"
8
+ },
9
+ {
10
+ "$ref": "#/$defs/product_document"
11
+ }
8
12
  ],
9
13
  "$defs": {
10
14
  "catalog_document": {
11
15
  "type": "object",
12
- "required": ["document_type", "catalog", "rulesets"],
16
+ "required": [
17
+ "document_type",
18
+ "catalog",
19
+ "rulesets"
20
+ ],
13
21
  "additionalProperties": false,
14
- "patternProperties": { "^x-": true },
22
+ "patternProperties": {
23
+ "^x-": true
24
+ },
15
25
  "properties": {
16
- "document_type": { "type": "string", "const": "CATALOG" },
17
- "catalog": { "$ref": "#/$defs/catalog" },
26
+ "document_type": {
27
+ "type": "string",
28
+ "const": "CATALOG"
29
+ },
30
+ "catalog": {
31
+ "$ref": "#/$defs/catalog"
32
+ },
18
33
  "product_refs": {
19
34
  "type": "array",
20
- "items": { "$ref": "#/$defs/product_ref" }
35
+ "items": {
36
+ "$ref": "#/$defs/product_ref"
37
+ }
38
+ },
39
+ "context": {
40
+ "$ref": "#/$defs/context"
41
+ },
42
+ "pricing": {
43
+ "$ref": "#/$defs/pricing"
21
44
  },
22
- "context": { "$ref": "#/$defs/context" },
23
- "pricing": { "$ref": "#/$defs/pricing" },
24
45
  "dictionaries": {
25
46
  "type": "object",
26
47
  "additionalProperties": true,
27
- "patternProperties": { "^x-": true }
48
+ "patternProperties": {
49
+ "^x-": true
50
+ }
28
51
  },
29
52
  "rulesets": {
30
53
  "type": "array",
31
54
  "minItems": 1,
32
- "items": { "$ref": "#/$defs/ruleset" }
55
+ "items": {
56
+ "$ref": "#/$defs/ruleset"
57
+ }
33
58
  },
34
59
  "tables": {
35
60
  "type": "array",
36
- "items": { "$ref": "#/$defs/table" }
61
+ "items": {
62
+ "$ref": "#/$defs/table"
63
+ }
37
64
  },
38
65
  "dependencies": {
39
66
  "type": "array",
40
- "items": { "$ref": "#/$defs/dependency" }
67
+ "items": {
68
+ "$ref": "#/$defs/dependency"
69
+ }
41
70
  },
42
71
  "constraints": {
43
72
  "type": "array",
44
- "items": { "$ref": "#/$defs/constraint" }
73
+ "items": {
74
+ "$ref": "#/$defs/constraint"
75
+ }
45
76
  },
46
77
  "profiles": {
47
78
  "type": "array",
48
- "items": { "type": "string", "minLength": 1 }
79
+ "items": {
80
+ "type": "string",
81
+ "minLength": 1
82
+ }
49
83
  }
50
84
  }
51
85
  },
52
-
53
86
  "product_document": {
54
87
  "type": "object",
55
- "required": ["document_type", "catalog_id", "product"],
88
+ "required": [
89
+ "document_type",
90
+ "catalog_id",
91
+ "product"
92
+ ],
56
93
  "additionalProperties": false,
57
- "patternProperties": { "^x-": true },
94
+ "patternProperties": {
95
+ "^x-": true
96
+ },
58
97
  "properties": {
59
- "document_type": { "type": "string", "const": "PRODUCT" },
60
- "catalog_id": { "type": "string", "minLength": 1 },
61
- "product": { "$ref": "#/$defs/product" },
98
+ "document_type": {
99
+ "type": "string",
100
+ "const": "PRODUCT"
101
+ },
102
+ "catalog_id": {
103
+ "type": "string",
104
+ "minLength": 1
105
+ },
106
+ "product": {
107
+ "$ref": "#/$defs/product"
108
+ },
62
109
  "rulesets": {
63
110
  "type": "array",
64
- "items": { "$ref": "#/$defs/ruleset" }
111
+ "items": {
112
+ "$ref": "#/$defs/ruleset"
113
+ }
65
114
  },
66
115
  "tables": {
67
116
  "type": "array",
68
- "items": { "$ref": "#/$defs/table" }
117
+ "items": {
118
+ "$ref": "#/$defs/table"
119
+ }
69
120
  },
70
121
  "constraints": {
71
122
  "type": "array",
72
- "items": { "$ref": "#/$defs/constraint" }
123
+ "items": {
124
+ "$ref": "#/$defs/constraint"
125
+ }
73
126
  },
74
127
  "dependencies": {
75
128
  "type": "array",
76
- "items": { "$ref": "#/$defs/dependency" }
129
+ "items": {
130
+ "$ref": "#/$defs/dependency"
131
+ }
77
132
  },
78
133
  "profiles": {
79
134
  "type": "array",
80
- "items": { "type": "string", "minLength": 1 }
135
+ "items": {
136
+ "type": "string",
137
+ "minLength": 1
138
+ }
81
139
  }
82
140
  }
83
141
  },
84
-
85
142
  "product_ref": {
86
143
  "type": "object",
87
- "required": ["id", "path"],
144
+ "required": [
145
+ "id",
146
+ "path"
147
+ ],
88
148
  "additionalProperties": false,
89
- "patternProperties": { "^x-": true },
149
+ "patternProperties": {
150
+ "^x-": true
151
+ },
90
152
  "properties": {
91
- "id": { "type": "string", "minLength": 1 },
153
+ "id": {
154
+ "type": "string",
155
+ "minLength": 1
156
+ },
92
157
  "path": {
93
158
  "type": "string",
94
159
  "minLength": 1,
95
160
  "description": "Relative path from catalog root to the product document file",
96
- "examples": ["products/SOF-001.json", "products/MES-042.json"]
161
+ "examples": [
162
+ "products/SOF-001.json",
163
+ "products/MES-042.json"
164
+ ]
97
165
  }
98
166
  }
99
167
  },
100
-
101
168
  "catalog": {
102
169
  "type": "object",
103
- "required": ["id"],
170
+ "required": [
171
+ "id"
172
+ ],
104
173
  "additionalProperties": false,
105
- "patternProperties": { "^x-": true },
174
+ "patternProperties": {
175
+ "^x-": true
176
+ },
106
177
  "properties": {
107
- "id": { "type": "string", "minLength": 1 },
108
- "name": { "type": "string", "minLength": 1 },
109
- "default_price_list_id": { "type": "string", "minLength": 1 },
178
+ "id": {
179
+ "type": "string",
180
+ "minLength": 1
181
+ },
182
+ "name": {
183
+ "type": "string",
184
+ "minLength": 1
185
+ },
186
+ "default_price_list_id": {
187
+ "type": "string",
188
+ "minLength": 1
189
+ },
110
190
  "price_lists": {
111
191
  "type": "array",
112
- "items": { "$ref": "#/$defs/price_list" }
192
+ "items": {
193
+ "$ref": "#/$defs/price_list"
194
+ }
113
195
  }
114
196
  }
115
197
  },
116
-
117
198
  "price_list": {
118
199
  "type": "object",
119
- "required": ["id", "currency"],
200
+ "required": [
201
+ "id",
202
+ "currency"
203
+ ],
120
204
  "additionalProperties": false,
121
- "patternProperties": { "^x-": true },
205
+ "patternProperties": {
206
+ "^x-": true
207
+ },
122
208
  "properties": {
123
- "id": { "type": "string", "minLength": 1 },
124
- "label": { "type": "string" },
125
- "currency": { "type": "string", "minLength": 3, "maxLength": 3 },
209
+ "id": {
210
+ "type": "string",
211
+ "minLength": 1
212
+ },
213
+ "label": {
214
+ "type": "string"
215
+ },
216
+ "currency": {
217
+ "type": "string",
218
+ "minLength": 3,
219
+ "maxLength": 3
220
+ },
126
221
  "context_match": {
127
222
  "type": "object",
128
- "additionalProperties": { "$ref": "#/$defs/scalar_value" }
223
+ "additionalProperties": {
224
+ "$ref": "#/$defs/scalar_value"
225
+ }
129
226
  }
130
227
  }
131
228
  },
132
-
133
229
  "context": {
134
230
  "type": "object",
135
- "additionalProperties": { "$ref": "#/$defs/scalar_value" },
136
- "patternProperties": { "^x-": true },
231
+ "additionalProperties": {
232
+ "$ref": "#/$defs/scalar_value"
233
+ },
234
+ "patternProperties": {
235
+ "^x-": true
236
+ },
137
237
  "properties": {
138
- "price_list_id": { "type": "string", "minLength": 1 },
139
- "region": { "type": "string" },
140
- "channel": { "type": "string" },
141
- "customer": { "type": "string" },
142
- "lot_id": { "type": "string", "minLength": 1 },
143
- "requested_quantity": { "type": "number", "exclusiveMinimum": 0 },
144
- "requested_unit": { "type": "string", "minLength": 1 }
238
+ "price_list_id": {
239
+ "type": "string",
240
+ "minLength": 1
241
+ },
242
+ "region": {
243
+ "type": "string"
244
+ },
245
+ "channel": {
246
+ "type": "string"
247
+ },
248
+ "customer": {
249
+ "type": "string"
250
+ },
251
+ "lot_id": {
252
+ "type": "string",
253
+ "minLength": 1
254
+ },
255
+ "requested_quantity": {
256
+ "type": "number",
257
+ "exclusiveMinimum": 0
258
+ },
259
+ "requested_unit": {
260
+ "type": "string",
261
+ "minLength": 1
262
+ }
145
263
  }
146
264
  },
147
-
148
265
  "pricing": {
149
266
  "type": "object",
150
267
  "additionalProperties": false,
151
- "patternProperties": { "^x-": true },
268
+ "patternProperties": {
269
+ "^x-": true
270
+ },
152
271
  "properties": {
153
272
  "calculation_mode": {
154
273
  "type": "string",
155
- "enum": ["CASCADE", "TABLE_LOOKUP", "OVERRIDE_BY_VARIANT", "COST_PLUS"]
274
+ "enum": [
275
+ "CASCADE",
276
+ "TABLE_LOOKUP",
277
+ "OVERRIDE_BY_VARIANT",
278
+ "COST_PLUS"
279
+ ]
156
280
  }
157
281
  }
158
282
  },
159
-
160
283
  "product": {
161
284
  "type": "object",
162
- "required": ["id", "options"],
285
+ "required": [
286
+ "id",
287
+ "options"
288
+ ],
163
289
  "additionalProperties": false,
164
- "patternProperties": { "^x-": true },
290
+ "patternProperties": {
291
+ "^x-": true
292
+ },
165
293
  "properties": {
166
- "id": { "type": "string", "minLength": 1 },
167
- "name": { "type": "string" },
168
- "sku": { "type": "string", "minLength": 1 },
169
- "manufacturer": { "type": "string", "minLength": 1 },
170
- "brand": { "type": "string", "minLength": 1 },
171
- "description": { "type": "string" },
172
- "category": { "type": "string", "minLength": 1 },
173
- "gtin": { "type": "string", "pattern": "^\\d{8,14}$" },
174
- "base_price": { "type": "number" },
175
- "unit": { "type": "string", "minLength": 1 },
294
+ "id": {
295
+ "type": "string",
296
+ "minLength": 1
297
+ },
298
+ "name": {
299
+ "type": "string"
300
+ },
301
+ "sku": {
302
+ "type": "string",
303
+ "minLength": 1
304
+ },
305
+ "manufacturer": {
306
+ "type": "string",
307
+ "minLength": 1
308
+ },
309
+ "brand": {
310
+ "type": "string",
311
+ "minLength": 1
312
+ },
313
+ "description": {
314
+ "type": "string"
315
+ },
316
+ "category": {
317
+ "type": "string",
318
+ "minLength": 1
319
+ },
320
+ "gtin": {
321
+ "type": "string",
322
+ "pattern": "^\\d{8,14}$"
323
+ },
324
+ "base_price": {
325
+ "type": "number"
326
+ },
327
+ "unit": {
328
+ "type": "string",
329
+ "minLength": 1
330
+ },
176
331
  "images": {
177
332
  "type": "array",
178
- "items": { "$ref": "#/$defs/image" }
333
+ "items": {
334
+ "$ref": "#/$defs/image"
335
+ }
179
336
  },
180
337
  "tags": {
181
338
  "type": "array",
182
- "items": { "type": "string", "minLength": 1 }
339
+ "items": {
340
+ "type": "string",
341
+ "minLength": 1
342
+ }
343
+ },
344
+ "weight": {
345
+ "$ref": "#/$defs/measure"
346
+ },
347
+ "dimensions": {
348
+ "$ref": "#/$defs/physical_dimensions"
349
+ },
350
+ "lot_policy": {
351
+ "$ref": "#/$defs/lot_policy"
352
+ },
353
+ "sales_unit": {
354
+ "$ref": "#/$defs/sales_unit"
183
355
  },
184
- "weight": { "$ref": "#/$defs/measure" },
185
- "dimensions": { "$ref": "#/$defs/physical_dimensions" },
186
- "lot_policy": { "$ref": "#/$defs/lot_policy" },
187
- "sales_unit": { "$ref": "#/$defs/sales_unit" },
188
356
  "attributes": {
189
357
  "type": "array",
190
- "items": { "$ref": "#/$defs/attribute_ref" }
358
+ "items": {
359
+ "$ref": "#/$defs/attribute_ref"
360
+ }
191
361
  },
192
362
  "attribute_values": {
193
363
  "type": "array",
194
- "items": { "$ref": "#/$defs/attribute_value" }
364
+ "items": {
365
+ "$ref": "#/$defs/attribute_value"
366
+ }
195
367
  },
196
368
  "options": {
197
369
  "type": "array",
198
- "items": { "$ref": "#/$defs/option" }
370
+ "items": {
371
+ "$ref": "#/$defs/option"
372
+ }
199
373
  },
200
374
  "ruleset_ids": {
201
375
  "type": "array",
202
- "items": { "type": "string", "minLength": 1 }
376
+ "items": {
377
+ "type": "string",
378
+ "minLength": 1
379
+ }
203
380
  }
204
381
  },
205
382
  "allOf": [
@@ -207,374 +384,834 @@
207
384
  "if": {
208
385
  "properties": {
209
386
  "lot_policy": {
210
- "properties": { "source": { "const": "ATTRIBUTE" } },
211
- "required": ["source"]
387
+ "properties": {
388
+ "source": {
389
+ "const": "ATTRIBUTE"
390
+ }
391
+ },
392
+ "required": [
393
+ "source"
394
+ ]
212
395
  }
213
396
  },
214
- "required": ["lot_policy"]
397
+ "required": [
398
+ "lot_policy"
399
+ ]
215
400
  },
216
401
  "then": {
217
402
  "properties": {
218
- "lot_policy": { "required": ["attribute_id"] }
403
+ "lot_policy": {
404
+ "required": [
405
+ "attribute_id"
406
+ ]
407
+ }
219
408
  }
220
409
  }
221
410
  }
222
411
  ]
223
412
  },
224
-
225
413
  "lot_policy": {
226
414
  "type": "object",
227
- "required": ["required", "source"],
415
+ "required": [
416
+ "required",
417
+ "source"
418
+ ],
228
419
  "additionalProperties": false,
229
- "patternProperties": { "^x-": true },
420
+ "patternProperties": {
421
+ "^x-": true
422
+ },
230
423
  "properties": {
231
- "required": { "type": "boolean" },
232
- "source": { "type": "string", "enum": ["CONTEXT", "ATTRIBUTE"] },
233
- "context_key": { "type": "string", "minLength": 1 },
234
- "attribute_id": { "type": "string", "minLength": 1 }
424
+ "required": {
425
+ "type": "boolean"
426
+ },
427
+ "source": {
428
+ "type": "string",
429
+ "enum": [
430
+ "CONTEXT",
431
+ "ATTRIBUTE"
432
+ ]
433
+ },
434
+ "context_key": {
435
+ "type": "string",
436
+ "minLength": 1
437
+ },
438
+ "attribute_id": {
439
+ "type": "string",
440
+ "minLength": 1
441
+ }
235
442
  },
236
443
  "allOf": [
237
444
  {
238
- "if": { "properties": { "source": { "const": "CONTEXT" } } },
239
- "then": { "required": ["context_key"] }
445
+ "if": {
446
+ "properties": {
447
+ "source": {
448
+ "const": "CONTEXT"
449
+ }
450
+ }
451
+ },
452
+ "then": {
453
+ "required": [
454
+ "context_key"
455
+ ]
456
+ }
240
457
  },
241
458
  {
242
- "if": { "properties": { "source": { "const": "ATTRIBUTE" } } },
243
- "then": { "required": ["attribute_id"] }
459
+ "if": {
460
+ "properties": {
461
+ "source": {
462
+ "const": "ATTRIBUTE"
463
+ }
464
+ }
465
+ },
466
+ "then": {
467
+ "required": [
468
+ "attribute_id"
469
+ ]
470
+ }
244
471
  }
245
472
  ]
246
473
  },
247
-
248
474
  "sales_unit": {
249
475
  "type": "object",
250
- "required": ["requested_unit", "sell_unit", "quantity_per_sell_unit", "rounding"],
476
+ "required": [
477
+ "requested_unit",
478
+ "sell_unit",
479
+ "quantity_per_sell_unit",
480
+ "rounding"
481
+ ],
251
482
  "additionalProperties": false,
252
- "patternProperties": { "^x-": true },
483
+ "patternProperties": {
484
+ "^x-": true
485
+ },
253
486
  "properties": {
254
- "requested_unit": { "type": "string", "minLength": 1 },
255
- "sell_unit": { "type": "string", "minLength": 1 },
256
- "quantity_per_sell_unit": { "type": "number", "exclusiveMinimum": 0 },
257
- "rounding": { "type": "string", "enum": ["CEIL", "FLOOR", "ROUND", "HALF_UP"] },
258
- "min_sell_units": { "type": "integer", "minimum": 1 }
487
+ "requested_unit": {
488
+ "type": "string",
489
+ "minLength": 1
490
+ },
491
+ "sell_unit": {
492
+ "type": "string",
493
+ "minLength": 1
494
+ },
495
+ "quantity_per_sell_unit": {
496
+ "type": "number",
497
+ "exclusiveMinimum": 0
498
+ },
499
+ "rounding": {
500
+ "type": "string",
501
+ "enum": [
502
+ "CEIL",
503
+ "FLOOR",
504
+ "ROUND",
505
+ "HALF_UP"
506
+ ]
507
+ },
508
+ "min_sell_units": {
509
+ "type": "integer",
510
+ "minimum": 1
511
+ }
259
512
  }
260
513
  },
261
-
262
514
  "attribute_ref": {
263
515
  "type": "object",
264
- "required": ["id"],
516
+ "required": [
517
+ "id"
518
+ ],
265
519
  "additionalProperties": false,
266
- "patternProperties": { "^x-": true },
520
+ "patternProperties": {
521
+ "^x-": true
522
+ },
267
523
  "properties": {
268
- "id": { "type": "string", "minLength": 1 },
269
- "label": { "type": "string" }
524
+ "id": {
525
+ "type": "string",
526
+ "minLength": 1
527
+ },
528
+ "label": {
529
+ "type": "string"
530
+ }
270
531
  }
271
532
  },
272
-
273
533
  "attribute_value": {
274
534
  "type": "object",
275
- "required": ["attribute_id", "value"],
535
+ "required": [
536
+ "attribute_id",
537
+ "value"
538
+ ],
276
539
  "additionalProperties": false,
277
- "patternProperties": { "^x-": true },
540
+ "patternProperties": {
541
+ "^x-": true
542
+ },
278
543
  "properties": {
279
- "attribute_id": { "type": "string", "minLength": 1 },
280
- "label": { "type": "string" },
281
- "value": { "$ref": "#/$defs/scalar_value" }
544
+ "attribute_id": {
545
+ "type": "string",
546
+ "minLength": 1
547
+ },
548
+ "label": {
549
+ "type": "string"
550
+ },
551
+ "value": {
552
+ "$ref": "#/$defs/scalar_value"
553
+ }
282
554
  }
283
555
  },
284
-
285
556
  "option": {
286
557
  "type": "object",
287
- "required": ["id", "attribute_id", "value"],
558
+ "required": [
559
+ "id",
560
+ "attribute_id",
561
+ "value"
562
+ ],
288
563
  "additionalProperties": false,
289
- "patternProperties": { "^x-": true },
564
+ "patternProperties": {
565
+ "^x-": true
566
+ },
290
567
  "properties": {
291
- "id": { "type": "string", "minLength": 1 },
292
- "attribute_id": { "type": "string", "minLength": 1 },
293
- "label": { "type": "string" },
294
- "value": { "$ref": "#/$defs/scalar_value" }
568
+ "id": {
569
+ "type": "string",
570
+ "minLength": 1
571
+ },
572
+ "attribute_id": {
573
+ "type": "string",
574
+ "minLength": 1
575
+ },
576
+ "label": {
577
+ "type": "string"
578
+ },
579
+ "value": {
580
+ "$ref": "#/$defs/scalar_value"
581
+ }
295
582
  }
296
583
  },
297
-
298
584
  "ruleset": {
299
585
  "type": "object",
300
- "required": ["id", "target", "rules"],
586
+ "required": [
587
+ "id",
588
+ "target",
589
+ "rules"
590
+ ],
301
591
  "additionalProperties": false,
302
- "patternProperties": { "^x-": true },
592
+ "patternProperties": {
593
+ "^x-": true
594
+ },
303
595
  "properties": {
304
- "id": { "type": "string", "minLength": 1 },
596
+ "id": {
597
+ "type": "string",
598
+ "minLength": 1
599
+ },
305
600
  "target": {
306
601
  "type": "string",
307
- "enum": ["BASE", "SUBTOTAL", "TOTAL"]
602
+ "enum": [
603
+ "BASE",
604
+ "SUBTOTAL",
605
+ "TOTAL"
606
+ ]
308
607
  },
309
608
  "rules": {
310
609
  "type": "array",
311
- "items": { "$ref": "#/$defs/rule" }
610
+ "items": {
611
+ "$ref": "#/$defs/rule"
612
+ }
312
613
  }
313
614
  }
314
615
  },
315
-
316
616
  "rule": {
317
617
  "type": "object",
318
- "required": ["id", "operation"],
618
+ "required": [
619
+ "id",
620
+ "operation"
621
+ ],
319
622
  "additionalProperties": false,
320
- "patternProperties": { "^x-": true },
623
+ "patternProperties": {
624
+ "^x-": true
625
+ },
321
626
  "properties": {
322
- "id": { "type": "string", "minLength": 1 },
323
- "priority": { "type": "integer" },
324
- "enabled": { "type": "boolean" },
325
- "when": { "$ref": "#/$defs/condition" },
627
+ "id": {
628
+ "type": "string",
629
+ "minLength": 1
630
+ },
631
+ "priority": {
632
+ "type": "integer"
633
+ },
634
+ "enabled": {
635
+ "type": "boolean"
636
+ },
637
+ "when": {
638
+ "$ref": "#/$defs/condition"
639
+ },
326
640
  "operation": {
327
641
  "type": "string",
328
- "enum": ["ADD", "PERCENT_OF", "OVERRIDE", "LOOKUP", "MAX_OF", "MIN_OF", "PICK", "ROUND", "CAP", "FLOOR"]
642
+ "enum": [
643
+ "ADD",
644
+ "PERCENT_OF",
645
+ "OVERRIDE",
646
+ "LOOKUP",
647
+ "MAX_OF",
648
+ "MIN_OF",
649
+ "PICK",
650
+ "ROUND",
651
+ "CAP",
652
+ "FLOOR"
653
+ ]
654
+ },
655
+ "value": {
656
+ "type": "number"
657
+ },
658
+ "percent": {
659
+ "type": "number"
660
+ },
661
+ "table_id": {
662
+ "type": "string",
663
+ "minLength": 1
329
664
  },
330
- "value": { "type": "number" },
331
- "percent": { "type": "number" },
332
- "table_id": { "type": "string", "minLength": 1 },
333
665
  "components": {
334
666
  "type": "array",
335
- "items": { "$ref": "#/$defs/component" }
667
+ "items": {
668
+ "$ref": "#/$defs/component"
669
+ }
670
+ },
671
+ "precision": {
672
+ "type": "integer",
673
+ "minimum": 0
674
+ },
675
+ "max": {
676
+ "type": "number"
677
+ },
678
+ "min": {
679
+ "type": "number"
680
+ },
681
+ "fallback": {
682
+ "type": "number"
683
+ },
684
+ "option_id": {
685
+ "type": "string"
336
686
  },
337
- "precision": { "type": "integer", "minimum": 0 },
338
- "max": { "type": "number" },
339
- "min": { "type": "number" },
340
- "fallback": { "type": "number" },
341
- "option_id": { "type": "string" },
342
687
  "option_ids": {
343
688
  "type": "array",
344
- "items": { "type": "string" }
689
+ "items": {
690
+ "type": "string"
691
+ }
345
692
  }
346
693
  },
347
694
  "allOf": [
348
695
  {
349
- "if": { "properties": { "operation": { "const": "ADD" } } },
350
- "then": { "required": ["value"] }
696
+ "if": {
697
+ "properties": {
698
+ "operation": {
699
+ "const": "ADD"
700
+ }
701
+ }
702
+ },
703
+ "then": {
704
+ "required": [
705
+ "value"
706
+ ]
707
+ }
351
708
  },
352
709
  {
353
- "if": { "properties": { "operation": { "const": "PERCENT_OF" } } },
354
- "then": { "required": ["percent"] }
710
+ "if": {
711
+ "properties": {
712
+ "operation": {
713
+ "const": "PERCENT_OF"
714
+ }
715
+ }
716
+ },
717
+ "then": {
718
+ "required": [
719
+ "percent"
720
+ ]
721
+ }
355
722
  },
356
723
  {
357
- "if": { "properties": { "operation": { "const": "OVERRIDE" } } },
358
- "then": { "required": ["value"] }
724
+ "if": {
725
+ "properties": {
726
+ "operation": {
727
+ "const": "OVERRIDE"
728
+ }
729
+ }
730
+ },
731
+ "then": {
732
+ "required": [
733
+ "value"
734
+ ]
735
+ }
359
736
  },
360
737
  {
361
- "if": { "properties": { "operation": { "const": "LOOKUP" } } },
362
- "then": { "required": ["table_id"] }
738
+ "if": {
739
+ "properties": {
740
+ "operation": {
741
+ "const": "LOOKUP"
742
+ }
743
+ }
744
+ },
745
+ "then": {
746
+ "required": [
747
+ "table_id"
748
+ ]
749
+ }
363
750
  },
364
751
  {
365
- "if": { "properties": { "operation": { "enum": ["MAX_OF", "MIN_OF", "PICK"] } } },
366
- "then": { "required": ["components"] }
752
+ "if": {
753
+ "properties": {
754
+ "operation": {
755
+ "enum": [
756
+ "MAX_OF",
757
+ "MIN_OF",
758
+ "PICK"
759
+ ]
760
+ }
761
+ }
762
+ },
763
+ "then": {
764
+ "required": [
765
+ "components"
766
+ ]
767
+ }
367
768
  },
368
769
  {
369
- "if": { "properties": { "operation": { "const": "ROUND" } } },
370
- "then": { "required": ["precision"] }
770
+ "if": {
771
+ "properties": {
772
+ "operation": {
773
+ "const": "ROUND"
774
+ }
775
+ }
776
+ },
777
+ "then": {
778
+ "required": [
779
+ "precision"
780
+ ]
781
+ }
371
782
  },
372
783
  {
373
- "if": { "properties": { "operation": { "const": "CAP" } } },
374
- "then": { "required": ["max"] }
784
+ "if": {
785
+ "properties": {
786
+ "operation": {
787
+ "const": "CAP"
788
+ }
789
+ }
790
+ },
791
+ "then": {
792
+ "required": [
793
+ "max"
794
+ ]
795
+ }
375
796
  },
376
797
  {
377
- "if": { "properties": { "operation": { "const": "FLOOR" } } },
378
- "then": { "required": ["min"] }
798
+ "if": {
799
+ "properties": {
800
+ "operation": {
801
+ "const": "FLOOR"
802
+ }
803
+ }
804
+ },
805
+ "then": {
806
+ "required": [
807
+ "min"
808
+ ]
809
+ }
379
810
  }
380
811
  ]
381
812
  },
382
-
383
813
  "component": {
384
814
  "type": "object",
385
815
  "additionalProperties": false,
386
- "patternProperties": { "^x-": true },
816
+ "patternProperties": {
817
+ "^x-": true
818
+ },
387
819
  "properties": {
388
- "label": { "type": "string" },
389
- "value": { "type": "number" },
390
- "table_id": { "type": "string" },
391
- "option_id": { "type": "string" }
820
+ "label": {
821
+ "type": "string"
822
+ },
823
+ "value": {
824
+ "type": "number"
825
+ },
826
+ "table_id": {
827
+ "type": "string"
828
+ },
829
+ "option_id": {
830
+ "type": "string"
831
+ }
392
832
  },
393
833
  "anyOf": [
394
- { "required": ["value"] },
395
- { "required": ["table_id"] }
834
+ {
835
+ "required": [
836
+ "value"
837
+ ]
838
+ },
839
+ {
840
+ "required": [
841
+ "table_id"
842
+ ]
843
+ }
396
844
  ]
397
845
  },
398
-
399
846
  "condition": {
400
847
  "type": "object",
401
848
  "additionalProperties": false,
402
- "patternProperties": { "^x-": true },
849
+ "patternProperties": {
850
+ "^x-": true
851
+ },
403
852
  "anyOf": [
404
- { "required": ["all"] },
405
- { "required": ["any"] }
853
+ {
854
+ "required": [
855
+ "all"
856
+ ]
857
+ },
858
+ {
859
+ "required": [
860
+ "any"
861
+ ]
862
+ }
406
863
  ],
407
864
  "properties": {
408
865
  "all": {
409
866
  "type": "array",
410
- "items": { "$ref": "#/$defs/predicate" }
867
+ "items": {
868
+ "$ref": "#/$defs/predicate"
869
+ }
411
870
  },
412
871
  "any": {
413
872
  "type": "array",
414
- "items": { "$ref": "#/$defs/predicate" }
873
+ "items": {
874
+ "$ref": "#/$defs/predicate"
875
+ }
415
876
  }
416
877
  }
417
878
  },
418
-
419
879
  "predicate": {
420
880
  "type": "object",
421
- "required": ["fact", "operator"],
881
+ "required": [
882
+ "fact",
883
+ "operator"
884
+ ],
422
885
  "additionalProperties": false,
423
- "patternProperties": { "^x-": true },
886
+ "patternProperties": {
887
+ "^x-": true
888
+ },
424
889
  "properties": {
425
- "fact": { "type": "string" },
890
+ "fact": {
891
+ "type": "string"
892
+ },
426
893
  "operator": {
427
894
  "type": "string",
428
- "enum": ["EQ", "NEQ", "IN", "NOT_IN", "GT", "GTE", "LT", "LTE", "EXISTS"]
895
+ "enum": [
896
+ "EQ",
897
+ "NEQ",
898
+ "IN",
899
+ "NOT_IN",
900
+ "GT",
901
+ "GTE",
902
+ "LT",
903
+ "LTE",
904
+ "EXISTS"
905
+ ]
906
+ },
907
+ "value": {
908
+ "$ref": "#/$defs/scalar_value"
429
909
  },
430
- "value": { "$ref": "#/$defs/scalar_value" },
431
910
  "values": {
432
911
  "type": "array",
433
- "items": { "$ref": "#/$defs/scalar_value" }
912
+ "items": {
913
+ "$ref": "#/$defs/scalar_value"
914
+ }
434
915
  }
435
916
  }
436
917
  },
437
-
438
918
  "table": {
439
919
  "type": "object",
440
- "required": ["id", "type", "dimensions", "rows"],
920
+ "required": [
921
+ "id",
922
+ "type",
923
+ "dimensions",
924
+ "rows"
925
+ ],
441
926
  "additionalProperties": false,
442
- "patternProperties": { "^x-": true },
927
+ "patternProperties": {
928
+ "^x-": true
929
+ },
443
930
  "properties": {
444
- "id": { "type": "string", "minLength": 1 },
445
- "type": { "type": "string", "enum": ["LOOKUP"] },
931
+ "id": {
932
+ "type": "string",
933
+ "minLength": 1
934
+ },
935
+ "type": {
936
+ "type": "string",
937
+ "enum": [
938
+ "LOOKUP"
939
+ ]
940
+ },
446
941
  "dimensions": {
447
942
  "type": "array",
448
943
  "minItems": 1,
449
- "items": { "$ref": "#/$defs/lookup_axis" }
944
+ "items": {
945
+ "$ref": "#/$defs/lookup_axis"
946
+ }
450
947
  },
451
948
  "rows": {
452
949
  "type": "array",
453
950
  "minItems": 1,
454
- "items": { "$ref": "#/$defs/table_row" }
951
+ "items": {
952
+ "$ref": "#/$defs/table_row"
953
+ }
455
954
  }
456
955
  }
457
956
  },
458
-
459
957
  "lookup_axis": {
460
958
  "type": "object",
461
- "required": ["key", "source"],
959
+ "required": [
960
+ "key",
961
+ "source"
962
+ ],
462
963
  "additionalProperties": false,
463
- "patternProperties": { "^x-": true },
964
+ "patternProperties": {
965
+ "^x-": true
966
+ },
464
967
  "properties": {
465
- "key": { "type": "string" },
466
- "source": { "type": "string", "enum": ["ATTRIBUTE", "CONTEXT", "LITERAL"] },
467
- "attribute_id": { "type": "string" },
468
- "context_key": { "type": "string" },
469
- "literal": { "$ref": "#/$defs/scalar_value" }
968
+ "key": {
969
+ "type": "string"
970
+ },
971
+ "source": {
972
+ "type": "string",
973
+ "enum": [
974
+ "ATTRIBUTE",
975
+ "CONTEXT",
976
+ "LITERAL"
977
+ ]
978
+ },
979
+ "attribute_id": {
980
+ "type": "string"
981
+ },
982
+ "context_key": {
983
+ "type": "string"
984
+ },
985
+ "literal": {
986
+ "$ref": "#/$defs/scalar_value"
987
+ }
470
988
  }
471
989
  },
472
-
473
990
  "table_row": {
474
991
  "type": "object",
475
- "required": ["key", "value"],
992
+ "required": [
993
+ "key",
994
+ "value"
995
+ ],
476
996
  "additionalProperties": false,
477
- "patternProperties": { "^x-": true },
997
+ "patternProperties": {
998
+ "^x-": true
999
+ },
478
1000
  "properties": {
479
1001
  "key": {
480
1002
  "type": "object",
481
- "additionalProperties": { "$ref": "#/$defs/scalar_value" }
1003
+ "additionalProperties": {
1004
+ "$ref": "#/$defs/scalar_value"
1005
+ }
482
1006
  },
483
- "value": { "type": "number" }
1007
+ "value": {
1008
+ "type": "number"
1009
+ }
484
1010
  }
485
1011
  },
486
-
487
1012
  "dependency": {
488
1013
  "type": "object",
489
- "required": ["id", "type"],
1014
+ "required": [
1015
+ "id",
1016
+ "type"
1017
+ ],
490
1018
  "additionalProperties": false,
491
- "patternProperties": { "^x-": true },
1019
+ "patternProperties": {
1020
+ "^x-": true
1021
+ },
492
1022
  "properties": {
493
- "id": { "type": "string", "minLength": 1 },
494
- "type": { "type": "string", "enum": ["REQUIRES", "IMPLIES", "AVAILABLE_OPTIONS_WHEN"] },
495
- "product_id": { "type": "string" },
496
- "option_id": { "type": "string" },
1023
+ "id": {
1024
+ "type": "string",
1025
+ "minLength": 1
1026
+ },
1027
+ "type": {
1028
+ "type": "string",
1029
+ "enum": [
1030
+ "REQUIRES",
1031
+ "IMPLIES",
1032
+ "AVAILABLE_OPTIONS_WHEN"
1033
+ ]
1034
+ },
1035
+ "product_id": {
1036
+ "type": "string"
1037
+ },
1038
+ "option_id": {
1039
+ "type": "string"
1040
+ },
497
1041
  "requires_option_ids": {
498
1042
  "type": "array",
499
- "items": { "type": "string" }
1043
+ "items": {
1044
+ "type": "string"
1045
+ }
500
1046
  },
501
1047
  "allowed_option_ids": {
502
1048
  "type": "array",
503
- "items": { "type": "string" }
1049
+ "items": {
1050
+ "type": "string"
1051
+ }
504
1052
  },
505
- "when": { "$ref": "#/$defs/condition" }
1053
+ "when": {
1054
+ "$ref": "#/$defs/condition"
1055
+ }
506
1056
  },
507
1057
  "allOf": [
508
1058
  {
509
- "if": { "properties": { "type": { "const": "REQUIRES" } } },
510
- "then": { "required": ["option_id", "requires_option_ids"] }
1059
+ "if": {
1060
+ "properties": {
1061
+ "type": {
1062
+ "const": "REQUIRES"
1063
+ }
1064
+ }
1065
+ },
1066
+ "then": {
1067
+ "required": [
1068
+ "option_id",
1069
+ "requires_option_ids"
1070
+ ]
1071
+ }
511
1072
  },
512
1073
  {
513
- "if": { "properties": { "type": { "const": "AVAILABLE_OPTIONS_WHEN" } } },
514
- "then": { "required": ["allowed_option_ids", "when"] }
1074
+ "if": {
1075
+ "properties": {
1076
+ "type": {
1077
+ "const": "AVAILABLE_OPTIONS_WHEN"
1078
+ }
1079
+ }
1080
+ },
1081
+ "then": {
1082
+ "required": [
1083
+ "allowed_option_ids",
1084
+ "when"
1085
+ ]
1086
+ }
515
1087
  }
516
1088
  ]
517
1089
  },
518
-
519
1090
  "constraint": {
520
1091
  "type": "object",
521
- "required": ["id", "type", "when", "message"],
1092
+ "required": [
1093
+ "id",
1094
+ "type",
1095
+ "when",
1096
+ "message"
1097
+ ],
522
1098
  "additionalProperties": false,
523
- "patternProperties": { "^x-": true },
1099
+ "patternProperties": {
1100
+ "^x-": true
1101
+ },
524
1102
  "properties": {
525
- "id": { "type": "string", "minLength": 1 },
526
- "type": { "type": "string", "enum": ["DENY"] },
527
- "product_id": { "type": "string" },
1103
+ "id": {
1104
+ "type": "string",
1105
+ "minLength": 1
1106
+ },
1107
+ "type": {
1108
+ "type": "string",
1109
+ "enum": [
1110
+ "DENY"
1111
+ ]
1112
+ },
1113
+ "product_id": {
1114
+ "type": "string"
1115
+ },
528
1116
  "option_ids": {
529
1117
  "type": "array",
530
- "items": { "type": "string" }
1118
+ "items": {
1119
+ "type": "string"
1120
+ }
1121
+ },
1122
+ "when": {
1123
+ "$ref": "#/$defs/condition"
531
1124
  },
532
- "when": { "$ref": "#/$defs/condition" },
533
- "message": { "type": "string", "minLength": 1 }
1125
+ "message": {
1126
+ "type": "string",
1127
+ "minLength": 1
1128
+ }
534
1129
  }
535
1130
  },
536
-
537
1131
  "image": {
538
1132
  "type": "object",
539
- "required": ["url"],
1133
+ "required": [
1134
+ "url"
1135
+ ],
540
1136
  "additionalProperties": false,
541
- "patternProperties": { "^x-": true },
1137
+ "patternProperties": {
1138
+ "^x-": true
1139
+ },
542
1140
  "properties": {
543
- "url": { "type": "string", "format": "uri" },
544
- "label": { "type": "string" },
1141
+ "url": {
1142
+ "type": "string",
1143
+ "format": "uri"
1144
+ },
1145
+ "label": {
1146
+ "type": "string"
1147
+ },
545
1148
  "type": {
546
1149
  "type": "string",
547
- "enum": ["MAIN", "DETAIL", "AMBIANCE", "TECHNICAL", "OTHER"]
1150
+ "enum": [
1151
+ "MAIN",
1152
+ "DETAIL",
1153
+ "AMBIANCE",
1154
+ "TECHNICAL",
1155
+ "OTHER"
1156
+ ]
548
1157
  }
549
1158
  }
550
1159
  },
551
-
552
1160
  "measure": {
553
1161
  "type": "object",
554
- "required": ["value", "unit"],
1162
+ "required": [
1163
+ "value",
1164
+ "unit"
1165
+ ],
555
1166
  "additionalProperties": false,
556
- "patternProperties": { "^x-": true },
1167
+ "patternProperties": {
1168
+ "^x-": true
1169
+ },
557
1170
  "properties": {
558
- "value": { "type": "number", "exclusiveMinimum": 0 },
559
- "unit": { "type": "string", "minLength": 1 }
1171
+ "value": {
1172
+ "type": "number",
1173
+ "exclusiveMinimum": 0
1174
+ },
1175
+ "unit": {
1176
+ "type": "string",
1177
+ "minLength": 1
1178
+ }
560
1179
  }
561
1180
  },
562
-
563
1181
  "physical_dimensions": {
564
1182
  "type": "object",
565
- "required": ["unit"],
1183
+ "required": [
1184
+ "unit"
1185
+ ],
566
1186
  "additionalProperties": false,
567
- "patternProperties": { "^x-": true },
1187
+ "patternProperties": {
1188
+ "^x-": true
1189
+ },
568
1190
  "properties": {
569
- "width": { "type": "number", "exclusiveMinimum": 0 },
570
- "height": { "type": "number", "exclusiveMinimum": 0 },
571
- "depth": { "type": "number", "exclusiveMinimum": 0 },
572
- "unit": { "type": "string", "minLength": 1 }
1191
+ "width": {
1192
+ "type": "number",
1193
+ "exclusiveMinimum": 0
1194
+ },
1195
+ "height": {
1196
+ "type": "number",
1197
+ "exclusiveMinimum": 0
1198
+ },
1199
+ "depth": {
1200
+ "type": "number",
1201
+ "exclusiveMinimum": 0
1202
+ },
1203
+ "unit": {
1204
+ "type": "string",
1205
+ "minLength": 1
1206
+ }
573
1207
  }
574
1208
  },
575
-
576
1209
  "scalar_value": {
577
- "type": ["string", "number", "boolean"]
1210
+ "type": [
1211
+ "string",
1212
+ "number",
1213
+ "boolean"
1214
+ ]
578
1215
  }
579
1216
  }
580
1217
  }