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

Merge branch 'init-fluidprices' into 'master'

Init fluidprices

See merge request !51
parents cc74967e 896abd46
No related branches found
No related tags found
1 merge request!51Init fluidprices
Pipeline #73721 passed
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment