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