cmvr-visual/backend/app/schemas/batches.py
zhanghao 88cf14d794 feat: consolidate story studio and editable automatic production
Restructure backend and frontend modules; add story, library, and editor schema migrations.

Support editable automatic production, manual confirmation modes, account and user lifecycle management, compact container scrolling, consistent forms, and per-task result previews.

Update inference and TTS scheduling, deployment guidance, and regression coverage; remove obsolete standalone pages and temporary acceptance artifacts.
2026-11-14 14:07:26 +08:00

32 lines
905 B
Python

from typing import Literal
from pydantic import Field
from app.domain.timeline import Strict
class BatchWorkflow(Strict):
output_folder_id: str | None = None
kind: Literal["workflow"]
draft_id: str
draft_revision: int = Field(ge=1)
expected_version: int = Field(ge=1)
class BatchJob(Strict):
folder_id: str | None = None
output_folder_id: str | None = None
kind: Literal["job"]
task_type: str
input: dict = Field(default_factory=dict)
parameters: dict = Field(default_factory=dict)
count: int = Field(default=1, ge=1, le=4)
class BatchCreate(Strict):
name: str = Field(default="夜间批次", min_length=1, max_length=255)
items: list[BatchWorkflow | BatchJob] = Field(min_length=1, max_length=100)
class BatchControl(Strict):
desired_state: Literal["run", "pause", "cancel"]
expected_version: int | None = Field(default=None, ge=1)