From fe0773e111ca9139aebb4d5bccdc729e17a328b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Pailharey?= <rpailharey@grandlyon.com> Date: Thu, 16 May 2024 10:51:18 +0200 Subject: [PATCH] doc: update or create for EGL --- .markdownlint.json | 5 +++-- docs/konnectors/egl.md | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.markdownlint.json b/.markdownlint.json index 09d2bcd..5b47db5 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -51,5 +51,6 @@ "style": "dash" }, "no-bare-urls": false, - "line_length": false -} + "line_length": false, + "MD054": false +} \ No newline at end of file diff --git a/docs/konnectors/egl.md b/docs/konnectors/egl.md index 1fda058..2c53b29 100644 --- a/docs/konnectors/egl.md +++ b/docs/konnectors/egl.md @@ -11,6 +11,12 @@ You should also check Cozy's official documentations for konnectors : - API Url for Development : [https://agence-rec.eaudugrandlyon.com](https://agence-rec.eaudugrandlyon.com/) - API Url for Production : [https://agence.eaudugrandlyon.com/ws](https://agence.eaudugrandlyon.com/ws) +## Update or create data + +This konnector updates data if it has changed since the last execution or creates a new entry if the data is new. It also updates month and year aggregates except for start month and start year to prevent overriding data if user has more than 3 years of data. + +For this we use a combinaison of the hydrateAndFilter function and the updateOrCreate function. + ## Authentication In order to authenticate to the EGL API we have to request the following route @@ -56,7 +62,7 @@ Once you've sent this request the API should answer with a code 100 if everythin ## Fetch Data -:::warning +:::warning The earliest data that can be fetched is November 2022 (not 3 years) due to migration from EGL to EPGL ::: @@ -118,12 +124,9 @@ If you're looking for more information about the API, checkout the [complete API ### 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 (former "T" typeagregats remain in response even if the data was added later, leading to duplicated data) | -| resetInProgressAggregatedData | Function handling special case.The temporary aggregated data need to be remove in order for the most recent one to 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 | +| Method | Description | +| ----------------------------- | ------------- | +| start | Init Function | +| getData | Retrieve data from API | +| authenticate | Authentication method. Requires login, password, baseUrl and ApiAuthKey. | +| format | Format data for DB storage and remove bad data (former "T" typeagregats remain in response even if the data was added later, leading to duplicated data)| -- GitLab