You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.3 KiB
Python
51 lines
1.3 KiB
Python
|
|
from datetime import datetime
|
|
from typing import List, Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import Field, computed_field, field_validator, validator
|
|
from src.models import DefultBase, Pagination
|
|
from src.overhaul_scope.schema import ScopeRead
|
|
from .enum import ScopeEquipmentType
|
|
|
|
|
|
class MasterEquipmentBase(DefultBase):
|
|
name: Optional[str] = Field(None, title="Name")
|
|
location_tag: Optional[str] = Field(None, title="Location Tag")
|
|
|
|
|
|
class ScopeEquipmentBase(DefultBase):
|
|
scope_overhaul: Optional[str] = Field(None, title="Scope ID")
|
|
|
|
|
|
class ScopeEquipmentCreate(DefultBase):
|
|
assetnums: List[str]
|
|
scope_name: str
|
|
removal_date: Optional[datetime] = Field(None)
|
|
type: Optional[str] = Field(ScopeEquipmentType.PERM)
|
|
|
|
|
|
class ScopeEquipmentUpdate(ScopeEquipmentBase):
|
|
assetnum: Optional[str] = Field(None, title="Asset Number")
|
|
|
|
|
|
class ScopeEquipmentRead(ScopeEquipmentBase):
|
|
id: UUID
|
|
assetnum: str
|
|
assigned_date: datetime
|
|
master_equipment: MasterEquipmentBase
|
|
|
|
|
|
class ScopeEquipmentPagination(Pagination):
|
|
items: List[ScopeEquipmentRead] = []
|
|
|
|
|
|
class MasterEquipmentRead(DefultBase):
|
|
assetnum: Optional[str] = Field(None, title="Asset Number")
|
|
location_tag: str
|
|
name: str
|
|
|
|
|
|
class MasterEquipmentPagination(Pagination):
|
|
items: List[MasterEquipmentRead] = []
|