Files
plantillas-proyectos/backend/api/v1/modules/a76/pedmientos/routes/pedimento_validation.py
2026-05-04 15:43:34 -06:00

31 lines
1.0 KiB
Python

"""
Routes for PedimentoValidation CRUD operations
"""
from api.v1.common.tenant_crud_routes import TenantCRUDRoutes
from ..dtos.pedimento_validation import (
PedimentoValidationCreate,
PedimentoValidationResponse,
PedimentoValidationUpdate,
)
from ..services.pedimento_validation import PedimentoValidationService
# Create router with generic CRUD routes for child resource
router = TenantCRUDRoutes(
service=PedimentoValidationService,
create_schema=PedimentoValidationCreate,
update_schema=PedimentoValidationUpdate,
response_schema=PedimentoValidationResponse,
prefix="/{pedimento_id}/validation",
tags=[],
resource_name="Pedimento validation",
parent_id_name="pedimento_id",
enable_list=False, # Child resource - no list endpoint
validate_parent_match=True, # Validate pedimento_id matches in create
get_permissions=["pedimentos_mgmt.view"],
create_permissions=["pedimentos_mgmt.edit"],
update_permissions=["pedimentos_mgmt.edit"],
delete_permissions=["pedimentos_mgmt.edit"],
).router