Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
feature/COR-1278-schema-self_test_overall (#4535)
Browse files Browse the repository at this point in the history
* feat: added schema for selftest_overall

* fix: changed the naming

* feat(infection-radar-data): Update the schema based on requirement for date ranges.

* feat(self-test-schema): Adjust the schema property based on discussion on COR-1262 ticket.

Co-authored-by: VWSCoronaDashboard21 <[email protected]>
Co-authored-by: VWSCoronaDashboard28 <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2022
1 parent 6ed94de commit bcff667
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/app/schema/nl/__index.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"nursing_home",
"proto_name",
"reproduction",
"self_test_overall",
"sewer",
"tested_ggd",
"tested_ggd_archived",
Expand Down Expand Up @@ -241,6 +242,9 @@
},
"variants": {
"$ref": "variants.json"
},
"self_test_overall": {
"$ref": "self_test_overall.json"
}
},
"$defs": {
Expand Down
40 changes: 40 additions & 0 deletions packages/app/schema/nl/self_test_overall.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "nl_self_test_overall",
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"$ref": "#/definitions/value"
}
},
"last_value": {
"$ref": "#/definitions/value"
}
},
"required": ["values", "last_value"],
"additionalProperties": false,
"definitions": {
"value": {
"title": "nl_self_test_overall_value",
"type": "object",
"properties": {
"infected_percentage": {
"type": ["number", "null"]
},
"date_range_start_unix": {
"type": "integer"
},
"date_range_end_unix": {
"type": "integer"
},
"date_of_insertion_unix": {
"type": "integer"
}
},
"required": ["infected_percentage", "date_range_start_unix", "date_range_end_unix", "date_of_insertion_unix"],
"additionalProperties": false
}
}
}
12 changes: 12 additions & 0 deletions packages/common/src/types/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export interface Nl {
vaccine_coverage_per_age_group_estimated_archived_20220908: NlVaccineCoveragePerAgeGroupEstimatedArchived_20220908Value;
vaccine_stock: NlVaccineStock;
variants?: NlVariants;
self_test_overall: NlSelfTestOverall;
}
export interface NlDifference {
tested_overall__infected_per_100k_moving_average: DifferenceDecimal;
Expand Down Expand Up @@ -1134,12 +1135,23 @@ export interface NlVariantsVariantValue {
date_of_insertion_unix: number;
date_of_report_unix: number;
}
export interface NlSelfTestOverall {
values: NlSelfTestOverallValue[];
last_value: NlSelfTestOverallValue;
}
export interface NlSelfTestOverallValue {
infected_percentage: number | null;
date_range_start_unix: number;
date_range_end_unix: number;
date_of_insertion_unix: number;
}

export type TopicalIcon =
| 'AfstandSporten'
| 'AlcoholVerkoop'
| 'Archive'
| 'Arrow'
| 'ArrowWithIntensity'
| 'Arts'
| 'Avondklok'
| 'BarChart'
Expand Down

0 comments on commit bcff667

Please sign in to comment.