now associating a dewar to a slot with checks that it is not associated to another slot
This commit is contained in:
parent
98d6265ae1
commit
cacf43b631
@ -98,6 +98,12 @@ async def refill_dewar(qr_code: str, db: Session = Depends(get_db)):
|
|||||||
|
|
||||||
# Process refill
|
# Process refill
|
||||||
dewar.last_refill = datetime.now()
|
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(
|
new_event = LogisticsEventModel(
|
||||||
dewar_id=dewar.id, slot_id=None, # No specific slot, as it's a refill event
|
dewar_id=dewar.id, slot_id=None, # No specific slot, as it's a refill event
|
||||||
event_type="refill",
|
event_type="refill",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user