Add "Strom" page for the yearly NeoVac electricity bills #9
Loading…
Reference in a new issue
No description provided.
Delete branch "add-electricity-page"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
New Strom page (
/electricity) for the yearly NeoVac electricity bills of the apartment.What's in it
ElectricityBillmodel: period (Von/Bis), grid and PV kWh, grid and PV CHF, side costs. Computed:TotalKwh,PvShare,TotalChf,ChfPerKwh,GridChfPerKwh,PvChfPerKwh.{DataPath}/{mandator}/electricity.json, because the billing period runs 1 July to 30 June. NewISettingsService.GetMandatorPath()and aBaseRepository.SaveAsyncoverload that takes a directory.ElectricityBillRepository(list, get, save, delete) and support forelectricity.jsonin the JSON editor (RawDataRepositoryreads and writes it in the mandator folder).ElectricityHalfYear): each bill is spread evenly over the months of its period, so a yearly bill gives half to each of its two half-years. Half-years without a bill show as gaps.charts.js:stackedBarandlineaccept an optionalunitandaxisDecimals; without them they still show whole CHF, so the Analyse charts are unchanged.Also in this branch
Directory.Build.propstargets net10.0 instead of net9.0.appsettings.Development.json:DataPathpoints toD:\Developer\AccountingData(Windows), the Linux path is kept asDataPath_.Tests
New
ElectricityBillTestShould,ElectricityBillRepositoryTestShouldandElectricityHalfYearTestShould;RawDataRepositoryTestShouldandSettingsServiceTestShouldextended. All 133 tests pass.🤖 Generated with Claude Code
A new page (/electricity) to record one electricity bill per billing period (1 July-30 June) with a grid, add/edit dialog, and two Chart.js charts (kWh split grid/PV per period, CHF/kWh as a line). - ElectricityBill (Common): Grid/PV kWh and CHF, side costs, advance payment; computed TotalKwh, PvShare, TotalChf, Balance, ChfPerKwh. - Stored once per mandator at {DataPath}/{mandator}/electricity.json instead of per year, since the billing period doesn't align with calendar years (new ISettingsService.GetMandatorPath(), BaseRepository gets a directory-aware SaveAsync overload). - electricity.json is also editable through the JSON editor (RawDataRepository). - charts.js: stackedBar/line charts can now show a unit other than CHF (defaults to CHF, so the Analyse page is unaffected). - The add/edit dialog links to an annotated example (SVG, placeholder data) showing which value on the real NeoVac bill goes into which field; opens in its own dialog since the main dialog has a fixed height. - Tests for the computed properties and the new repositories. Also bumps the TargetFramework to net10.0 and updates the local DataPath in appsettings.Development.json. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>