From 9cbbdcf323781890226915ef876f39d3162b31e5 Mon Sep 17 00:00:00 2001 From: Jacob Windsor Date: Wed, 19 Feb 2025 17:16:00 +0100 Subject: [PATCH] Add required details --- backend/app/dtos/house_create_request.py | 11 +++++++++++ backend/app/models/house.py | 3 +++ backend/app/routers/houses.py | 3 +++ 3 files changed, 17 insertions(+) diff --git a/backend/app/dtos/house_create_request.py b/backend/app/dtos/house_create_request.py index 0f7fc7c..ca07085 100644 --- a/backend/app/dtos/house_create_request.py +++ b/backend/app/dtos/house_create_request.py @@ -21,3 +21,14 @@ class HouseCreateRequest(BaseModel): 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] + ) diff --git a/backend/app/models/house.py b/backend/app/models/house.py index 9bd08df..84ce0bf 100644 --- a/backend/app/models/house.py +++ b/backend/app/models/house.py @@ -11,3 +11,6 @@ class House(SQLModel, table=True): price: float = Field() description: str = Field() owner_user_id: UUID = Field(foreign_key="owner.user_id") + square_feet: float = Field() + bedrooms: int = Field() + bathrooms: float = Field() diff --git a/backend/app/routers/houses.py b/backend/app/routers/houses.py index f05ca11..6b1ed7f 100644 --- a/backend/app/routers/houses.py +++ b/backend/app/routers/houses.py @@ -35,6 +35,9 @@ async def create_house( country=body.country, price=body.price, description=body.description, + square_feet=body.square_feet, + bedrooms=body.bedrooms, + bathrooms=body.bathrooms, ) await house_repository.save(house)