Add optional battery metadata fields

New nullable columns on Battery: size, chemistry, capacity_mah,
tested_capacity_mah, tested_date, charge_cycles, purchase_date.

Battery detail page shows all populated fields and a full edit form
with select dropdowns for size and chemistry (with Other fallback).
Capacity health % shown in green/orange/red when both nominal and
tested capacity are set. Dashboard gains a Size column.
This commit is contained in:
2026-04-12 14:57:22 -05:00
parent 47e1059532
commit 604d7bb699
5 changed files with 163 additions and 12 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ def test_battery_detail_not_found(client):
# ------------------------------------------------------------------ #
def test_edit_notes(seeded_client):
seeded_client.post("/battery/1/edit-notes", data={"notes": "test note here"})
seeded_client.post("/battery/1/edit-details", data={"notes": "test note here"})
resp = seeded_client.get("/battery/1")
assert b"test note here" in resp.data