TorbatYar/backend/services/healthcare/app/providers/contracts.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

76 lines
2.1 KiB
Python

"""Platform capability contracts — interfaces only; no implementations in Healthcare."""
from __future__ import annotations
from typing import Any, Protocol
from uuid import UUID
class AccountingProvider(Protocol):
"""Contract for Accounting. Healthcare must not post journals."""
async def create_billing_intent(
self, *, tenant_id: UUID, reference: str, payload: dict[str, Any]
) -> dict[str, Any]: ...
class CRMProvider(Protocol):
"""Contract for CRM. Healthcare stores external contact refs only."""
async def resolve_contact(
self, *, tenant_id: UUID, contact_ref: str
) -> dict[str, Any]: ...
class LoyaltyProvider(Protocol):
"""Contract for Loyalty. Healthcare must not own points/ledger."""
async def resolve_member(
self, *, tenant_id: UUID, member_ref: str
) -> dict[str, Any]: ...
class CommunicationProvider(Protocol):
"""Contract for Communication Platform. Healthcare must not own SMS providers."""
async def send(
self,
*,
tenant_id: UUID,
channel: str,
template_key: str,
to: str,
payload: dict[str, Any],
) -> None: ...
class DeliveryProvider(Protocol):
"""Contract for Delivery. Healthcare stores delivery job refs only."""
async def request_delivery(
self, *, tenant_id: UUID, request: dict[str, Any]
) -> dict[str, Any]: ...
class StorageProvider(Protocol):
"""Contract for File Storage. Healthcare stores document refs only."""
async def resolve_file(
self, *, tenant_id: UUID, file_ref: str
) -> dict[str, Any]: ...
class AIProvider(Protocol):
"""Contract for AI Platform. Healthcare must not own model inference."""
async def suggest(
self, *, tenant_id: UUID, task: str, context: dict[str, Any]
) -> dict[str, Any]: ...
class IdentityProvider(Protocol):
"""Contract for Identity. Healthcare stores user_id refs only."""
async def resolve_user(
self, *, tenant_id: UUID, user_ref: str
) -> dict[str, Any]: ...