@pacp/spec 3.3.0 → 3.4.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,7 +1,7 @@
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 v3.3.0",
4
+ "title": "PACP v3.4.1",
5
5
  "oneOf": [
6
6
  {
7
7
  "$ref": "#/$defs/catalog_document"
@@ -331,7 +331,7 @@
331
331
  },
332
332
  "minItems": 1
333
333
  },
334
- "description": "Categorias hierárquicas do produto. Cada item é um path da raiz à folha, ex.: [[\"Móveis\", \"Sofá\"], [\"Promoções\"]]."
334
+ "description": "Categorias hier\u00e1rquicas do produto. Cada item \u00e9 um path da raiz \u00e0 folha, ex.: [[\"M\u00f3veis\", \"Sof\u00e1\"], [\"Promo\u00e7\u00f5es\"]]."
335
335
  },
336
336
  "gtin": {
337
337
  "type": "string",
@@ -364,7 +364,7 @@
364
364
  "type": "string",
365
365
  "minLength": 1
366
366
  },
367
- "description": "Identificadores de coleções às quais o produto pertence (ex.: \"verao_2026\", \"linha_premium\"). Cada item é um ID estável, único por catálogo, com semântica de agrupamento curatorial/sazonal."
367
+ "description": "Identificadores de cole\u00e7\u00f5es \u00e0s quais o produto pertence (ex.: \"verao_2026\", \"linha_premium\"). Cada item \u00e9 um ID est\u00e1vel, \u00fanico por cat\u00e1logo, com sem\u00e2ntica de agrupamento curatorial/sazonal."
368
368
  },
369
369
  "weight": {
370
370
  "$ref": "#/$defs/measure"
@@ -396,6 +396,13 @@
396
396
  "$ref": "#/$defs/option"
397
397
  }
398
398
  },
399
+ "supplied_materials": {
400
+ "type": "array",
401
+ "items": {
402
+ "$ref": "#/$defs/supplied_material"
403
+ },
404
+ "description": "Materiais consumidos pelo produto, com sourcing factory/customer. Ver se\u00e7\u00e3o 4.8."
405
+ },
399
406
  "ruleset_ids": {
400
407
  "type": "array",
401
408
  "items": {
@@ -1183,7 +1190,7 @@
1183
1190
  "position": {
1184
1191
  "type": "integer",
1185
1192
  "minimum": 0,
1186
- "description": "Ordem explícita de exibição; quando presente, consumidores DEVEM ordenar por position crescente."
1193
+ "description": "Ordem expl\u00edcita de exibi\u00e7\u00e3o; quando presente, consumidores DEVEM ordenar por position crescente."
1187
1194
  },
1188
1195
  "type": {
1189
1196
  "type": "string",
@@ -1252,6 +1259,239 @@
1252
1259
  "number",
1253
1260
  "boolean"
1254
1261
  ]
1262
+ },
1263
+ "supplied_material_quantity": {
1264
+ "type": "object",
1265
+ "additionalProperties": false,
1266
+ "patternProperties": {
1267
+ "^x-": true
1268
+ },
1269
+ "properties": {
1270
+ "value": {
1271
+ "type": "number",
1272
+ "exclusiveMinimum": 0
1273
+ },
1274
+ "table_id": {
1275
+ "type": "string",
1276
+ "minLength": 1
1277
+ },
1278
+ "unit": {
1279
+ "type": "string",
1280
+ "minLength": 1
1281
+ }
1282
+ },
1283
+ "required": [
1284
+ "unit"
1285
+ ],
1286
+ "oneOf": [
1287
+ {
1288
+ "required": [
1289
+ "value"
1290
+ ],
1291
+ "not": {
1292
+ "required": [
1293
+ "table_id"
1294
+ ]
1295
+ }
1296
+ },
1297
+ {
1298
+ "required": [
1299
+ "table_id"
1300
+ ],
1301
+ "not": {
1302
+ "required": [
1303
+ "value"
1304
+ ]
1305
+ }
1306
+ }
1307
+ ],
1308
+ "description": "Quantidade de insumo necess\u00e1ria. Aceita value fixo (number > 0) OU table_id (lookup). Sempre exige unit."
1309
+ },
1310
+ "supplied_material_cost": {
1311
+ "type": "object",
1312
+ "additionalProperties": false,
1313
+ "patternProperties": {
1314
+ "^x-": true
1315
+ },
1316
+ "properties": {
1317
+ "value": {
1318
+ "type": "number",
1319
+ "minimum": 0
1320
+ },
1321
+ "table_id": {
1322
+ "type": "string",
1323
+ "minLength": 1
1324
+ },
1325
+ "ruleset_id": {
1326
+ "type": "string",
1327
+ "minLength": 1
1328
+ }
1329
+ },
1330
+ "oneOf": [
1331
+ {
1332
+ "required": [
1333
+ "value"
1334
+ ],
1335
+ "not": {
1336
+ "anyOf": [
1337
+ {
1338
+ "required": [
1339
+ "table_id"
1340
+ ]
1341
+ },
1342
+ {
1343
+ "required": [
1344
+ "ruleset_id"
1345
+ ]
1346
+ }
1347
+ ]
1348
+ }
1349
+ },
1350
+ {
1351
+ "required": [
1352
+ "table_id"
1353
+ ],
1354
+ "not": {
1355
+ "anyOf": [
1356
+ {
1357
+ "required": [
1358
+ "value"
1359
+ ]
1360
+ },
1361
+ {
1362
+ "required": [
1363
+ "ruleset_id"
1364
+ ]
1365
+ }
1366
+ ]
1367
+ }
1368
+ },
1369
+ {
1370
+ "required": [
1371
+ "ruleset_id"
1372
+ ],
1373
+ "not": {
1374
+ "anyOf": [
1375
+ {
1376
+ "required": [
1377
+ "value"
1378
+ ]
1379
+ },
1380
+ {
1381
+ "required": [
1382
+ "table_id"
1383
+ ]
1384
+ }
1385
+ ]
1386
+ }
1387
+ }
1388
+ ],
1389
+ "description": "Custo do material quando fonte=FACTORY. Exatamente um de value, table_id ou ruleset_id."
1390
+ },
1391
+ "source_when": {
1392
+ "type": "object",
1393
+ "additionalProperties": false,
1394
+ "patternProperties": {
1395
+ "^x-": true
1396
+ },
1397
+ "required": [
1398
+ "factory",
1399
+ "customer"
1400
+ ],
1401
+ "properties": {
1402
+ "factory": {
1403
+ "type": "array",
1404
+ "minItems": 1,
1405
+ "uniqueItems": true,
1406
+ "items": {
1407
+ "type": [
1408
+ "string",
1409
+ "number",
1410
+ "boolean"
1411
+ ]
1412
+ }
1413
+ },
1414
+ "customer": {
1415
+ "type": "array",
1416
+ "minItems": 1,
1417
+ "uniqueItems": true,
1418
+ "items": {
1419
+ "type": [
1420
+ "string",
1421
+ "number",
1422
+ "boolean"
1423
+ ]
1424
+ }
1425
+ }
1426
+ },
1427
+ "description": "Mapeia option.value -> modo de sourcing. Cada valor da option do attribute referenciado por sourcing_attribute_id deve aparecer em factory[] OU customer[]."
1428
+ },
1429
+ "supplied_material": {
1430
+ "type": "object",
1431
+ "additionalProperties": false,
1432
+ "patternProperties": {
1433
+ "^x-": true
1434
+ },
1435
+ "required": [
1436
+ "id",
1437
+ "material",
1438
+ "quantity"
1439
+ ],
1440
+ "properties": {
1441
+ "id": {
1442
+ "type": "string",
1443
+ "minLength": 1
1444
+ },
1445
+ "material": {
1446
+ "type": "string",
1447
+ "minLength": 1,
1448
+ "pattern": "^[A-Z][A-Z0-9_]*$"
1449
+ },
1450
+ "quantity": {
1451
+ "$ref": "#/$defs/supplied_material_quantity"
1452
+ },
1453
+ "default_source": {
1454
+ "type": "string",
1455
+ "enum": [
1456
+ "FACTORY",
1457
+ "CUSTOMER"
1458
+ ],
1459
+ "default": "FACTORY"
1460
+ },
1461
+ "sourcing_attribute_id": {
1462
+ "type": "string",
1463
+ "minLength": 1
1464
+ },
1465
+ "source_when": {
1466
+ "$ref": "#/$defs/source_when"
1467
+ },
1468
+ "factory_cost": {
1469
+ "$ref": "#/$defs/supplied_material_cost"
1470
+ },
1471
+ "requirements": {
1472
+ "type": "object",
1473
+ "additionalProperties": true,
1474
+ "patternProperties": {
1475
+ "^x-": true
1476
+ },
1477
+ "description": "Bloco livre de requisitos do material. Profiles podem padronizar subgrupos como x-fabric_requirements."
1478
+ }
1479
+ },
1480
+ "allOf": [
1481
+ {
1482
+ "if": {
1483
+ "required": [
1484
+ "sourcing_attribute_id"
1485
+ ]
1486
+ },
1487
+ "then": {
1488
+ "required": [
1489
+ "source_when"
1490
+ ]
1491
+ }
1492
+ }
1493
+ ],
1494
+ "description": "Insumo consumido pelo produto, com regra de quem fornece (f\u00e1brica ou cliente). Ver se\u00e7\u00e3o 4.8 da spec."
1255
1495
  }
1256
1496
  }
1257
- }
1497
+ }
@@ -37,6 +37,25 @@
37
37
  "type": "string",
38
38
  "enum": ["INDOOR", "OUTDOOR", "BOTH"],
39
39
  "description": "Indicacao de uso interno, externo ou ambos."
40
+ },
41
+ "x-fabric_requirements": {
42
+ "type": "object",
43
+ "additionalProperties": true,
44
+ "properties": {
45
+ "min_weight_gsm": { "type": "number", "exclusiveMinimum": 0, "description": "Gramatura mínima do tecido (g/m²)." },
46
+ "max_weight_gsm": { "type": "number", "exclusiveMinimum": 0, "description": "Gramatura máxima do tecido (g/m²)." },
47
+ "min_width_cm": { "type": "number", "exclusiveMinimum": 0, "description": "Largura mínima do rolo (cm)." },
48
+ "allowed_compositions": {
49
+ "type": "array",
50
+ "minItems": 1,
51
+ "uniqueItems": true,
52
+ "items": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]*$" },
53
+ "description": "Composições aceitas (uppercase, ex: LINHO, ALGODAO, VELUDO)."
54
+ },
55
+ "abrasion_min_cycles_martindale": { "type": "integer", "minimum": 0, "description": "Resistência mínima à abrasão (ciclos Martindale)." },
56
+ "flammability_standard": { "type": "string", "minLength": 1, "description": "Norma de inflamabilidade exigida (ex: NBR_15805)." }
57
+ },
58
+ "description": "Requisitos para tecido fornecido pelo cliente. Usado dentro de supplied_materials[].requirements."
40
59
  }
41
60
  },
42
61
  "additionalProperties": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pacp/spec",
3
- "version": "3.3.0",
3
+ "version": "3.4.1",
4
4
  "description": "PACP - Padrão Aberto de Catálogo e Precificação. Schema, profiles e validador para catálogos de produtos.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",