diff --git a/backend/routers/fleet_calendar.py b/backend/routers/fleet_calendar.py index 2127bf7..7603a03 100644 --- a/backend/routers/fleet_calendar.py +++ b/backend/routers/fleet_calendar.py @@ -224,8 +224,9 @@ async def get_reservation( unit_ids = [a.unit_id for a in assignments] units = db.query(RosterUnit).filter(RosterUnit.id.in_(unit_ids)).all() if unit_ids else [] units_by_id = {u.id: u for u in units} - # Build power_type lookup from assignments + # Build power_type and notes lookup from assignments power_type_map = {a.unit_id: a.power_type for a in assignments} + notes_map = {a.unit_id: a.notes for a in assignments} return { "id": reservation.id, @@ -245,7 +246,8 @@ async def get_reservation( "id": uid, "last_calibrated": units_by_id[uid].last_calibrated.isoformat() if uid in units_by_id and units_by_id[uid].last_calibrated else None, "deployed": units_by_id[uid].deployed if uid in units_by_id else False, - "power_type": power_type_map.get(uid) + "power_type": power_type_map.get(uid), + "notes": notes_map.get(uid) } for uid in unit_ids ] @@ -343,6 +345,7 @@ async def assign_units_to_reservation( unit_ids = data.get("unit_ids", []) # Optional per-unit power types: {"BE17354": "ac", "BE9441": "solar"} power_types = data.get("power_types", {}) + location_notes = data.get("location_notes", {}) # Verify units exist (allow empty list to clear all assignments) if unit_ids: @@ -384,7 +387,8 @@ async def assign_units_to_reservation( reservation_id=reservation_id, unit_id=unit_id, assignment_source="filled" if reservation.assignment_type == "quantity" else "specific", - power_type=power_types.get(unit_id) + power_type=power_types.get(unit_id), + notes=location_notes.get(unit_id) ) db.add(assignment) @@ -538,6 +542,7 @@ async def get_reservations_list( { "id": a.unit_id, "power_type": a.power_type, + "notes": a.notes, "deployed": units_by_id[a.unit_id].deployed if a.unit_id in units_by_id else False, "last_calibrated": units_by_id[a.unit_id].last_calibrated if a.unit_id in units_by_id else None, } diff --git a/templates/fleet_calendar.html b/templates/fleet_calendar.html index a5ae29c..a4e3beb 100644 --- a/templates/fleet_calendar.html +++ b/templates/fleet_calendar.html @@ -389,7 +389,7 @@
Loading reservations...
Monitoring Locations
{{ u.notes }}
{% endif %}