@gruncellka/porto-data 0.1.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.
@@ -0,0 +1,223 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/data_links.schema.json",
4
+ "title": "Data Links Schema",
5
+ "description": "Schema for data file dependencies and relationships",
6
+ "type": "object",
7
+ "required": [
8
+ "file_type",
9
+ "schema_version",
10
+ "unit",
11
+ "dependencies",
12
+ "links",
13
+ "lookup_rules",
14
+ "global_settings"
15
+ ],
16
+ "properties": {
17
+ "$schema": {
18
+ "type": "string",
19
+ "format": "uri",
20
+ "description": "JSON Schema URI reference"
21
+ },
22
+ "file_type": {
23
+ "type": "string",
24
+ "const": "data_links",
25
+ "description": "File type identifier"
26
+ },
27
+ "schema_version": {
28
+ "type": "string",
29
+ "const": "1.0",
30
+ "description": "Schema version"
31
+ },
32
+ "unit": {
33
+ "type": "object",
34
+ "required": [
35
+ "weight",
36
+ "dimension",
37
+ "price",
38
+ "currency"
39
+ ],
40
+ "properties": {
41
+ "weight": {
42
+ "type": "string",
43
+ "const": "g"
44
+ },
45
+ "dimension": {
46
+ "type": "string",
47
+ "const": "mm"
48
+ },
49
+ "price": {
50
+ "type": "string",
51
+ "const": "cents"
52
+ },
53
+ "currency": {
54
+ "type": "string",
55
+ "const": "EUR"
56
+ }
57
+ },
58
+ "additionalProperties": false
59
+ },
60
+ "dependencies": {
61
+ "type": "object",
62
+ "patternProperties": {
63
+ "^[a-z_]+$": {
64
+ "type": "object",
65
+ "required": [
66
+ "file",
67
+ "depends_on",
68
+ "description"
69
+ ],
70
+ "properties": {
71
+ "file": {
72
+ "type": "string",
73
+ "pattern": "^[a-z_]+\\.json$",
74
+ "description": "Data file name"
75
+ },
76
+ "depends_on": {
77
+ "type": "array",
78
+ "items": {
79
+ "type": "string",
80
+ "pattern": "^[a-z_]+\\.json$"
81
+ },
82
+ "description": "List of dependent files"
83
+ },
84
+ "description": {
85
+ "type": "string",
86
+ "minLength": 1,
87
+ "description": "Dependency description"
88
+ }
89
+ },
90
+ "additionalProperties": false
91
+ }
92
+ },
93
+ "additionalProperties": false
94
+ },
95
+ "links": {
96
+ "type": "object",
97
+ "patternProperties": {
98
+ "^[a-z_]+$": {
99
+ "type": "object",
100
+ "required": [
101
+ "zones",
102
+ "weight_tiers"
103
+ ],
104
+ "properties": {
105
+ "zones": {
106
+ "type": "array",
107
+ "minItems": 1,
108
+ "items": {
109
+ "type": "string",
110
+ "enum": [
111
+ "domestic",
112
+ "zone_1_eu",
113
+ "zone_2_europe",
114
+ "world"
115
+ ]
116
+ },
117
+ "description": "Available zones for this product"
118
+ },
119
+ "weight_tiers": {
120
+ "type": "array",
121
+ "minItems": 1,
122
+ "items": {
123
+ "type": "string",
124
+ "pattern": "^W[0-9]+$"
125
+ },
126
+ "description": "Available weight tiers for this product"
127
+ }
128
+ },
129
+ "additionalProperties": false
130
+ }
131
+ },
132
+ "additionalProperties": false
133
+ },
134
+ "lookup_rules": {
135
+ "type": "object",
136
+ "required": [
137
+ "price_lookup",
138
+ "service_lookup",
139
+ "weight_resolution",
140
+ "zone_validation"
141
+ ],
142
+ "properties": {
143
+ "price_lookup": {
144
+ "type": "string",
145
+ "minLength": 1,
146
+ "description": "Price lookup rule description"
147
+ },
148
+ "service_lookup": {
149
+ "type": "string",
150
+ "minLength": 1,
151
+ "description": "Service lookup rule description"
152
+ },
153
+ "weight_resolution": {
154
+ "type": "string",
155
+ "minLength": 1,
156
+ "description": "Weight resolution rule description"
157
+ },
158
+ "zone_validation": {
159
+ "type": "string",
160
+ "minLength": 1,
161
+ "description": "Zone validation rule description"
162
+ }
163
+ },
164
+ "additionalProperties": false
165
+ },
166
+ "global_settings": {
167
+ "type": "object",
168
+ "required": [
169
+ "price_source",
170
+ "lookup_method",
171
+ "available_services"
172
+ ],
173
+ "properties": {
174
+ "price_source": {
175
+ "type": "string",
176
+ "pattern": "^[a-z_]+\\.json$",
177
+ "description": "Source file for prices"
178
+ },
179
+ "lookup_method": {
180
+ "type": "object",
181
+ "required": [
182
+ "file",
183
+ "array",
184
+ "match",
185
+ "description"
186
+ ],
187
+ "properties": {
188
+ "file": {
189
+ "type": "string",
190
+ "pattern": "^[a-z_]+\\.json$"
191
+ },
192
+ "array": {
193
+ "type": "string",
194
+ "minLength": 1
195
+ },
196
+ "match": {
197
+ "type": "object",
198
+ "additionalProperties": {
199
+ "type": "string"
200
+ }
201
+ },
202
+ "description": {
203
+ "type": "string",
204
+ "minLength": 1
205
+ }
206
+ },
207
+ "additionalProperties": false
208
+ },
209
+ "available_services": {
210
+ "type": "array",
211
+ "minItems": 1,
212
+ "items": {
213
+ "type": "string",
214
+ "pattern": "^[a-z_]+$"
215
+ },
216
+ "description": "List of available service IDs"
217
+ }
218
+ },
219
+ "additionalProperties": false
220
+ }
221
+ },
222
+ "additionalProperties": false
223
+ }
@@ -0,0 +1,215 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/dimensions.schema.json",
4
+ "title": "Dimensions Schema",
5
+ "description": "Schema for envelope dimension definitions",
6
+ "type": "object",
7
+ "required": [
8
+ "file_type",
9
+ "unit",
10
+ "dimensions"
11
+ ],
12
+ "properties": {
13
+ "$schema": {
14
+ "type": "string",
15
+ "format": "uri",
16
+ "description": "JSON Schema URI reference"
17
+ },
18
+ "file_type": {
19
+ "type": "string",
20
+ "const": "dimensions",
21
+ "description": "File type identifier"
22
+ },
23
+ "unit": {
24
+ "type": "object",
25
+ "required": [
26
+ "dimension"
27
+ ],
28
+ "properties": {
29
+ "dimension": {
30
+ "type": "string",
31
+ "const": "mm"
32
+ }
33
+ },
34
+ "additionalProperties": false
35
+ },
36
+ "dimensions": {
37
+ "type": "array",
38
+ "minItems": 1,
39
+ "items": {
40
+ "type": "object",
41
+ "required": [
42
+ "id",
43
+ "label",
44
+ "standard",
45
+ "size",
46
+ "print_area",
47
+ "stamp_area",
48
+ "orientation",
49
+ "weight_tier"
50
+ ],
51
+ "properties": {
52
+ "id": {
53
+ "type": "string",
54
+ "pattern": "^[A-Z0-9]+$",
55
+ "description": "Dimension ID"
56
+ },
57
+ "label": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "description": "Human-readable dimension label"
61
+ },
62
+ "standard": {
63
+ "type": "string",
64
+ "minLength": 1,
65
+ "description": "Standard specification"
66
+ },
67
+ "size": {
68
+ "type": "object",
69
+ "required": [
70
+ "width",
71
+ "height"
72
+ ],
73
+ "properties": {
74
+ "width": {
75
+ "type": "integer",
76
+ "minimum": 1,
77
+ "description": "Width in millimeters"
78
+ },
79
+ "height": {
80
+ "type": "integer",
81
+ "minimum": 1,
82
+ "description": "Height in millimeters"
83
+ },
84
+ "thickness": {
85
+ "type": "integer",
86
+ "minimum": 0,
87
+ "description": "Thickness in millimeters"
88
+ }
89
+ },
90
+ "additionalProperties": false
91
+ },
92
+ "print_area": {
93
+ "type": "object",
94
+ "required": [
95
+ "x",
96
+ "y",
97
+ "width",
98
+ "height"
99
+ ],
100
+ "properties": {
101
+ "x": {
102
+ "type": "integer",
103
+ "minimum": 0,
104
+ "description": "X coordinate in millimeters"
105
+ },
106
+ "y": {
107
+ "type": "integer",
108
+ "minimum": 0,
109
+ "description": "Y coordinate in millimeters"
110
+ },
111
+ "width": {
112
+ "type": "integer",
113
+ "minimum": 1,
114
+ "description": "Width in millimeters"
115
+ },
116
+ "height": {
117
+ "type": "integer",
118
+ "minimum": 1,
119
+ "description": "Height in millimeters"
120
+ }
121
+ },
122
+ "additionalProperties": false
123
+ },
124
+ "stamp_area": {
125
+ "type": "object",
126
+ "required": [
127
+ "x",
128
+ "y",
129
+ "width",
130
+ "height"
131
+ ],
132
+ "properties": {
133
+ "x": {
134
+ "type": "integer",
135
+ "minimum": 0,
136
+ "description": "X coordinate in millimeters"
137
+ },
138
+ "y": {
139
+ "type": "integer",
140
+ "minimum": 0,
141
+ "description": "Y coordinate in millimeters"
142
+ },
143
+ "width": {
144
+ "type": "integer",
145
+ "minimum": 1,
146
+ "description": "Width in millimeters"
147
+ },
148
+ "height": {
149
+ "type": "integer",
150
+ "minimum": 1,
151
+ "description": "Height in millimeters"
152
+ }
153
+ },
154
+ "additionalProperties": false
155
+ },
156
+ "window_supported": {
157
+ "type": "boolean",
158
+ "description": "Whether window is supported"
159
+ },
160
+ "supports_window": {
161
+ "type": "boolean",
162
+ "description": "Whether window is supported (alternative field)"
163
+ },
164
+ "window_area": {
165
+ "type": "object",
166
+ "required": [
167
+ "x",
168
+ "y",
169
+ "width",
170
+ "height"
171
+ ],
172
+ "properties": {
173
+ "x": {
174
+ "type": "integer",
175
+ "minimum": 0,
176
+ "description": "X coordinate in millimeters"
177
+ },
178
+ "y": {
179
+ "type": "integer",
180
+ "minimum": 0,
181
+ "description": "Y coordinate in millimeters"
182
+ },
183
+ "width": {
184
+ "type": "integer",
185
+ "minimum": 1,
186
+ "description": "Width in millimeters"
187
+ },
188
+ "height": {
189
+ "type": "integer",
190
+ "minimum": 1,
191
+ "description": "Height in millimeters"
192
+ }
193
+ },
194
+ "additionalProperties": false
195
+ },
196
+ "orientation": {
197
+ "type": "string",
198
+ "enum": [
199
+ "landscape",
200
+ "portrait"
201
+ ],
202
+ "description": "Envelope orientation"
203
+ },
204
+ "weight_tier": {
205
+ "type": "string",
206
+ "pattern": "^W[0-9]+$",
207
+ "description": "Weight tier ID reference"
208
+ }
209
+ },
210
+ "additionalProperties": false
211
+ }
212
+ }
213
+ },
214
+ "additionalProperties": false
215
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/features.schema.json",
4
+ "title": "Features Schema",
5
+ "description": "Schema for service features definitions",
6
+ "type": "object",
7
+ "required": [
8
+ "file_type",
9
+ "features"
10
+ ],
11
+ "properties": {
12
+ "$schema": {
13
+ "type": "string",
14
+ "format": "uri",
15
+ "description": "JSON Schema URI reference"
16
+ },
17
+ "file_type": {
18
+ "type": "string",
19
+ "const": "features",
20
+ "description": "File type identifier"
21
+ },
22
+ "features": {
23
+ "type": "array",
24
+ "minItems": 1,
25
+ "items": {
26
+ "type": "object",
27
+ "required": [
28
+ "id",
29
+ "name",
30
+ "label",
31
+ "description"
32
+ ],
33
+ "properties": {
34
+ "id": {
35
+ "type": "string",
36
+ "pattern": "^[a-z_]+$",
37
+ "description": "Feature ID"
38
+ },
39
+ "name": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "description": "German feature name"
43
+ },
44
+ "label": {
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "description": "English feature label"
48
+ },
49
+ "description": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "description": "Feature description"
53
+ }
54
+ },
55
+ "additionalProperties": false
56
+ }
57
+ }
58
+ },
59
+ "additionalProperties": false
60
+ }
@@ -0,0 +1,180 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/prices.schema.json",
4
+ "title": "Prices Schema",
5
+ "description": "Schema for pricing information",
6
+ "type": "object",
7
+ "required": [
8
+ "file_type",
9
+ "unit",
10
+ "prices"
11
+ ],
12
+ "properties": {
13
+ "$schema": {
14
+ "type": "string",
15
+ "format": "uri",
16
+ "description": "JSON Schema URI reference"
17
+ },
18
+ "file_type": {
19
+ "type": "string",
20
+ "const": "prices",
21
+ "description": "File type identifier"
22
+ },
23
+ "unit": {
24
+ "type": "object",
25
+ "required": [
26
+ "price",
27
+ "currency"
28
+ ],
29
+ "properties": {
30
+ "price": {
31
+ "type": "string",
32
+ "const": "cents"
33
+ },
34
+ "currency": {
35
+ "type": "string",
36
+ "const": "EUR"
37
+ }
38
+ },
39
+ "additionalProperties": false
40
+ },
41
+ "prices": {
42
+ "type": "object",
43
+ "required": [
44
+ "product_prices",
45
+ "service_prices"
46
+ ],
47
+ "properties": {
48
+ "product_prices": {
49
+ "type": "array",
50
+ "minItems": 1,
51
+ "items": {
52
+ "type": "object",
53
+ "required": [
54
+ "product_id",
55
+ "zone",
56
+ "weight_tier",
57
+ "price"
58
+ ],
59
+ "properties": {
60
+ "product_id": {
61
+ "type": "string",
62
+ "pattern": "^[a-z_]+$",
63
+ "description": "Product ID reference"
64
+ },
65
+ "zone": {
66
+ "type": "string",
67
+ "enum": [
68
+ "domestic",
69
+ "zone_1_eu",
70
+ "zone_2_europe",
71
+ "world"
72
+ ],
73
+ "description": "Zone ID reference"
74
+ },
75
+ "weight_tier": {
76
+ "type": "string",
77
+ "pattern": "^W[0-9]+$",
78
+ "description": "Weight tier ID reference"
79
+ },
80
+ "price": {
81
+ "type": "array",
82
+ "minItems": 1,
83
+ "description": "Array of price entries with effective dates",
84
+ "items": {
85
+ "type": "object",
86
+ "required": [
87
+ "price",
88
+ "effective_from"
89
+ ],
90
+ "properties": {
91
+ "price": {
92
+ "type": "integer",
93
+ "minimum": 0,
94
+ "description": "Price in cents"
95
+ },
96
+ "effective_from": {
97
+ "type": [
98
+ "string",
99
+ "null"
100
+ ],
101
+ "format": "date",
102
+ "description": "Price effective start date"
103
+ },
104
+ "effective_to": {
105
+ "type": [
106
+ "string",
107
+ "null"
108
+ ],
109
+ "format": "date",
110
+ "description": "Price effective end date"
111
+ }
112
+ },
113
+ "additionalProperties": false
114
+ }
115
+ }
116
+ },
117
+ "additionalProperties": false
118
+ }
119
+ },
120
+ "service_prices": {
121
+ "type": "array",
122
+ "minItems": 1,
123
+ "items": {
124
+ "type": "object",
125
+ "required": [
126
+ "service_id",
127
+ "price"
128
+ ],
129
+ "properties": {
130
+ "service_id": {
131
+ "type": "string",
132
+ "pattern": "^[a-z0-9_]+$",
133
+ "description": "Service ID reference"
134
+ },
135
+ "price": {
136
+ "type": "array",
137
+ "minItems": 1,
138
+ "description": "Array of price entries with effective dates",
139
+ "items": {
140
+ "type": "object",
141
+ "required": [
142
+ "price",
143
+ "effective_from"
144
+ ],
145
+ "properties": {
146
+ "price": {
147
+ "type": "integer",
148
+ "minimum": 0,
149
+ "description": "Price in cents"
150
+ },
151
+ "effective_from": {
152
+ "type": [
153
+ "string",
154
+ "null"
155
+ ],
156
+ "format": "date",
157
+ "description": "Price effective start date"
158
+ },
159
+ "effective_to": {
160
+ "type": [
161
+ "string",
162
+ "null"
163
+ ],
164
+ "format": "date",
165
+ "description": "Price effective end date"
166
+ }
167
+ },
168
+ "additionalProperties": false
169
+ }
170
+ }
171
+ },
172
+ "additionalProperties": false
173
+ }
174
+ }
175
+ },
176
+ "additionalProperties": false
177
+ }
178
+ },
179
+ "additionalProperties": false
180
+ }