"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const db_1=require("@b/db"),query_1=require("@b/utils/query"),utils_1=require("./utils"),sequelize_1=require("sequelize");exports.metadata={summary:"Lists all roles with pagination and optional filtering",operationId:"listRoles",tags:["Admin","CRM","Role"],responses:{200:{description:"Paginated list of roles with detailed permission associations",content:{"application/json":{schema:{type:"array",items:{type:"object",properties:utils_1.baseRoleSchema}}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("Roles"),500:query_1.serverErrorResponse},requiresAuth:!0,permission:"access.role",logModule:"ADMIN_CRM",logTitle:"Get Role Options"};exports.default=async e=>{const{ctx:s}=e;null==s||s.step("Fetching role options");const t=await db_1.models.role.findAll({where:{name:{[sequelize_1.Op.ne]:"Super Admin"}}});null==s||s.success("Role options retrieved successfully");return t};