| storeData | Save data in the right doctype db and prevent duplicated keys |
| format | Format data for DB storage and remove bad data |
| processYearAgregation | |
| processMonthlyAgregation | |
| groupBy | |
| reduceYearFunction | |
| reduceMonthFunction | |
| resetInProgressAggregatedData | Function handling special case.The temporary aggregated data need to be remove in order for the most recent one te be saved. Ex for com.grandlyon.egl.year : `{ load: 76.712, year: 2020, ... }` need to be replace by `{ load: 82.212, year: 2020, ... }` after egl data reprocess |
@@ -22,7 +22,7 @@ On its first launch, following the Oauth Client Connect authentification.
- The account has now an access_token and an id_token from the oauth call
!!! info ""
id_token is only given when requesting the token endpoint in _authorization_code_ grant_type.
id*token is only given when requesting the token endpoint in \_authorization_code* grant_type.
This token holds several meta datas, including the pce_id (id of user's meter) that will be needed further to fetch user's datas.
- Konnector starts, fails to find a pce_id in database on first launch therefore decodes the id_token to store the pce_id in db (see [addData](https://docs.cozy.io/en/cozy-konnector-libs/api/#adddata_1)).
...
...
@@ -58,3 +58,16 @@ Build the konnector with `yarn build`.
Type `yarn deploy` to build on a dedicated branch.
Build branch is stored as a docker image in a registry : [Container Registry](https://forge.grandlyon.com/web-et-numerique/llle_project/grdf-adict-konnector/container_registry).
| processData | Parse data. Remove existing data from DB using hydrateAndFilter, store filtered data and return the list of filtered data |
| storeData | Save data in the right doctype db and prevent duplicated keys |
| formateData | Format data for DB storage and remove bad data |
| buildAgregatedData | Retrieve and remove old data for a specific doctype and return an array of agregated data |
| buildDataFromKey | Format an entry for DB storage using key and value. For year doctype: key = "YYYY". For month doctype: key = "YYYY-MM" |
| resetInProgressAggregatedData | Function handling special case.The temporary aggregated data need to be remove in order for the most recent one te be saved. Ex for com.grandlyon.grdf.year : `{ load: 76.712, year: 2020, ... }` need to be replace by `{ load: 82.212, year: 2020, ... }` after grdf data reprocess |