"use strict";async function getActiveKycLevels(){const e=await db_1.models.kycLevel.findAll({where:{status:"ACTIVE"}});if(!e||0===e.length)throw(0,error_1.createError)({statusCode:404,message:"No active KYC levels found"});return e.map(e=>e.get({plain:!0}))}Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;exports.getActiveKycLevels=getActiveKycLevels;const error_1=require("@b/utils/error"),db_1=require("@b/db"),query_1=require("@b/utils/query");exports.metadata={summary:"Lists the active KYC levels",description:"Fetches all currently active KYC (Know Your Customer) levels that are used for KYC processes. This endpoint is accessible without authentication and returns an array of levels that are marked as active in the system.",operationId:"getActiveKycLevels",tags:["KYC"],logModule:"USER",logTitle:"List KYC levels",responses:{200:{description:"Active KYC levels retrieved successfully",content:{"application/json":{schema:{type:"array",items:{type:"object",properties:{id:{type:"number",description:"Level ID"},title:{type:"string",description:"Level title"},options:{type:"object",description:"Level options as JSON object",nullable:!0},status:{type:"boolean",description:"Active status of the level"}}}}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("Kyc Level"),500:query_1.serverErrorResponse},requiresAuth:!1};exports.default=async e=>{const t=null==e?void 0:e.ctx;null==t||t.step("Retrieving active KYC levels");const s=await getActiveKycLevels();null==t||t.success(`Retrieved ${s.length} active KYC levels`);return s};