from __future__ import annotations

from dataclasses import dataclass
from datetime import date
from typing import Literal
from uuid import UUID

type JsonValue = (
    str | int | float | bool | None | list["JsonValue"] | dict[str, "JsonValue"]
)


type RecordValue = (
    str | int | float | bool | None | list[JsonValue] | dict[str, JsonValue] | object
)


type Record = dict[str, RecordValue]


type TriggerType = Literal[
    "SCHEDULED",
    "MANUAL",
    "BACKFILL",
]


@dataclass(frozen=True, slots=True)
class BatchExecutionContext:
    trigger_type: TriggerType
    business_date: date
    attempt_number: int
    logical_run_id: UUID


@dataclass(frozen=True, slots=True)
class BatchRunSummary:
    succeeded: list[str]
    failed: list[str]


@dataclass(frozen=True, slots=True)
class MissingDate:
    business_date: date
    status: str
    latest_attempt: int | None = None
