"""Response models for API endpoints."""

from typing import Optional, List
from enum import Enum

from pydantic import BaseModel, Field


class TaskStatus(str, Enum):
    PENDING = "pending"
    PROCESSING = "processing"
    DONE = "done"
    ERROR = "error"


class TrackInfo(BaseModel):
    filename: str
    size: int  # bytes


class UploadResponse(BaseModel):
    task_id: str
    filename: str
    size: int


class SplitResponse(BaseModel):
    task_id: str
    status: TaskStatus


class StatusResponse(BaseModel):
    task_id: str
    status: TaskStatus
    progress: int = Field(0, ge=0, le=100)
    message: str = ""
    error: Optional[str] = None
    tracks: List[TrackInfo] = []