import datetime
from typing import Optional

from pydantic import BaseModel

from app.domain.entities.appointment_type import AppointmentTypeEntity
from app.domain.entities.patient import PatientEntity
from app.domain.entities.user import UserEntity


class AppointmentEntity(BaseModel):
    id: Optional[int] = None
    results: Optional[str] = None
    days_until_the_next_appointment: Optional[int] = None
    appointment_datetime: datetime.datetime

    patient_id: int
    doctor_id: Optional[int] = None
    type_id: int

    patient: Optional[PatientEntity] = None
    doctor: Optional[UserEntity] = None
    type: Optional[AppointmentTypeEntity] = None
