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>
17 lines
600 B
Python
17 lines
600 B
Python
"""PropertyManager junction model."""
|
|
from sqlalchemy import Column, ForeignKey, Integer, UniqueConstraint
|
|
|
|
from app.db.session import Base
|
|
|
|
|
|
class PropertyManager(Base):
|
|
"""Junction table linking properties to their managers."""
|
|
|
|
__tablename__ = "property_managers"
|
|
|
|
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=False, index=True)
|
|
|
|
__table_args__ = (UniqueConstraint("property_id", "user_id", name="uq_property_manager"),)
|