diff --git a/docs/ecolyo/konnectors/egl.md b/docs/ecolyo/konnectors/egl.md index 449222c70dbab7b1fcc1adbaca66ea81246357a1..7288841b1feb4321fc0ae2b7e39b87130b2a473e 100644 --- a/docs/ecolyo/konnectors/egl.md +++ b/docs/ecolyo/konnectors/egl.md @@ -125,6 +125,19 @@ You'll have to subtract a day value with the previous's to get a consumption for If you're looking for more information about the API, checkout the [complete API documentation](/documents/egl-api-doc.pdf) -### Usage - -TODO : add explanation of how we manage data in the konnector +### Konnector Methods + +| Method | Description | +| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| start | Init Function | +| getData | Retrieve data from API | +| processData | Parse data. Remove existing data from DB using hydrateAndFilter, store filtered data and return the list of filtered data | +| authenticate | Authentication method. Requires login, password, baseUrl and ApiAuthKey. | +| 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 | diff --git a/docs/ecolyo/konnectors/grdf.md b/docs/ecolyo/konnectors/grdf.md index 97065e7180e522d9c2672380d012c898ac10737c..8966c0133ae3f594e622003302732ed965dd2293 100644 --- a/docs/ecolyo/konnectors/grdf.md +++ b/docs/ecolyo/konnectors/grdf.md @@ -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). + +### Konnector Methods + +| Method | Description | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| start | Init Function | +| getData | Retrieve data from API | +| 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 |