Skip to content

Commit 0c8c7b4

Browse files
Merge pull request #45 from RI-SE/feature/update-specification
Feature/update specification
2 parents 1c881c7 + f950bba commit 0c8c7b4

10 files changed

Lines changed: 179 additions & 46 deletions

DEVELOPER_GUIDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Developer Guide
2+
3+
## Objects and how to use them
4+
5+
### Tariff
6+
The main object that describes a single tariff with all its components.
7+
8+
### RecurringPeriod
9+
The `RecurringPeriods` can be added if a price component (`FixedPriceComponent`, `EnergyPriceComponent`, `PowerPriceComponent`)
10+
is not active during all of the specified `ValidPeriod`. If no `RecurringPeriods` are added or the property is missing in the
11+
response, the price component is active during all times within the `ValidPeriod`.

specification/common.schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"Name": {
1212
"type": "string",
1313
"description": "A short human readable name.",
14-
"example": "Fusesize 25A",
14+
"example": "Descriptive name",
1515
"additionalProperties": false
1616
},
1717
"Description": {
@@ -45,6 +45,10 @@
4545
}
4646
}
4747
},
48+
"required": [
49+
"tariffId",
50+
"meteringPointIds"
51+
],
4852
"additionalProperties": false
4953
},
5054
"Unit": {

specification/energy.schema.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,29 @@
2626
"example": "high",
2727
"default": "main"
2828
},
29+
"validPeriod": {
30+
"$ref": "time.schema.json#/definitions/DateInterval"
31+
},
2932
"price": {
3033
"$ref": "price.schema.json#/definitions/Price"
3134
},
3235
"spotPriceSettings": {
3336
"$ref": "energy.schema.json#/definitions/SpotPriceSettings"
3437
},
35-
"validPeriod": {
36-
"$ref": "time.schema.json#/definitions/DateInterval"
37-
},
3838
"recurringPeriods": {
3939
"type": "array",
4040
"items": {
4141
"$ref": "time.schema.json#/definitions/RecurringPeriod"
4242
}
4343
}
4444
},
45+
"required": [
46+
"id",
47+
"name",
48+
"type",
49+
"reference",
50+
"validPeriod"
51+
],
4552
"additionalProperties": false
4653
},
4754
"SpotPriceSettings": {
@@ -57,6 +64,10 @@
5764
"$ref": "price.schema.json#/definitions/Currency"
5865
}
5966
},
67+
"required": [
68+
"multiplier",
69+
"currency"
70+
],
6071
"additionalProperties": false
6172
}
6273
}

specification/fixed.schema.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@
3737
"$ref": "time.schema.json#/definitions/Duration"
3838
}
3939
},
40+
"required": [
41+
"id",
42+
"name",
43+
"type",
44+
"reference",
45+
"validPeriod",
46+
"price",
47+
"pricedPeriod"
48+
],
4049
"additionalProperties": false
4150
}
4251
}

specification/gridtariffapi.json

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@
280280
"description": "Version of the implementation. The format is set by the operator and can differ. In this example -r4 is the revision number of the implementation and the first three numbers the API version.",
281281
"example": "1.2.3-r4"
282282
},
283+
"lastUpdated": {
284+
"$ref": "time.schema.json#/definitions/DateTime"
285+
},
283286
"operator": {
284287
"type": "string",
285288
"description": "Name of the company or organization operating this server.",
@@ -292,11 +295,15 @@
292295
"type": "string",
293296
"description": "URL to the identity provider server which provides access tokens.",
294297
"example": "https://idp.gridcompany.se/oath2/token"
295-
},
296-
"lastUpdated": {
297-
"$ref": "time.schema.json#/definitions/DateTime"
298298
}
299299
},
300+
"required": [
301+
"name",
302+
"apiVersion",
303+
"lastUpdated",
304+
"operator",
305+
"timeZone"
306+
],
300307
"additionalProperties": true
301308
},
302309
"TariffsResponse": {
@@ -315,6 +322,9 @@
315322
}
316323
}
317324
},
325+
"required": [
326+
"tariffs"
327+
],
318328
"additionalProperties": false
319329
},
320330
"TariffResponse": {
@@ -324,6 +334,9 @@
324334
"$ref": "tariff.schema.json#/definitions/Tariff"
325335
}
326336
},
337+
"required": [
338+
"tariff"
339+
],
327340
"additionalProperties": false
328341
},
329342
"TariffsSearchRequest": {
@@ -337,6 +350,9 @@
337350
}
338351
}
339352
},
353+
"required": [
354+
"meteringPointIds"
355+
],
340356
"additionalProperties": false
341357
},
342358
"TariffsSearchResponse": {
@@ -355,6 +371,10 @@
355371
}
356372
}
357373
},
374+
"required": [
375+
"tariffs",
376+
"mappings"
377+
],
358378
"additionalProperties": false
359379
},
360380
"PricesResponse": {
@@ -364,6 +384,9 @@
364384
"$ref": "price.schema.json#/definitions/PriceList"
365385
}
366386
},
387+
"required": [
388+
"priceList"
389+
],
367390
"additionalProperties": false
368391
},
369392
"ProblemDetails": {
@@ -380,23 +403,14 @@
380403
},
381404
"detail": {
382405
"type": "string",
383-
"description": "A detailed message explaining the error."
384-
},
385-
"instance": {
386-
"type": "string",
387-
"description": "URI reference identifying the specific occurrence of the problem."
388-
},
389-
"type": {
390-
"type": "string",
391-
"description": "A URI reference that identifies the problem type."
406+
"description": "A detailed message explaining the error. May include an URL to a help page."
392407
}
393408
},
394409
"required": [
395410
"status",
396-
"title",
397-
"detail"
411+
"title"
398412
],
399-
"additionalProperties": false
413+
"additionalProperties": true
400414
}
401415
},
402416
"responses": {

specification/power.schema.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
"example": "high",
2727
"default": "main"
2828
},
29+
"validPeriod": {
30+
"$ref": "time.schema.json#/definitions/DateInterval"
31+
},
2932
"price": {
3033
"$ref": "price.schema.json#/definitions/Price"
3134
},
3235
"url": {
3336
"$ref": "common.schema.json#/definitions/Url"
3437
},
35-
"validPeriod": {
36-
"$ref": "time.schema.json#/definitions/DateInterval"
37-
},
3838
"peakIdentificationSettings": {
3939
"$ref": "power.schema.json#/definitions/PeakIdentificationSettings"
4040
},
@@ -45,6 +45,13 @@
4545
}
4646
}
4747
},
48+
"required": [
49+
"id",
50+
"name",
51+
"type",
52+
"reference",
53+
"validPeriod"
54+
],
4855
"additionalProperties": false
4956
},
5057
"PeakIdentificationSettings": {
@@ -66,6 +73,12 @@
6673
"example": 3
6774
}
6875
},
76+
"required": [
77+
"peakFunction",
78+
"peakIdentificationPeriod",
79+
"peakDuration",
80+
"numberOfPeaksForAverageCalculation"
81+
],
6982
"additionalProperties": false
7083
},
7184
"PeakFunction": {

specification/price.schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
"$ref": "price.schema.json#/definitions/Currency"
2323
}
2424
},
25+
"required": [
26+
"timestamp",
27+
"priceExVat",
28+
"priceIncVat",
29+
"currency"
30+
],
2531
"additionalProperties": false
2632
},
2733
"Price": {
@@ -42,6 +48,11 @@
4248
"$ref": "price.schema.json#/definitions/Currency"
4349
}
4450
},
51+
"required": [
52+
"priceExVat",
53+
"priceIncVat",
54+
"currency"
55+
],
4556
"additionalProperties": false
4657
},
4758
"PriceList": {
@@ -61,6 +72,11 @@
6172
}
6273
}
6374
},
75+
"required": [
76+
"componentId",
77+
"resolution",
78+
"prices"
79+
],
6480
"additionalProperties": false
6581
},
6682
"CostFunction": {

specification/tariff.schema.json

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
"description": "Detailed description of the grid tariff.",
1717
"type": "string"
1818
},
19-
"product": {
20-
"description": "A persistent and unique (on company level) reference to identify a given product during its entire lifecycle. If set, the reference allows for a seamless transition when a products tariff definition gets updated.",
21-
"type": "string",
22-
"example": "net.consume.std.25"
19+
"validPeriod": {
20+
"$ref": "time.schema.json#/definitions/DateInterval"
21+
},
22+
"timeZone": {
23+
"$ref": "time.schema.json#/definitions/TimeZone"
24+
},
25+
"lastUpdated": {
26+
"$ref": "time.schema.json#/definitions/DateTime"
2327
},
2428
"companyName": {
2529
"description": "Name of the grid company.",
@@ -29,21 +33,17 @@
2933
"description": "Organization number and unique identifier of the grid company.",
3034
"type": "string"
3135
},
36+
"product": {
37+
"description": "A persistent and unique (on company level) reference to identify a given product during its entire lifecycle. If set, the reference allows for a seamless transition when a products tariff definition gets updated.",
38+
"type": "string",
39+
"example": "net.consume.std.25"
40+
},
3241
"direction": {
3342
"description": "Indicates if this is a tariff for consumption or production. Valid values are \"consumption\" and \"production\".",
3443
"type": "string",
3544
"pattern": "consumption|production",
3645
"default": "consumption"
3746
},
38-
"timeZone": {
39-
"$ref": "time.schema.json#/definitions/TimeZone"
40-
},
41-
"lastUpdated": {
42-
"$ref": "time.schema.json#/definitions/DateTime"
43-
},
44-
"validPeriod": {
45-
"$ref": "time.schema.json#/definitions/DateInterval"
46-
},
4747
"billingPeriod": {
4848
"$ref": "time.schema.json#/definitions/Duration"
4949
},
@@ -57,6 +57,21 @@
5757
"$ref": "tariff.schema.json#/definitions/PowerPrice"
5858
}
5959
},
60+
"required": [
61+
"id",
62+
"name",
63+
"validPeriod",
64+
"timeZone",
65+
"lastUpdated",
66+
"companyName",
67+
"companyOrgNo",
68+
"product",
69+
"direction",
70+
"billingPeriod",
71+
"fixedPrice",
72+
"energyPrice",
73+
"powerPrice"
74+
],
6075
"additionalProperties": false
6176
},
6277
"FixedPrice": {
@@ -82,6 +97,12 @@
8297
}
8398
}
8499
},
100+
"required": [
101+
"id",
102+
"name",
103+
"costFunction",
104+
"components"
105+
],
85106
"additionalProperties": false
86107
},
87108
"EnergyPrice": {
@@ -110,6 +131,13 @@
110131
}
111132
}
112133
},
134+
"required": [
135+
"id",
136+
"name",
137+
"costFunction",
138+
"unit",
139+
"components"
140+
],
113141
"additionalProperties": false
114142
},
115143
"PowerPrice": {
@@ -138,6 +166,13 @@
138166
}
139167
}
140168
},
169+
"required": [
170+
"id",
171+
"name",
172+
"costFunction",
173+
"unit",
174+
"components"
175+
],
141176
"additionalProperties": false
142177
}
143178
}

0 commit comments

Comments
 (0)