Refactor set_tell_positions logic with updated rules.

Revised the set_tell_positions endpoint to handle updated business rules for puck positioning. Improved event handling to ensure proper nullification, updates, and removal of tell_positions based on the provided payload. Enhanced query performance and normalized puck name processing for consistency.
This commit is contained in:
GotthardG
2025-01-09 09:44:59 +01:00
parent 0fdd5e54b7
commit a9cb7a41b0
3 changed files with 8 additions and 2 deletions

View File

@ -478,7 +478,7 @@ class Puck(BaseModel):
puck_location_in_dewar: int
dewar_id: int
events: List[PuckEvent] = []
samples: List[Sample] = [] # List of samples within this puck
samples: List[Sample] = []
class Config:
from_attributes = True
@ -645,6 +645,8 @@ class PuckWithTellPosition(BaseModel):
puck_type: str
puck_location_in_dewar: Optional[str]
dewar_id: int
dewar_name: str
user: str = "e16371"
samples: Optional[List[Sample]] = None
tell_position: Optional[str]