"""Platform capability contracts — interfaces only; no implementations in Sports Center."""
from __future__ import annotations

from typing import Any, Protocol
from uuid import UUID


class AccountingProvider(Protocol):
    """Contract for Accounting. Sports Center must not post journals."""

    async def create_receivable_ref(
        self, *, tenant_id: UUID, reference: str, payload: dict[str, Any]
    ) -> dict[str, Any]: ...


class CRMProvider(Protocol):
    """Contract for CRM. Sports stores external_crm_contact_ref only."""

    async def resolve_contact(
        self, *, tenant_id: UUID, contact_ref: str
    ) -> dict[str, Any]: ...


class LoyaltyProvider(Protocol):
    """Contract for Loyalty. Sports 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. Sports 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 NotificationProvider(Protocol):
    """Contract for Notification fanout. Sports must not own delivery."""

    async def notify(
        self,
        *,
        tenant_id: UUID,
        channel: str,
        template_key: str,
        payload: dict[str, Any],
    ) -> None: ...


class StorageProvider(Protocol):
    """Contract for File Storage. Sports stores file refs only."""

    async def resolve_file(
        self, *, tenant_id: UUID, file_ref: str
    ) -> dict[str, Any]: ...


class AIProvider(Protocol):
    """Contract for AI Platform. Sports 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. Sports stores external_user_ref only."""

    async def resolve_user(
        self, *, tenant_id: UUID, user_ref: str
    ) -> dict[str, Any]: ...


class Customer360Provider(Protocol):
    """Contract for Customer360. Sports stores external_customer_ref only."""

    async def upsert_party_reference(
        self, *, tenant_id: UUID, source: str, source_id: UUID, payload: dict[str, Any]
    ) -> None: ...
