from sqlalchemy import Column, VARCHAR
from sqlalchemy.orm import relationship

from app.domain.models.base import BaseModel
from app.settings import settings


class AppointmentType(BaseModel):
    __tablename__ = 'appointment_types'
    __table_args__ = {"schema": settings.SCHEMA}

    title = Column(VARCHAR(150), nullable=False, unique=True)

    appointments = relationship('Appointment', back_populates='type')
    scheduled_appointments = relationship('ScheduledAppointment', back_populates='type')
