Skip to content

Property Management API and Database Foundation #17

@ysnarafat

Description

@ysnarafat

Description

Implement the foundational property management system that serves as the top-level container for buildings and units. This establishes the hierarchical structure: Property → Building → Unit.

Acceptance Criteria

Database Schema

  • Create Property entity with fields: name, address, location, property_type (Residential/Commercial/Mixed), active_status, created_at, updated_at
  • Add proper indexes for property queries and filtering
  • Implement database migrations for property table creation

API Endpoints

  • POST /api/properties - Create new property with validation
  • GET /api/properties - List all properties with filtering and pagination
  • GET /api/properties/{id} - Get single property with building/unit counts
  • PUT /api/properties/{id} - Update property information
  • DELETE /api/properties/{id} - Soft delete property (mark as inactive)

Business Logic

  • Property type validation (Residential/Commercial/Mixed)
  • Property name uniqueness validation
  • Cascade handling for property deletion (prevent if has active buildings/units)
  • Property-level aggregation (total buildings, total units, total revenue)

Testing

  • Unit tests for all CRUD operations
  • Integration tests for property API endpoints
  • Validation tests for business rules
  • Performance tests for property listing with large datasets

Documentation

  • API documentation with request/response examples
  • Database schema documentation
  • Business rule documentation

Technical Notes

  • Use Go with Gin framework for API implementation
  • PostgreSQL for data storage with proper indexing
  • Implement role-based access control (Admin, PropertyManager)
  • Follow RESTful API conventions

Dependencies

  • Database infrastructure setup
  • Authentication system
  • Basic project structure

Labels

backend, api, database, property-management, foundation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions