added a router for logistics, now creating label
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
from sqlalchemy import Column, Integer, String, Date, ForeignKey, JSON
|
||||
from sqlalchemy import Column, Integer, String, Date, ForeignKey, JSON, Interval, DateTime, Boolean
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.database import Base
|
||||
from datetime import datetime, timedelta
|
||||
import uuid
|
||||
|
||||
|
||||
@ -130,3 +131,23 @@ class Sample(Base):
|
||||
# Foreign keys and relationships
|
||||
puck_id = Column(Integer, ForeignKey('pucks.id'))
|
||||
puck = relationship("Puck", back_populates="samples")
|
||||
|
||||
class Slot(Base):
|
||||
__tablename__ = "slots"
|
||||
id = Column(String, primary_key=True, index=True)
|
||||
occupied = Column(Boolean, default=False)
|
||||
needs_refill = Column(Boolean, default=False)
|
||||
time_until_refill = Column(Interval, nullable=True)
|
||||
last_refill = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
|
||||
class LogisticsEvent(Base):
|
||||
__tablename__ = "logistics_events"
|
||||
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
||||
dewar_id = Column(Integer, ForeignKey('dewars.id'), nullable=False)
|
||||
slot_id = Column(String, ForeignKey('slots.id'), nullable=True)
|
||||
event_type = Column(String, nullable=False)
|
||||
timestamp = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
dewar = relationship("Dewar")
|
||||
slot = relationship("Slot")
|
Reference in New Issue
Block a user