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
Application Ownership
| Application | Primary models |
|---|---|
| accounts | User, Verification, SocialAccount |
| properties | Property, PropertyMedia, PropertyResource, PropertyPriceHistory, Amenity, favorites and collections, saved searches, ComparisonSet |
| communications | Conversation, Message, ConversationParticipantState |
| appointments | Appointment |
| deals | PropertyPurchase, RentalApplication, Lease, ChecklistItem, ChecklistItemProgress |
| payments | Payment, Payout |
| reviews | Review |
| notifications | Notification, Announcement |
| documents / audit | Document, AuditLog |
| platform_config | PlatformSetting, BrandingSetting, CommissionSetting, Integration |
| uploads | Upload 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.