Skip to content
Snippets Groups Projects
Commit 84d3e69d authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

feat: init price in splash root

parent fb066bc4
Branches
No related tags found
1 merge request!51Init fluidprices
Pipeline #73474 passed
...@@ -9,7 +9,7 @@ Since version `1.6.0` of the app, we have a database storing fluid prices evolut ...@@ -9,7 +9,7 @@ Since version `1.6.0` of the app, we have a database storing fluid prices evolut
* Electricity * Electricity
* Gas * 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 ## Service
...@@ -81,10 +81,10 @@ stop ...@@ -81,10 +81,10 @@ stop
@enduml @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" !!! 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 ### Init
...@@ -104,8 +104,8 @@ In case of price update the following procedure must be done : ...@@ -104,8 +104,8 @@ In case of price update the following procedure must be done :
### Prices Data ### Prices Data
We store in database a collection of prices with the following info : We store in database a collection of prices with the following info :
* StartDate * StartDate
* EndDate * EndDate
* fluidType * fluidType
...@@ -115,11 +115,11 @@ The EndDate is set to null if it's the current fluid price. ...@@ -115,11 +115,11 @@ The EndDate is set to null if it's the current fluid price.
## App Price display ## 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 ### 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 ### Fallback
...@@ -135,7 +135,7 @@ yarn build-dev:browser; yarn run cozy-konnector-dev -m .\manifest.webapp .\build ...@@ -135,7 +135,7 @@ yarn build-dev:browser; yarn run cozy-konnector-dev -m .\manifest.webapp .\build
### Future Changes ### 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 * Get last price for a given price in database
* Use it to calculate value instead of the hard coded one * Use it to calculate value instead of the hard coded one
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment