"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query"),utils_1=require("../utils"),db_1=require("@b/db");exports.metadata={summary:"Retrieves a specific KYC application by ID",operationId:"getKycApplicationById",tags:["Admin","CRM","KYC"],parameters:[{index:0,name:"id",in:"path",required:!0,description:"ID of the KYC application to retrieve",schema:{type:"string"}}],responses:{200:{description:"KYC application details",content:{"application/json":{schema:{type:"object",properties:utils_1.kycApplicationSchema}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("KYC application not found"),500:query_1.serverErrorResponse},requiresAuth:!0,permission:"view.kyc.application",logModule:"ADMIN_CRM",logTitle:"View KYC application",demoMask:["user.email","user.phone"]};exports.default=async e=>{const{params:i,ctx:t}=e;null==t||t.step(`Fetching KYC application ${i.id}`);const s=await(0,query_1.getRecord)("kycApplication",i.id,[{model:db_1.models.user,as:"user",attributes:["id","email","avatar","firstName","lastName","emailVerified","phone","lastLogin","lastFailedLogin","failedLoginAttempts","status","createdAt","profile"],includeModels:[{model:db_1.models.role,as:"role",attributes:["id","name"],includeModels:[{model:db_1.models.permission,as:"permissions",attributes:["id","name"],through:{attributes:[]}}]}]},{model:db_1.models.kycLevel,as:"level",paranoid:!1,includeModels:[{model:db_1.models.kycVerificationService,as:"verificationService"}]},{model:db_1.models.kycVerificationResult,as:"verificationResult"}]);null==t||t.success("KYC application retrieved successfully");return s};