from fastapi import APIRouter
from api.v1.common.tenant_crud_routes import TenantCRUDRoutes
from .models import Legend
from .dto import LegendCreate, LegendResponse, LegendUpdate
from .service import LegendService

router = TenantCRUDRoutes(
    service=LegendService,
    create_schema=LegendCreate,
    update_schema=LegendUpdate,
    response_schema=LegendResponse,
    prefix="/legends",
    tags=["a76.general_catalogs.legends"],
    resource_name="Legend",
    enable_list=True,
    enable_filters=True,
    list_permissions=["cat_legends.view"],
    get_permissions=["cat_legends.view"],
    create_permissions=["cat_legends.create"],
    update_permissions=["cat_legends.edit"],
    delete_permissions=["cat_legends.delete"],
).router
