"""规则类型绑定 DTO。"""

from pydantic import BaseModel, Field


class RuleBindingCreateDTO(BaseModel):
    """创建规则类型绑定请求。"""

    docTypeId: int = Field(..., description="文档类型ID → leaudit_document_types.id")
    docTypeCode: str | None = Field(None, description="文档类型编码（冗余快速匹配）")
    ruleSetId: int = Field(..., description="规则集ID → leaudit_rule_sets.id")
    region: str = Field("default", description="适用地区")
    bindingMode: str = Field("explicit", description="绑定模式: explicit / wildcard / fallback")
    priority: int = Field(0, description="优先级（数值越大优先级越高）")
    note: str | None = Field(None, description="备注说明")


class RuleBindingUpdateDTO(BaseModel):
    """更新规则类型绑定请求。"""

    isActive: bool | None = Field(None, description="是否激活")
    priority: int | None = Field(None, description="优先级")
    bindingMode: str | None = Field(None, description="绑定模式")
    note: str | None = Field(None, description="备注说明")
