"""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]: ...
