feat: add multi-tenant system with properties, organizations, and public booking
Implement complete multi-property architecture: - Properties (groups of spaces) with public/private visibility - Property managers (many-to-many) with role-based permissions - Organizations with member management - Anonymous/guest booking support via public API (/api/public/*) - Property-scoped spaces, bookings, and settings - Frontend: property selector, organization management, public booking views - Migration script and updated seed data Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
19
backend/app/models/property_access.py
Normal file
19
backend/app/models/property_access.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""PropertyAccess model."""
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, DateTime, ForeignKey, Integer
|
||||
|
||||
from app.db.session import Base
|
||||
|
||||
|
||||
class PropertyAccess(Base):
|
||||
"""Tracks which users/organizations have access to private properties."""
|
||||
|
||||
__tablename__ = "property_access"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
property_id = Column(Integer, ForeignKey("properties.id"), nullable=False, index=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=True, index=True)
|
||||
organization_id = Column(Integer, ForeignKey("organizations.id"), nullable=True, index=True)
|
||||
granted_by = Column(Integer, ForeignKey("users.id"), nullable=True)
|
||||
created_at = Column(DateTime, nullable=False, default=datetime.utcnow)
|
||||
Reference in New Issue
Block a user