Automated Action 9ca9d35a1a Implement complete Urban Real Estate API backend
- Set up FastAPI project structure with modular architecture
- Create comprehensive database models for users, properties, messages, notifications, and payments
- Implement JWT-based authentication with role-based access control (Seeker, Agent, Landlord, Admin)
- Build property listings CRUD with advanced search and filtering capabilities
- Add dedicated affordable housing endpoints for Nigerian market focus
- Create real-time messaging system between users
- Implement admin dashboard with property approval workflow and analytics
- Add notification system for user alerts
- Integrate Paystack payment gateway for transactions
- Set up SQLite database with Alembic migrations
- Include comprehensive health check and API documentation
- Add proper error handling and validation throughout
- Follow FastAPI best practices with Pydantic schemas and dependency injection
2025-06-27 12:24:06 +00:00

55 lines
1.4 KiB
Python

from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime
from decimal import Decimal
from app.models.property import PropertyType, PropertyStatus
class PropertyBase(BaseModel):
title: str
description: str
price: Decimal
location: str
state: str
lga: str
property_type: PropertyType
status: PropertyStatus = PropertyStatus.FOR_RENT
bedrooms: Optional[int] = 0
bathrooms: Optional[int] = 0
toilets: Optional[int] = 0
amenities: Optional[List[str]] = []
images: Optional[List[str]] = []
is_affordable: bool = False
class PropertyCreate(PropertyBase):
pass
class PropertyUpdate(BaseModel):
title: Optional[str] = None
description: Optional[str] = None
price: Optional[Decimal] = None
location: Optional[str] = None
state: Optional[str] = None
lga: Optional[str] = None
property_type: Optional[PropertyType] = None
status: Optional[PropertyStatus] = None
bedrooms: Optional[int] = None
bathrooms: Optional[int] = None
toilets: Optional[int] = None
amenities: Optional[List[str]] = None
images: Optional[List[str]] = None
is_affordable: Optional[bool] = None
class PropertyResponse(PropertyBase):
id: int
owner_id: int
is_approved: bool
is_active: bool
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True