added more informations in the slot summary
This commit is contained in:
parent
8208a7c4ec
commit
7d5e86932d
@ -170,6 +170,13 @@ async def get_all_slots(db: Session = Depends(get_db)):
|
||||
beamlineLocation = associated_slot.label if associated_slot else None
|
||||
at_beamline = last_event.event_type == "beamline"
|
||||
|
||||
# Corrected the contact_person assignment
|
||||
contact_person = None
|
||||
if slot.dewar and slot.dewar.contact_person:
|
||||
first_name = slot.dewar.contact_person.firstname
|
||||
last_name = slot.dewar.contact_person.lastname
|
||||
contact_person = f"{first_name} {last_name}"
|
||||
|
||||
slot_data = SlotSchema(
|
||||
id=slot.id,
|
||||
qr_code=slot.qr_code,
|
||||
@ -184,6 +191,9 @@ async def get_all_slots(db: Session = Depends(get_db)):
|
||||
retrieved=retrieved,
|
||||
retrievedTimestamp=retrievedTimestamp,
|
||||
beamlineLocation=beamlineLocation,
|
||||
shipment_name=slot.dewar.shipment.shipment_name if slot.dewar and slot.dewar.shipment else None,
|
||||
contact_person=contact_person,
|
||||
local_contact='local contact placeholder'
|
||||
)
|
||||
logger.info(f"Dewar retrieved: {retrieved}")
|
||||
logger.info(f"Dewar at: {beamlineLocation}")
|
||||
|
@ -289,6 +289,9 @@ class SlotSchema(BaseModel):
|
||||
time_until_refill: Optional[int]
|
||||
at_beamline: Optional[bool]
|
||||
beamlineLocation: Optional[str]
|
||||
shipment_name: Optional[str]
|
||||
contact_person: Optional[str]
|
||||
local_contact: Optional[str]
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
Loading…
x
Reference in New Issue
Block a user