Files
g2s-aggregator/app/schemas/request.py
T
Раис Юсупалиев c4175121a0 018 add parcel type
2026-03-18 21:44:00 +03:00

28 lines
618 B
Python

"""Input schemas for price calculation."""
from enum import StrEnum
from pydantic import BaseModel, Field
class DeliveryEntity(StrEnum):
INDIVIDUAL = "individual"
LEGAL = "legal"
class ParcelType(StrEnum):
DOC = "doc"
PARCEL = "parcel"
class DeliveryRequest(BaseModel):
entity: DeliveryEntity
from_city: str = Field(min_length=1)
to_city: str = Field(min_length=1)
country_code: str | None = None
weight_kg: float = Field(gt=0)
length_cm: float = Field(gt=0)
width_cm: float = Field(gt=0)
height_cm: float = Field(gt=0)
parcel_type: ParcelType | None = None