Skip to content
Snippets Groups Projects
Commit 0e40abfb authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

chore(type): add response types

parent ee88bec0
Branches
Tags
2 merge requests!322.0 Release,!29chore(type): add response types
...@@ -39,9 +39,11 @@ ...@@ -39,9 +39,11 @@
"energie", "energie",
"etat", "etat",
"firstname", "firstname",
"gaziere",
"grandlyon", "grandlyon",
"grdf", "grdf",
"grdfgrandlyon", "grdfgrandlyon",
"journee",
"konnector", "konnector",
"konnectors", "konnectors",
"lastname", "lastname",
...@@ -49,7 +51,8 @@ ...@@ -49,7 +51,8 @@
"numero", "numero",
"perim", "perim",
"periode", "periode",
"publiees" "publiees",
"releve"
], ],
"prettier.semi": true "prettier.semi": true
} }
...@@ -188,7 +188,8 @@ async function getData(token, idPCE, startDate, endDate) { ...@@ -188,7 +188,8 @@ async function getData(token, idPCE, startDate, endDate) {
}) })
.then(result => { .then(result => {
return result.match(/.+/g).map(s => { return result.match(/.+/g).map(s => {
result = JSON.parse(s) /** @type {import('./types').GRDFDataRange} */
const result = JSON.parse(s)
if (result.statut_restitution !== null) { if (result.statut_restitution !== null) {
/** /**
* Handle no data issue when retrieving grdf data. * Handle no data issue when retrieving grdf data.
......
...@@ -65,3 +65,50 @@ export type Account = { ...@@ -65,3 +65,50 @@ export type Account = {
export type AccountData = { export type AccountData = {
consentId: string | undefined consentId: string | undefined
} }
/** Data response for donnees_consos_informatives?date_debut=2023-05-03&date_fin=2024-05-03 */
export type GRDFDataRange = {
pce: { id_pce: string }
periode: {
valeur: null
date_debut: Date
date_fin: Date
}
releve_debut: {
date_releve: Date
index_brut_debut: Index
index_converti_debut: Index
}
releve_fin: {
date_releve: Date
index_brut_fin: Index
index_converti_fin: Index
}
consommation: {
date_debut_consommation: Date
date_fin_consommation: Date
flag_retour_zero: boolean
volume_brut: number
coeff_calcul: {
coeff_pta: null
valeur_pcs: null
coeff_conversion: number
}
volume_converti: number
energie: number
type_qualif_conso: string
sens_flux_gaz: string
statut_conso: string
journee_gaziere: Date
type_conso: string
}
statut_restitution: null | {
code: string
message: string
}
}
type Index = {
valeur_index: number
horodate_Index: Date
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment