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>
28 lines
1.0 KiB
Python
28 lines
1.0 KiB
Python
"""Space model."""
|
|
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.session import Base
|
|
|
|
|
|
class Space(Base):
|
|
"""Space model for offices and meeting rooms."""
|
|
|
|
__tablename__ = "spaces"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String, nullable=False, index=True)
|
|
type = Column(String, nullable=False) # "sala" or "birou"
|
|
capacity = Column(Integer, nullable=False)
|
|
description = Column(String, nullable=True)
|
|
is_active = Column(Boolean, default=True, nullable=False)
|
|
property_id = Column(Integer, ForeignKey("properties.id"), nullable=True, index=True)
|
|
|
|
# Per-space scheduling settings (NULL = use global default)
|
|
working_hours_start = Column(Integer, nullable=True)
|
|
working_hours_end = Column(Integer, nullable=True)
|
|
min_duration_minutes = Column(Integer, nullable=True)
|
|
max_duration_minutes = Column(Integer, nullable=True)
|
|
|
|
property = relationship("Property", backref="spaces")
|