Feat/us770 purge dacc indicatorq
What does this MR do and why?
Recalculates indicators 'consumption-variation-monthly' and 'connection-count-monthly' from january at a specific date. ---> The execution date is hard coded in the service
Screenshots or screen recordings
Example result for variation indicator :
Example indicator for connection count :
How to set up and validate locally
You'll have to replace your local data with these 2 data files (first empty the doctype in your db, then import these files) :
- usageEvent file : eventsProd.json
- profile file : profileT.json
Follow : doc to use dacc locally : https://doc.self-data.alpha.grandlyon.com/ecolyo/functionalities/dacc/
Local
You won't be able to test it on alpha since the indicators are aggregated monthly in the DACC, but you can see the results of my tests on DACC dev. Once you've set up your local env :
- Run scripts/server.js
- Build your application with yarn build-dev
- Run the aggregatorUsageEvent service : yarn run cozy-konnector-dev -m manifest.webapp build/services/aggregatorUsageEvents/ecolyo.js
- You should see the 2 indicators types aggregated for the last 5 months.
Make sure of the following statements :
- The indicator startDate is correctly set
- The seniority value is correct
- You should have indicators calculated from january until today
MR acceptance checklist
Quality
- [] Confirmed
- For the code that this change impacts, I believe that the automated tests validate functionality that is highly important to users. If the existing automated tests do not cover this functionality, I have added the necessary additional tests or I have added an issue to describe the automation testing gap and linked it to this MR.
- I have made sure that the sonar quality coverage is up to standards.
- I have considered the impact of this change on the front-end, back-end, and database portions of the system where appropriate and applied.
- I have tested this MR in all supported browsers or determined that this testing is not needed.
- I have confirmed that this change is backwards compatible across updates (migrate up needs a migrate down), or I have decided that this does not apply.
Performance, reliability and availability
- [] Confirmed
- I am confident that this MR does not harm performance, or I have asked a reviewer to help assess the performance impact.
- I have considered the scalability risk based on future predicted growth.
Documentation
- [] Confirmed
- I have prepared a squash commit to feed the changelog linked to the current milestone.
- I have added/updated documentation (also updated if the changes feature a deprecation) or I have decided that documentation changes are not needed for this MR.
Security
- [] Confirmed
- I have confirmed that if this MR does not contains any sensitive informations hidden in the changes.
Deployment
- [] Confirmed
- When featured on a self-data project release, i have made sure my app version in the manifest and package.json is incremented and any relative changes to the permissions are clearly written and transmitted to Cozy.
Edited by Guilhem CARRON