-
Notifications
You must be signed in to change notification settings - Fork 0
/
common-priceInfo.json
107 lines (107 loc) · 2.73 KB
/
common-priceInfo.json
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
{
"type": "array",
"title": "priceInfo",
"description": "A list of prices for tickets/reservations.",
"minItems": 1,
"contains": {
"properties": {
"category": {
"const": "base"
}
}
},
"minContains": 1,
"maxContains": 1,
"items": {
"allOf": [
{
"type": "object",
"properties": {
"category": {
"type": "string",
"enum": [
"base",
"tariff",
"uitpas"
],
"example": "base",
"description": "Indicates whether this is the base price or a custom tariff.\n`base` for the base price, and `tariff` for custom/extra tariffs. Tariffs with category `uitpas` are automatically added by UiTdatabank and read-only. They will be updated whenever other tariffs change."
},
"price": {
"type": "number",
"format": "float",
"minimum": 0,
"example": 10.5,
"description": "The price of a ticket in this category."
},
"priceCurrency": {
"type": "string",
"enum": [
"EUR"
],
"default": "EUR",
"description": "The currency of the price. Currently only `EUR` is supported."
},
"name": {
"$ref": "./common-name.json",
"description": "Name of a tariff inside priceInfo. Required if category is set to `tariff`. For the `base` category UiTdatabank will set a default. Requires at least one value, for the language specified in the `mainLanguage` property. Names must be unique (per language) when using multiple tarrifs."
}
},
"required": [
"category",
"price"
]
},
{
"if": {
"required": ["category"],
"properties": {
"category": {
"const": "tariff"
}
}
},
"then": {
"required": ["name"]
}
}
]
},
"examples": [
[
{
"category": "base",
"price": 10.5,
"priceCurrency": "EUR",
"name": {
"nl": "Basistarief",
"fr": "Tarif de base",
"en": "Base tariff",
"de": "Basisrate"
}
}
],
[
{
"category": "base",
"price": 10.5,
"priceCurrency": "EUR",
"name": {
"nl": "Basistarief",
"fr": "Tarif de base",
"en": "Base tariff",
"de": "Basisrate"
}
},
{
"category": "tariff",
"price": 8,
"priceCurrency": "EUR",
"name": {
"nl": "Jongeren (<18j)",
"en": "Youth (<18yo)"
}
}
]
]
}