chore: rescate y restauracion de modulos base, a76 y digitalizacion tras conflictos
This commit is contained in:
@@ -82,7 +82,7 @@ async def export_doda_list(
|
||||
"""
|
||||
Listado al estilo legacy: filtra `doda_date` (YYYYMMDD) entre inicio y fin.
|
||||
"""
|
||||
tenant_id = int(validate_access_to_resource(db, company_id, current_user))
|
||||
tenant_id = int(validate_access_to_resource(db, company_id, current_user, ["cat_doda.view"]))
|
||||
try:
|
||||
d0, d1, fmt, mode = parse_export_params(
|
||||
date_from, date_to, file_format, date_mode
|
||||
@@ -126,7 +126,7 @@ async def export_doda_pedimentos(
|
||||
Reporte por DODA seleccionado: columnas alineadas al listado de pedimentos (PATENTE, DOCUMENTO, COVE, etc.).
|
||||
Si no hay líneas, se devuelve el archivo solo con encabezados.
|
||||
"""
|
||||
tenant_id = int(validate_access_to_resource(db, company_id, current_user))
|
||||
tenant_id = int(validate_access_to_resource(db, company_id, current_user, ["cat_doda.view"]))
|
||||
try:
|
||||
fmt = parse_pedimento_export_format(file_format)
|
||||
except ValueError as e:
|
||||
@@ -168,6 +168,11 @@ _crud_router = TenantCRUDRoutes(
|
||||
id_name="doda_id",
|
||||
enable_list=True,
|
||||
enable_filters=True,
|
||||
list_permissions=["cat_doda.view"],
|
||||
get_permissions=["cat_doda.view"],
|
||||
create_permissions=["cat_doda.create"],
|
||||
update_permissions=["cat_doda.edit"],
|
||||
delete_permissions=["cat_doda.delete"],
|
||||
).router
|
||||
router.include_router(_crud_router)
|
||||
|
||||
@@ -183,7 +188,7 @@ async def get_doda_detail(
|
||||
db: Session = Depends(get_core_db),
|
||||
current_user: dict = Depends(get_current_user),
|
||||
):
|
||||
tenant_id = validate_access_to_resource(db, company_id, current_user)
|
||||
tenant_id = validate_access_to_resource(db, company_id, current_user, ["cat_doda.view"])
|
||||
doda = DodaService.get_by_id(db, doda_id, tenant_id, company_id)
|
||||
if not doda:
|
||||
raise HTTPException(
|
||||
|
||||
@@ -28,6 +28,11 @@ router = TenantCRUDRoutes(
|
||||
resource_name="Electronic Notice",
|
||||
enable_list=True,
|
||||
enable_filters=True,
|
||||
list_permissions=["cat_notices.view"],
|
||||
get_permissions=["cat_notices.view"],
|
||||
create_permissions=["cat_notices.create"],
|
||||
update_permissions=["cat_notices.edit"],
|
||||
delete_permissions=["cat_notices.delete"],
|
||||
).router
|
||||
|
||||
|
||||
@@ -43,7 +48,7 @@ async def get_notices_by_pedimento(
|
||||
current_user: dict = Depends(get_current_user),
|
||||
):
|
||||
"""Get all electronic notices for a specific pedimento"""
|
||||
tenant_id = validate_access_to_resource(db, company_id, current_user)
|
||||
tenant_id = validate_access_to_resource(db, company_id, current_user, ["cat_notices.view"])
|
||||
notices = ElectronicNoticeService.get_by_pedimento(
|
||||
db, pedimento, tenant_id, company_id)
|
||||
return [ElectronicNoticeResponseDTO.model_validate(notice) for notice in notices]
|
||||
@@ -61,7 +66,7 @@ async def get_notices_by_status(
|
||||
current_user: dict = Depends(get_current_user),
|
||||
):
|
||||
"""Get all electronic notices with a specific status"""
|
||||
tenant_id = validate_access_to_resource(db, company_id, current_user)
|
||||
tenant_id = validate_access_to_resource(db, company_id, current_user, ["cat_notices.view"])
|
||||
notices = ElectronicNoticeService.get_by_status(
|
||||
db, status, tenant_id, company_id)
|
||||
return [ElectronicNoticeResponseDTO.model_validate(notice) for notice in notices]
|
||||
|
||||
Reference in New Issue
Block a user