EstateHub

Data Model

Most domain models inherit BaseModel, which provides a UUID primary key plus created_at and updated_at timestamps. PostgreSQL is configured for development and production; test settings use the repository's SQLite database.

Domain Relationships

erDiagram
USER ||--o{ VERIFICATION : submits
USER ||--o{ UPLOAD : owns
USER ||--o{ PROPERTY : owns
PROPERTY ||--o{ PROPERTY_MEDIA : contains
PROPERTY ||--o{ CONVERSATION : discusses
CONVERSATION ||--o{ MESSAGE : contains
PROPERTY ||--o{ APPOINTMENT : schedules
PROPERTY ||--o{ PROPERTY_PURCHASE : sells
PROPERTY ||--o{ RENTAL_APPLICATION : rents
RENTAL_APPLICATION ||--o| LEASE : creates
PROPERTY_PURCHASE ||--o{ PAYMENT : references
RENTAL_APPLICATION ||--o{ PAYMENT : references
UPLOAD ||--o{ PROPERTY_MEDIA : backs
UPLOAD ||--o{ PAYMENT : evidences
UPLOAD ||--o{ BRANDING_SETTING : supplies
USER ||--o{ PAYOUT : receives
USER ||--o{ AUDIT_LOG : performs

Application Ownership

ApplicationPrimary models
accountsUser, Verification, SocialAccount
propertiesProperty, PropertyMedia, PropertyResource, PropertyPriceHistory, Amenity, favorites and collections, saved searches, ComparisonSet
communicationsConversation, Message, ConversationParticipantState
appointmentsAppointment
dealsPropertyPurchase, RentalApplication, Lease, ChecklistItem, ChecklistItemProgress
paymentsPayment, Payout
reviewsReview
notificationsNotification, Announcement
documents / auditDocument, AuditLog
platform_configPlatformSetting, BrandingSetting, CommissionSetting, Integration
uploadsUpload and its provider, purpose, privacy, and lifecycle metadata

Integrity Rules

  • Financial and audit models preserve history instead of allowing hard deletion.
  • Database constraints prevent duplicate verification types, favorites, collection membership, and review-per-transaction records.
  • Generic workflow references use a model label or reference type plus UUID rather than a database foreign key.
  • JSON fields store roles, submitted verification data, evidence, preferences, and selected snapshots; validate their shape in services or serializers.

The deals application owns workflow checklist definitions and per-transaction progress. The payments application also contains a separate checklist model with financial transaction stages; treat the two similarly named models as distinct persistence concepts when changing migrations or imports.

The Core domain model supports purchase and lease workflows.