# Copyright (c) 2025 Patrick Motsch
# All rights reserved.
"""Workspace feature data models — WorkspaceUserSettings."""

from typing import Optional
from pydantic import BaseModel, Field
from modules.datamodels.datamodelBase import PowerOnModel
from modules.shared.i18nRegistry import i18nModel
import uuid


@i18nModel("Workspace Benutzereinstellungen")
class WorkspaceUserSettings(PowerOnModel):
    """Benutzerspezifische Workspace-Einstellungen. None = Instanz-Standard."""
    id: str = Field(
        default_factory=lambda: str(uuid.uuid4()),
        description="Primary key",
        json_schema_extra={"label": "ID", "frontend_type": "text", "frontend_readonly": True, "frontend_required": False},
    )
    userId: str = Field(
        description="User ID",
        json_schema_extra={"label": "Benutzer-ID", "frontend_type": "text", "frontend_readonly": True, "frontend_required": True},
    )
    mandateId: str = Field(
        description="Mandate ID",
        json_schema_extra={"label": "Mandanten-ID", "frontend_type": "text", "frontend_readonly": True, "frontend_required": True},
    )
    featureInstanceId: str = Field(
        description="Feature Instance ID",
        json_schema_extra={"label": "Feature-Instanz-ID", "frontend_type": "text", "frontend_readonly": True, "frontend_required": True},
    )
    maxAgentRounds: Optional[int] = Field(
        default=None,
        description="Max agent rounds override (None = instance default)",
        json_schema_extra={"label": "Max. Agenten-Runden", "frontend_type": "number", "frontend_readonly": False, "frontend_required": False},
    )
