from pydantic import Field

from omnibase_core.models.primitives.model_semver import ModelSemVer

"""
Workflow Metadata Model - ONEX Standards Compliant.

Model for workflow metadata in the ONEX workflow coordination system.
"""

from pydantic import BaseModel


class ModelWorkflowDefinitionMetadata(BaseModel):
    """Metadata for a workflow definition."""

    # Model version for instance tracking
    version: ModelSemVer = Field(
        ...,  # REQUIRED - specify in contract
        description="Model version (MUST be provided in YAML contract)",
    )

    workflow_name: str = Field(default=..., description="Name of the workflow")

    workflow_version: ModelSemVer = Field(
        ...,  # REQUIRED - specify in contract
        description="Version of the workflow (MUST be provided in YAML contract)",
    )

    description: str = Field(default=..., description="Description of the workflow")

    execution_mode: str = Field(
        default="sequential",
        description="Execution mode: sequential, parallel, batch, conditional, or streaming",
    )

    timeout_ms: int = Field(
        default=600000,
        description="Workflow timeout in milliseconds",
        ge=1000,
    )

    model_config = {
        "extra": "ignore",
        "use_enum_values": False,
        "validate_assignment": True,
        "from_attributes": True,
    }
