feat: appointment relation table
fix: relations for clinic doc and clinic
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
from datetime import datetime
|
||||
from typing import List, Optional
|
||||
from pydantic import BaseModel, EmailStr
|
||||
from enums.enums import AppointmentStatus, ClinicUserRoles, UserType, Integration
|
||||
from enums.enums import AppointmentStatus, ClinicDoctorStatus, ClinicDoctorType, ClinicUserRoles, UserType, Integration
|
||||
|
||||
|
||||
# Base schemas (shared attributes for create/read operations)
|
||||
@@ -69,4 +69,10 @@ class UserBase(BaseModel):
|
||||
email: EmailStr
|
||||
password: str
|
||||
clinicRole: Optional[ClinicUserRoles] = None
|
||||
userType: Optional[UserType] = None
|
||||
userType: Optional[UserType] = None
|
||||
|
||||
|
||||
class ClinicDoctorBase(BaseModel):
|
||||
name: str
|
||||
role: ClinicDoctorType
|
||||
status: ClinicDoctorStatus
|
||||
@@ -37,3 +37,7 @@ class UserCreate(BaseModel):
|
||||
user: UserBase
|
||||
# Clinic data sent from frontend
|
||||
clinic: ClinicBase
|
||||
|
||||
|
||||
class ClinicDoctorCreate(ClinicDoctorBase):
|
||||
pass
|
||||
|
||||
@@ -12,6 +12,16 @@ class Clinic(ClinicBase):
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class ClinicDoctorResponse(ClinicDoctorBase):
|
||||
id: int
|
||||
create_time: datetime
|
||||
update_time: datetime
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class UserResponse(UserBase):
|
||||
id: int
|
||||
create_time: datetime
|
||||
@@ -124,3 +134,12 @@ class AppointmentDetailed(AppointmentSchema):
|
||||
|
||||
doctor: Doctor
|
||||
patient: Patient
|
||||
|
||||
|
||||
class ClinicDoctor(ClinicDoctorBase):
|
||||
id: int
|
||||
create_time: datetime
|
||||
update_time: datetime
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
@@ -44,3 +44,7 @@ class UserUpdate(BaseModel):
|
||||
userType: Optional[UserType] = None
|
||||
profile_pic: Optional[str] = None
|
||||
password: Optional[str] = None
|
||||
|
||||
|
||||
class ClinicDoctorUpdate(ClinicDoctorBase):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user