File size: 780 Bytes
680fa2b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from backend.app.models.base import BaseDBModel

class RosterWorker(BaseDBModel):
    __tablename__ = "roster_workers"
    
    mediator_id = Column(UUID(as_uuid=True), ForeignKey("users.id", ondelete="CASCADE"), index=True, nullable=False)
    name = Column(String, nullable=False)
    skill = Column(String, nullable=False)
    phone_status = Column(String, nullable=False) # e.g. "IVR only", "Verified"
    status = Column(String, nullable=False) # e.g. "Available", "On job"
    commission = Column(Integer, nullable=False, default=0)
    
    # Relationships
    mediator = relationship("User", back_populates="roster_workers")