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