59 lines
No EOL
1.1 KiB
Python
59 lines
No EOL
1.1 KiB
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional, Dict, List
|
|
import uuid
|
|
|
|
class UnloadingBase(BaseModel):
|
|
name: str
|
|
unloading_time_seconds: int
|
|
warnings: Optional[Dict] = {}
|
|
row_count: int
|
|
file_count: int
|
|
computer_name: Optional[str] = None
|
|
|
|
class UnloadingCreate(UnloadingBase):
|
|
guid: Optional[str] = None
|
|
|
|
class Unloading(UnloadingBase):
|
|
guid: str
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class StageBase(BaseModel):
|
|
fio: str
|
|
is_completed: bool = False
|
|
|
|
class UnloadCheckCreate(StageBase):
|
|
pass
|
|
|
|
class TestLoadCreate(StageBase):
|
|
pass
|
|
|
|
class TestCheckCreate(StageBase):
|
|
pass
|
|
|
|
class ProdTransferCreate(StageBase):
|
|
pass
|
|
|
|
class Stage(StageBase):
|
|
id: int
|
|
date: datetime
|
|
product_guid: str
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class ProductBase(BaseModel):
|
|
name: str
|
|
|
|
class Product(ProductBase):
|
|
guid: str
|
|
unload_checks: List[Stage] = []
|
|
test_loads: List[Stage] = []
|
|
test_checks: List[Stage] = []
|
|
prod_transfers: List[Stage] = []
|
|
|
|
class Config:
|
|
from_attributes = True |