from fastapi import APIRouter
from api.v1.common.tenant_crud_routes import TenantCRUDRoutes
from .models import Port
from .dto import PortCreate, PortResponse, PortUpdate
from .service import PortService

router = TenantCRUDRoutes(
    service=PortService,
    create_schema=PortCreate,
    update_schema=PortUpdate,
    response_schema=PortResponse,
    prefix="/ports",
    tags=["a76.general_catalogs.ports"],
    resource_name="Port",
    enable_list=True,
    max_page_size=1000,
    list_permissions=["cat_ports.view"],
    get_permissions=["cat_ports.view"],
    create_permissions=["cat_ports.create"],
    update_permissions=["cat_ports.edit"],
    delete_permissions=["cat_ports.delete"],
).router
