59 lines
1.3 KiB
Python
59 lines
1.3 KiB
Python
from pydantic import BaseModel
|
|
from typing import List, Optional
|
|
|
|
class ContactPersonSchema(BaseModel):
|
|
id: Optional[int]
|
|
firstname: str
|
|
lastname: str
|
|
phone_number: str
|
|
email: str
|
|
|
|
class Config:
|
|
from_attributes = True # Update here
|
|
|
|
class AddressSchema(BaseModel):
|
|
id: Optional[int]
|
|
street: str
|
|
city: str
|
|
zipcode: str
|
|
country: str
|
|
|
|
class Config:
|
|
from_attributes = True # Update here
|
|
|
|
class DewarSchema(BaseModel):
|
|
id: Optional[str]
|
|
dewar_name: str
|
|
tracking_number: Optional[str]
|
|
number_of_pucks: int
|
|
number_of_samples: int
|
|
status: str
|
|
ready_date: Optional[str]
|
|
shipping_date: Optional[str]
|
|
arrival_date: Optional[str]
|
|
returning_date: Optional[str]
|
|
qrcode: str
|
|
|
|
class Config:
|
|
from_attributes = True # Update here
|
|
|
|
class ProposalSchema(BaseModel):
|
|
id: Optional[int]
|
|
number: str
|
|
|
|
class Config:
|
|
from_attributes = True # Update here
|
|
|
|
class ShipmentSchema(BaseModel):
|
|
shipment_id: Optional[str]
|
|
shipment_name: str
|
|
shipment_date: str
|
|
shipment_status: str
|
|
contact_person: List[ContactPersonSchema]
|
|
proposal_number: List[ProposalSchema]
|
|
return_address: List[AddressSchema]
|
|
comments: Optional[str] = None
|
|
dewars: List[DewarSchema]
|
|
|
|
class Config:
|
|
from_attributes = True # Update here |