from __future__ import annotations

from dataclasses import dataclass


@dataclass(slots=True)
class ProviderResult:
    ok: bool
    external_key: str = ""
    error: str = ""
    payload: dict | None = None


class TaskProvider:
    name = "base"
    run_in_worker = False

    def healthcheck(self, config: dict) -> ProviderResult:
        raise NotImplementedError

    def create_task(self, config: dict, payload: dict) -> ProviderResult:
        raise NotImplementedError

    def append_update(self, config: dict, payload: dict) -> ProviderResult:
        raise NotImplementedError

    def mark_complete(self, config: dict, payload: dict) -> ProviderResult:
        raise NotImplementedError

    def link_task(self, config: dict, payload: dict) -> ProviderResult:
        raise NotImplementedError
