diff --git a/docs/ecolyo-agent/technical/getting_started.md b/docs/ecolyo-agent/technical/getting_started.md index 929f5396cfa52c09add66449bfa9b5377db27899..18e468e090eaa10a92e751af63c96ab10781de44 100644 --- a/docs/ecolyo-agent/technical/getting_started.md +++ b/docs/ecolyo-agent/technical/getting_started.md @@ -53,6 +53,15 @@ This command will launch the app from the `docker-compose.local.yml`` file, whic The nginx server needs local ssl certificates in order to run an interact with backend, these certificates are present in the project. +### Fluid prices initialisation + +To initialize the database with fluid prices, run the following commands : + +```shell +cd scripts +./init-fluidprices.sh +``` + To stop it properly use ```bash diff --git a/docs/ecolyo/functionalities/prices_calculation.md b/docs/ecolyo/functionalities/prices_calculation.md index f414bf330c70b205f8602bd3aadd8a2543957f17..35999c4e043a83df71f6382534eae83d7b229610 100644 --- a/docs/ecolyo/functionalities/prices_calculation.md +++ b/docs/ecolyo/functionalities/prices_calculation.md @@ -9,7 +9,7 @@ Since version `1.6.0` of the app, we have a database storing fluid prices evolut * Electricity * Gas -Before this version, the app was applying a hard coded price for each fluid without taking care of the time period. Now, there is a service running every night that process fresh data in order to apply the current price to this data, but also apply the most relevant price for a fluid doctype. +Before this version, the app was applying a hard coded price for each fluid without taking care of the time period. Now, there is a service that processes fresh data in order to apply the current price to this data, but also apply the most relevant price for a fluid doctype. ## Service @@ -81,10 +81,10 @@ stop @enduml ``` -This service is running every night at 02:00 AM. +This service is running every night at 02:00 AM and during splash screen. !!! warning "note" - You might observe some price miscalculation if data from konnector is collect after the service runtime. Because of the hard code price, which is the current price, the user should not see any difference. + You might observe some price miscalculation because the service is triggered asynchronously during splash root, but because of the default price in `constants/config.json`, the user should not see a big difference. ### Init @@ -104,8 +104,8 @@ In case of price update the following procedure must be done : ### Prices Data - We store in database a collection of prices with the following info : + * StartDate * EndDate * fluidType @@ -115,11 +115,11 @@ The EndDate is set to null if it's the current fluid price. ## App Price display -The app can handle the new price calculation and also keep the old calculation system. +The app can handle the new price calculation and also keep the old calculation system. ### Regular display -If there is a price on the doctype we want to process, it will be use for display and calculation ( see analysis functionality). +If there is a price on the doctype we want to process, it will be use for display and calculation ( see analysis functionality). ### Fallback @@ -135,7 +135,7 @@ yarn build-dev:browser; yarn run cozy-konnector-dev -m .\manifest.webapp .\build ### Future Changes -We might consider a more dynamic process for fallback price calculation in the future: +We might consider a more dynamic process for fallback price calculation in the future: * Get last price for a given price in database * Use it to calculate value instead of the hard coded one