forked from hesabix/arc
24 lines
989 B
Python
24 lines
989 B
Python
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import String, DateTime, Integer, ForeignKey, Boolean
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from adapters.db.session import Base
|
|
|
|
|
|
class SlaPolicy(Base):
|
|
__tablename__ = "support_sla_policies"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
|
name: Mapped[str] = mapped_column(String(100), nullable=False)
|
|
priority_id: Mapped[int | None] = mapped_column(
|
|
Integer, ForeignKey("support_priorities.id", ondelete="CASCADE"), nullable=True, index=True
|
|
)
|
|
first_response_minutes: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
resolution_minutes: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
is_active: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)
|
|
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow, nullable=False)
|
|
|
|
priority = relationship("Priority")
|