feat: add full project - backend, frontend, docker, specs and configs
This commit is contained in:
parent
b77c7d5a01
commit
e6cb06255b
24489 changed files with 61341 additions and 36 deletions
57
backend/app/schemas/property.py
Normal file
57
backend/app/schemas/property.py
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from uuid import UUID
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from app.schemas.catalog import AmenityOut, ImobiliariaOut, PropertyTypeOut, CityOut, NeighborhoodOut
|
||||
|
||||
|
||||
class PropertyPhotoOut(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
url: str
|
||||
alt_text: str
|
||||
display_order: int
|
||||
|
||||
|
||||
class PropertyOut(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: UUID
|
||||
title: str
|
||||
slug: str
|
||||
code: str | None = None
|
||||
price: Decimal
|
||||
condo_fee: Decimal | None
|
||||
iptu_anual: Decimal | None = None
|
||||
type: Literal["venda", "aluguel"]
|
||||
subtype: PropertyTypeOut | None
|
||||
bedrooms: int
|
||||
bathrooms: int
|
||||
parking_spots: int
|
||||
area_m2: int
|
||||
city: CityOut | None
|
||||
neighborhood: NeighborhoodOut | None
|
||||
imobiliaria: ImobiliariaOut | None = None
|
||||
is_featured: bool
|
||||
created_at: datetime | None = None
|
||||
photos: list[PropertyPhotoOut]
|
||||
amenities: list[AmenityOut] = []
|
||||
|
||||
|
||||
class PaginatedPropertiesOut(BaseModel):
|
||||
items: list[PropertyOut]
|
||||
total: int
|
||||
page: int
|
||||
per_page: int
|
||||
pages: int
|
||||
|
||||
|
||||
class PropertyDetailOut(PropertyOut):
|
||||
address: str | None = None
|
||||
code: str | None = None
|
||||
description: str | None = None
|
||||
Loading…
Add table
Add a link
Reference in a new issue