"""DMS契约固定枚举。"""

from __future__ import annotations

from enum import StrEnum


class RoleCode(StrEnum):
    USER = "USER"
    ADMIN = "ADMIN"


class AllowedModule(StrEnum):
    DOCUMENT_BROWSER = "DOCUMENT_BROWSER"
    BACKEND_MANAGEMENT = "BACKEND_MANAGEMENT"
    AUDIT_LOG = "AUDIT_LOG"


class DocumentType(StrEnum):
    MAIN = "MAIN"
    SUB_PLAN = "SUB_PLAN"
    ATTACHMENT = "ATTACHMENT"


class DocumentStatus(StrEnum):
    DRAFT = "DRAFT"
    PUBLISHED = "PUBLISHED"
    ARCHIVED = "ARCHIVED"


class SecurityLevel(StrEnum):
    PUBLIC = "PUBLIC"
    INTERNAL = "INTERNAL"
    SECRET = "SECRET"
    CONFIDENTIAL = "CONFIDENTIAL"
    TOP_SECRET = "TOP_SECRET"


SECURITY_LEVEL_VALUES = {
    SecurityLevel.PUBLIC: 10,
    SecurityLevel.INTERNAL: 20,
    SecurityLevel.SECRET: 30,
    SecurityLevel.CONFIDENTIAL: 40,
    SecurityLevel.TOP_SECRET: 50,
}


class VisibilityType(StrEnum):
    ALL_AUTHENTICATED = "ALL_AUTHENTICATED"
    ORGANIZATION = "ORGANIZATION"
    CUSTOM = "CUSTOM"


class AttachmentType(StrEnum):
    POLICY = "POLICY"
    WORK_STANDARD = "WORK_STANDARD"
    TABLE = "TABLE"
    DIAGRAM = "DIAGRAM"
    OTHER = "OTHER"


class SubjectType(StrEnum):
    ORG = "ORG"
    USER = "USER"


class AllowedAction(StrEnum):
    VIEW = "VIEW"
    DOWNLOAD = "DOWNLOAD"
    EDIT = "EDIT"
    CONFIG_PERMISSION = "CONFIG_PERMISSION"
    DELETE = "DELETE"
    BIND_ATTACHMENT = "BIND_ATTACHMENT"
    UNBIND_ATTACHMENT = "UNBIND_ATTACHMENT"


class CategoryType(StrEnum):
    SCENE = "SCENE"
    STYLE = "STYLE"
    SITUATION = "SITUATION"
    VERSION = "VERSION"
    OTHER = "OTHER"


class EnabledStatus(StrEnum):
    ENABLED = "ENABLED"
    DISABLED = "DISABLED"


class AuditResult(StrEnum):
    SUCCESS = "SUCCESS"
    FAILURE = "FAILURE"


class AuditAction(StrEnum):
    LOGIN = "LOGIN"
    LOGOUT = "LOGOUT"
    VIEW_DOCUMENT = "VIEW_DOCUMENT"
    DOWNLOAD_DOCUMENT = "DOWNLOAD_DOCUMENT"
    UPLOAD_DOCUMENT = "UPLOAD_DOCUMENT"
    BATCH_IMPORT = "BATCH_IMPORT"
    EDIT_DOCUMENT = "EDIT_DOCUMENT"
    DELETE_DOCUMENT = "DELETE_DOCUMENT"
    CREATE_CATEGORY = "CREATE_CATEGORY"
    EDIT_CATEGORY = "EDIT_CATEGORY"
    DELETE_CATEGORY = "DELETE_CATEGORY"
    CHANGE_PERMISSION = "CHANGE_PERMISSION"
    BIND_ATTACHMENT = "BIND_ATTACHMENT"
    UNBIND_ATTACHMENT = "UNBIND_ATTACHMENT"
    RESTORE_DOCUMENT = "RESTORE_DOCUMENT"


class AuditTarget(StrEnum):
    AUTH = "AUTH"
    CATEGORY = "CATEGORY"
    DOCUMENT = "DOCUMENT"
    ATTACHMENT = "ATTACHMENT"
    PERMISSION = "PERMISSION"
    ATTACHMENT_BINDING = "ATTACHMENT_BINDING"


class ContentExtractStatus(StrEnum):
    SUCCESS = "SUCCESS"
    EMPTY = "EMPTY"
    UNSUPPORTED = "UNSUPPORTED"
    FAILED = "FAILED"
