001 Project structure
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Shared API and domain schemas."""
|
||||
@@ -0,0 +1,20 @@
|
||||
"""Input schemas for price calculation."""
|
||||
|
||||
from enum import StrEnum
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class DeliveryEntity(StrEnum):
|
||||
INDIVIDUAL = "individual"
|
||||
LEGAL = "legal"
|
||||
|
||||
|
||||
class DeliveryRequest(BaseModel):
|
||||
entity: DeliveryEntity
|
||||
from_city: str = Field(min_length=1)
|
||||
to_city: str = Field(min_length=1)
|
||||
weight_kg: float = Field(gt=0)
|
||||
length_cm: float = Field(gt=0)
|
||||
width_cm: float = Field(gt=0)
|
||||
height_cm: float = Field(gt=0)
|
||||
@@ -0,0 +1,14 @@
|
||||
"""Output schemas for aggregated prices."""
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class DeliveryPrice(BaseModel):
|
||||
provider: str = Field(min_length=1)
|
||||
service_name: str = Field(min_length=1)
|
||||
price: Decimal = Field(gt=0)
|
||||
currency: str = Field(min_length=3, max_length=3)
|
||||
delivery_days_min: int = Field(ge=0)
|
||||
delivery_days_max: int = Field(ge=0)
|
||||
Reference in New Issue
Block a user