"""Registro de permisos del módulo Operaciones (ops)."""

from api.v1.modules.core.permissions.registry import registry

MODULE = "ops"

_ENTITIES = [
    ("shipment", "embarques"),
    ("document", "documentos de embarque"),
]
_ACTIONS = [("view", "Ver"), ("create", "Crear"), ("edit", "Editar"), ("delete", "Eliminar")]


def register_permissions() -> None:
    registry.register(code=f"{MODULE}.access", description="Acceso a Operaciones", module=MODULE, action="access")
    for entity, label in _ENTITIES:
        for action, verb in _ACTIONS:
            registry.register(
                code=f"{MODULE}.{entity}.{action}",
                description=f"{verb} {label}",
                module=MODULE,
                action=action,
            )


register_permissions()
