Добавлена dadata

This commit is contained in:
Раис Юсупалиев
2026-03-28 03:44:05 +03:00
parent 5f6406c712
commit 17772e5337
18 changed files with 603 additions and 3 deletions
+8 -1
View File
@@ -1,4 +1,4 @@
"""Input schemas for price calculation."""
"""Input schemas for delivery-related API requests."""
from enum import StrEnum
@@ -24,3 +24,10 @@ class DeliveryCalculationRequest(BaseModel):
width_cm: float = Field(gt=0)
height_cm: float = Field(gt=0)
parcel_type: ParcelType | None = None
class AddressSuggestRequest(BaseModel):
country_code: str = Field(min_length=2, max_length=2)
city: str = Field(min_length=1)
query: str = Field(min_length=1)
limit: int | None = Field(default=None, gt=0)
+7 -1
View File
@@ -1,4 +1,4 @@
"""Output schemas for aggregated prices."""
"""Output schemas for delivery-related API responses."""
from decimal import Decimal
@@ -12,3 +12,9 @@ class DeliveryPrice(BaseModel):
currency: str = Field(min_length=3, max_length=3)
delivery_days_min: int = Field(ge=0)
delivery_days_max: int = Field(ge=0)
class AddressSuggestion(BaseModel):
provider: str = Field(min_length=1)
address: str = Field(min_length=1)
postal_code: str | None = None