diff --git a/backend/app/routers/logistics.py b/backend/app/routers/logistics.py index f9705b9..efc2779 100644 --- a/backend/app/routers/logistics.py +++ b/backend/app/routers/logistics.py @@ -98,6 +98,12 @@ async def refill_dewar(qr_code: str, db: Session = Depends(get_db)): # Process refill dewar.last_refill = datetime.now() + + # Calculate and update time until next refill + time_until_refill_seconds = calculate_time_until_refill(dewar.last_refill) + db.query(SlotModel).filter(SlotModel.dewar_unique_id == dewar.unique_id).update( + {'time_until_refill': time_until_refill_seconds}) + new_event = LogisticsEventModel( dewar_id=dewar.id, slot_id=None, # No specific slot, as it's a refill event event_type="refill",