Closed jorandall closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
new-forest-energy | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 3, 2023 8:16am |
Question about the energy calculation: The booking with friendlyId=123 has: Start: 25/11/2023 End: 27/11/2023
So shouldn't the energy usage be 2kWh instead of 40kWh? The code is currently grabbing the readings before and after the booking:
Is the idea that there will be a reading right before and right after the booking window (taken by a delegate)? Maybe some check should be in place such that only a reading within a 24hr period of the booking can be used for this purpose, and if not, then the first and last readings within the booking window should be used if available?
Am I misunderstanding what this page is showing? Because if this booking page is for the Guest, they are being charged for energy that was used outside their booking window.
Also, minor change, but the Latest Readings list should be in date order.
Some things such as the Comparison Card being hardcoded are fine as there are issues (#104) to resolve these already created.
Updated database query to get readings in ascending order, which is then sorted into descending when passed to the reading container.
Please note: cost of readings / total usage gets the last reading before the booking date, and the first reading after the booking date (or the last reading within the booking if not yet completed). This has been done so that the app is not reliant on guest readings. There is an expectation that readings will be within an acceptable timeframe either side of the booking.
Corrected calculations for working out total usage, total cost, and total cost minus buffer. Also added a function to display costs correctly (as either £ or p)
Closes #116