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:
17
backend/app/models/organization_member.py
Normal file
17
backend/app/models/organization_member.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""OrganizationMember junction model."""
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String, UniqueConstraint
|
||||
|
||||
from app.db.session import Base
|
||||
|
||||
|
||||
class OrganizationMember(Base):
|
||||
"""Junction table linking organizations to their members."""
|
||||
|
||||
__tablename__ = "organization_members"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
organization_id = Column(Integer, ForeignKey("organizations.id"), nullable=False, index=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=False, index=True)
|
||||
role = Column(String, nullable=False, default="member") # "admin" or "member"
|
||||
|
||||
__table_args__ = (UniqueConstraint("organization_id", "user_id", name="uq_org_member"),)
|
||||
Reference in New Issue
Block a user