TorbatYar/backend/services/healthcare/app/commands/profiles.py
Mortezakoohjani 625275e55b feat(healthcare): add backend service and finalize frontend build
Add the Healthcare platform backend (phases 13.0–13.7) with Alembic migration revision fix, production deploy script, validation reports, shared UI exports, and loyalty list page client directives so Next.js build succeeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 11:38:31 +03:30

47 lines
1.4 KiB
Python

"""Profile command handlers — Phase 13.0."""
from __future__ import annotations
from uuid import UUID
from sqlalchemy.ext.asyncio import AsyncSession
from app.schemas.profiles import DoctorCreate, DoctorUpdate, PatientCreate, PatientUpdate
from app.services.profiles import DoctorService, PatientService
from shared.security import CurrentUser
class ProfileCommands:
def __init__(self, session: AsyncSession) -> None:
self.doctors = DoctorService(session)
self.patients = PatientService(session)
async def create_doctor(
self, tenant_id: UUID, body: DoctorCreate, *, actor: CurrentUser | None
):
return await self.doctors.create(tenant_id, body, actor=actor)
async def update_doctor(
self,
tenant_id: UUID,
doctor_id: UUID,
body: DoctorUpdate,
*,
actor: CurrentUser | None,
):
return await self.doctors.update(tenant_id, doctor_id, body, actor=actor)
async def create_patient(
self, tenant_id: UUID, body: PatientCreate, *, actor: CurrentUser | None
):
return await self.patients.create(tenant_id, body, actor=actor)
async def update_patient(
self,
tenant_id: UUID,
patient_id: UUID,
body: PatientUpdate,
*,
actor: CurrentUser | None,
):
return await self.patients.update(tenant_id, patient_id, body, actor=actor)