020 update city code resolving
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
from enum import StrEnum
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel, Field, StrictInt
|
||||
|
||||
|
||||
class DeliveryEntity(StrEnum):
|
||||
@@ -15,11 +15,10 @@ class ParcelType(StrEnum):
|
||||
PARCEL = "parcel"
|
||||
|
||||
|
||||
class DeliveryRequest(BaseModel):
|
||||
class DeliveryCalculationRequest(BaseModel):
|
||||
entity: DeliveryEntity
|
||||
from_city: str = Field(min_length=1)
|
||||
to_city: str = Field(min_length=1)
|
||||
country_code: str | None = None
|
||||
from_city: StrictInt
|
||||
to_city: StrictInt
|
||||
weight_kg: float = Field(gt=0)
|
||||
length_cm: float = Field(gt=0)
|
||||
width_cm: float = Field(gt=0)
|
||||
|
||||
Reference in New Issue
Block a user