35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class HouseCreateRequest(BaseModel):
|
|
address: str = Field(
|
|
...,
|
|
min_length=1,
|
|
max_length=255,
|
|
description="House address",
|
|
examples=["123 Main St"],
|
|
)
|
|
city: str = Field(
|
|
..., description="City where the house is located", examples=["Springfield"]
|
|
)
|
|
country: str = Field(
|
|
..., description="Country where the house is located", examples=["USA"]
|
|
)
|
|
price: float = Field(..., description="Price of the house", examples=[250000.00])
|
|
description: str = Field(
|
|
...,
|
|
description="Description of the house",
|
|
examples=["A beautiful 3-bedroom house"],
|
|
)
|
|
square_feet: float = Field(
|
|
...,
|
|
description="Square footage of the house",
|
|
examples=[1500.00],
|
|
)
|
|
bedrooms: int = Field(
|
|
..., description="Number of bedrooms in the house", examples=[3]
|
|
)
|
|
bathrooms: float = Field(
|
|
..., description="Number of bathrooms in the house", examples=[2.5]
|
|
)
|