mdp-po-001-v1.schema.json 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "urn:aidop:mdp:MDP-PO-001:1.0.0",
  4. "title": "Purchase order secondary package",
  5. "type": "object",
  6. "required": ["packageCode", "packageVersion", "objectCode", "tenantId", "factoryId", "sourceCode", "datasetKey", "batchId", "sourceSchemaVersion", "mappingVersion", "items"],
  7. "properties": {
  8. "packageCode": { "const": "MDP-PO-001" },
  9. "packageVersion": { "const": "1.0.0" },
  10. "objectCode": { "const": "PURCHASE_ORDER" },
  11. "tenantId": { "type": "string", "pattern": "^[1-9][0-9]*$" },
  12. "factoryId": { "type": "string", "pattern": "^[1-9][0-9]*$" },
  13. "sourceCode": { "type": "string", "minLength": 1 },
  14. "datasetKey": { "const": "lab.erp.purchase-order.v1" },
  15. "batchId": { "type": "string", "minLength": 1 },
  16. "sourceSchemaVersion": { "const": "po-source-v1" },
  17. "mappingVersion": { "const": "po-map-v1" },
  18. "items": {
  19. "type": "array",
  20. "minItems": 1,
  21. "items": {
  22. "type": "object",
  23. "required": ["businessKey", "rawEventId", "poNo", "poLine", "itemCode", "orderQty", "sourceUpdatedAt"],
  24. "properties": {
  25. "businessKey": { "type": "string", "maxLength": 151, "pattern": "^[^#]+#[^#]+$" },
  26. "rawEventId": { "type": "string", "minLength": 1 },
  27. "poNo": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": "^[^#]+$" },
  28. "poLine": { "type": "string", "minLength": 1, "maxLength": 50, "pattern": "^[^#]+$" },
  29. "itemCode": { "type": "string", "minLength": 1, "maxLength": 100 },
  30. "orderQty": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1000000000000, "multipleOf": 0.000001 },
  31. "supplierCode": { "type": ["string", "null"], "maxLength": 100 },
  32. "orderDate": { "$ref": "#/$defs/plantTime" },
  33. "dueDate": { "$ref": "#/$defs/plantTime" },
  34. "status": { "type": ["string", "null"], "maxLength": 50 },
  35. "sourceUpdatedAt": { "type": "string", "format": "date-time", "pattern": "(Z|[+-][0-9]{2}:[0-9]{2})$" }
  36. }
  37. }
  38. }
  39. },
  40. "$defs": {
  41. "plantTime": { "type": ["string", "null"], "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$" }
  42. }
  43. }