mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
51 lines
881 B
Python
51 lines
881 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from enum import Enum
|
|
|
|
|
|
class RequestStatus(str, Enum):
|
|
NEW = "new"
|
|
IN_PROGRESS = "in_progress"
|
|
RESOLVED = "resolved"
|
|
CLOSED = "closed"
|
|
|
|
|
|
class RequestPriority(str, Enum):
|
|
LOW = "low"
|
|
MEDIUM = "medium"
|
|
HIGH = "high"
|
|
CRITICAL = "critical"
|
|
|
|
|
|
class StatusUpdate(BaseModel):
|
|
status: RequestStatus
|
|
|
|
|
|
class RequestBase(BaseModel):
|
|
department: str
|
|
request_type: str
|
|
priority: RequestPriority
|
|
description: str
|
|
|
|
|
|
class RequestCreate(RequestBase):
|
|
employee_id: int
|
|
|
|
|
|
class Request(RequestBase):
|
|
id: int
|
|
status: RequestStatus
|
|
created_at: datetime
|
|
employee_id: int
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class RequestWithEmployee(Request):
|
|
employee_last_name: str
|
|
employee_first_name: str
|
|
|
|
class Config:
|
|
from_attributes = True
|