"""
Routes for managing Packages (GBultos).
"""

from api.v1.common.tenant_crud_routes import TenantCRUDRoutes

from .dto import PackageCreateDTO, PackageResponseDTO, PackageUpdateDTO
from .services import PackageService

# Create router using TenantCRUDRoutes factory
router = TenantCRUDRoutes(
    service=PackageService,
    create_schema=PackageCreateDTO,
    update_schema=PackageUpdateDTO,
    response_schema=PackageResponseDTO,
    prefix="/packages",
    tags=["a76 / packages"],
    resource_name="Package",
    id_name="package_id",
    enable_list=True,  # Enable GET /packages with pagination
    enable_filters=True,  # Enable filtering by key and description_es
    default_page_size=50,
    max_page_size=100,
    # Permisos
    list_permissions=["cat_packages.view"],
    get_permissions=["cat_packages.view"],
    create_permissions=["cat_packages.create"],
    update_permissions=["cat_packages.edit"],
    delete_permissions=["cat_packages.delete"],
).router
