# -*- coding: utf-8 -*-
"""ETL 状态监控 Pydantic 模型

定义游标信息和最近执行记录的响应模型。
"""

from __future__ import annotations

from pydantic import BaseModel


class CursorInfo(BaseModel):
    """ETL 游标信息（单条任务的最后抓取状态）。"""
    task_code: str
    last_start: str | None = None
    last_end: str | None = None


class RecentRun(BaseModel):
    """最近执行记录。"""
    id: str
    task_codes: list[str]
    status: str
    started_at: str
    finished_at: str | None = None
    duration_ms: int | None = None
    exit_code: int | None = None
