mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
22 lines
795 B
Python
22 lines
795 B
Python
"""Employee model"""
|
|
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
from sqlalchemy.orm import relationship
|
|
from datetime import datetime
|
|
|
|
from ..database import Base
|
|
|
|
class Employee(Base):
|
|
"""Employee model"""
|
|
__tablename__ = "employees"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
first_name = Column(String, nullable=False)
|
|
last_name = Column(String, nullable=False)
|
|
department = Column(String, nullable=False)
|
|
office = Column(String, nullable=False)
|
|
hashed_password = Column(String, nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
is_admin = Column(Boolean, default=False)
|
|
created_at = Column(DateTime, nullable=False, default=datetime.utcnow)
|
|
|
|
requests = relationship("Request", back_populates="employee") |