-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcirpass2-eu-registry-pointer.schema.json
More file actions
128 lines (128 loc) · 3.76 KB
/
Copy pathcirpass2-eu-registry-pointer.schema.json
File metadata and controls
128 lines (128 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "EU DPP Registry Metadata",
"description": "Schema for Digital Product Passport registration metadata in the EU Registry",
"type": "object",
"required": [
"upi",
"reoId",
"liveURL",
"backupURL",
"commodityCode",
"facilitiesId",
"granularityLevel"
],
"properties": {
"upi": {
"type": "string",
"description": "Unique Product Identifier - the unique identifier of the product",
"minLength": 1,
"maxLength": 200,
"examples": ["urn:epc:id:sgtin:0614141.107346.2017"]
},
"reoId": {
"type": "string",
"description": "Responsible Economic Operator ID",
"minLength": 1,
"maxLength": 50,
"examples": ["LEI-529900T8BM49AURSDO55", "EORI-IT123456789"]
},
"facilitiesId": {
"type": "array",
"uniqueItems": true,
"minItems": 1,
"items": {
"type": "string",
"maxLength": 250
},
"description": "Facility ID where the product is manufactured/assembled",
"examples": ["GLN-5412345000013", "FAC-MILANO-001"]
},
"liveURL": {
"type": "string",
"format": "uri",
"description": "Primary URL to retrieve the related DPP data",
"pattern": "^http",
"examples": ["https://dpp.example.com/product/12345"]
},
"backupURL": {
"type": "string",
"format": "uri",
"description": "Backup URL to retrieve the related DPP data",
"pattern": "^http",
"examples": ["https://backup-dpp.example.com/product/12345"]
},
"commodityCode": {
"type": "string",
"description": "The commodity code of the product (e.g., HS Code, TARIC)",
"pattern": "^[0-9]{4,10}$",
"examples": ["85176200", "8517620090"]
},
"granularityLevel": {
"type": "string",
"description": "The granularity level of the DPP",
"enum": ["MODEL", "BATCH", "ITEM"],
"examples": ["MODEL"]
},
"deactivated": {
"type": ["boolean", "null"],
"description": "True if the DPP has been deactivated, false/null otherwise. Required when granularityLevel = ITEM",
"examples": [true, false, null]
},
"modelUpi": {
"type": "string",
"description": "The UPI of the model-level registry entry. Required when granularityLevel = BATCH or ITEM",
"minLength": 1,
"maxLength": 200,
"examples": ["urn:epc:id:sgtin:0614141.107346.2017"]
},
"batchUpi": {
"type": "string",
"description": "The UPI of the batch-level registry entry. Required when granularityLevel = ITEM",
"minLength": 1,
"maxLength": 200,
"examples": ["urn:epc:id:sgtin:0614141.107346.2017"]
}
},
"allOf": [
{
"comment": "ITEM: deactivated + modelUpi + batchUpi required; else deactivated forbidden",
"if": {
"properties": { "granularityLevel": { "const": "ITEM" } },
"required": ["granularityLevel"]
},
"then": {
"required": ["deactivated", "modelUpi", "batchUpi"]
},
"else": {
"not": { "required": ["deactivated"] }
}
},
{
"comment": "BATCH: modelUpi required, batchUpi forbidden",
"if": {
"properties": { "granularityLevel": { "const": "BATCH" } },
"required": ["granularityLevel"]
},
"then": {
"required": ["modelUpi"],
"not": { "required": ["batchUpi"] }
}
},
{
"comment": "MODEL: modelUpi e batchUpi forbidden",
"if": {
"properties": { "granularityLevel": { "const": "MODEL" } },
"required": ["granularityLevel"]
},
"then": {
"not": {
"anyOf": [
{ "required": ["modelUpi"] },
{ "required": ["batchUpi"] }
]
}
}
}
]
}