"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const db_1=require("@b/db"),query_1=require("@b/utils/query"),constants_1=require("@b/utils/constants");exports.metadata={summary:"Lists all KYC templates with pagination and optional filtering",operationId:"listKycTemplates",tags:["Admin","CRM","KYC Template"],parameters:constants_1.crudParameters,logModule:"ADMIN_CRM",logTitle:"List KYC levels",responses:{200:{description:"Paginated list of KYC templates with detailed information",content:{"application/json":{schema:{type:"object",properties:{data:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string"},status:{type:"string",enum:["ACTIVE","DRAFT","INACTIVE"],description:"Level status"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}}}},pagination:constants_1.paginationSchema}}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("KYC Templates"),500:query_1.serverErrorResponse},requiresAuth:!0,permission:"view.kyc.level"};exports.default=async e=>{const{query:t,ctx:s}=e;null==s||s.step("Fetching KYC levels");const r=await(0,query_1.getFiltered)({model:db_1.models.kycLevel,query:t,sortField:t.sortField||"createdAt",timestamps:!1});null==s||s.success("KYC levels retrieved successfully");return r};