"""No-op mock implementations of platform provider contracts — Healthcare."""
from __future__ import annotations

from typing import Any
from uuid import UUID


class MockAccountingProvider:
    async def create_billing_intent(
        self, *, tenant_id: UUID, reference: str, payload: dict[str, Any]
    ) -> dict[str, Any]:
        return {"ok": True, "reference": reference, "provider": "mock_accounting"}


class MockCRMProvider:
    async def resolve_contact(
        self, *, tenant_id: UUID, contact_ref: str
    ) -> dict[str, Any]:
        return {"ok": True, "contact_ref": contact_ref, "provider": "mock_crm"}


class MockLoyaltyProvider:
    async def resolve_member(
        self, *, tenant_id: UUID, member_ref: str
    ) -> dict[str, Any]:
        return {"ok": True, "member_ref": member_ref, "provider": "mock_loyalty"}


class MockCommunicationProvider:
    sent: list[dict[str, Any]] = []

    async def send(
        self,
        *,
        tenant_id: UUID,
        channel: str,
        template_key: str,
        to: str,
        payload: dict[str, Any],
    ) -> None:
        MockCommunicationProvider.sent.append(
            {
                "tenant_id": tenant_id,
                "channel": channel,
                "template_key": template_key,
                "to": to,
                "payload": payload,
            }
        )

    @classmethod
    def reset(cls) -> None:
        cls.sent = []


class MockDeliveryProvider:
    jobs: list[dict[str, Any]] = []

    async def request_delivery(
        self, *, tenant_id: UUID, request: dict[str, Any]
    ) -> dict[str, Any]:
        ref = f"mock-delivery-{len(self.jobs) + 1}"
        self.jobs.append({"tenant_id": tenant_id, "request": request, "ref": ref})
        return {"ok": True, "delivery_ref": ref, "provider": "mock_delivery"}

    @classmethod
    def reset(cls) -> None:
        cls.jobs = []


class MockStorageProvider:
    async def resolve_file(
        self, *, tenant_id: UUID, file_ref: str
    ) -> dict[str, Any]:
        return {"ok": True, "file_ref": file_ref, "provider": "mock_storage"}


class MockAIProvider:
    async def suggest(
        self, *, tenant_id: UUID, task: str, context: dict[str, Any]
    ) -> dict[str, Any]:
        return {"ok": True, "task": task, "provider": "mock_ai"}


class MockIdentityProvider:
    async def resolve_user(
        self, *, tenant_id: UUID, user_ref: str
    ) -> dict[str, Any]:
        return {"ok": True, "user_ref": user_ref, "provider": "mock_identity"}
