"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query"),utils_1=require("../utils");exports.metadata={summary:"Updates an existing withdrawal method",operationId:"updateWithdrawMethod",tags:["Admin","Withdraw Methods"],parameters:[{index:0,name:"id",in:"path",description:"ID of the withdrawal method to update",required:!0,schema:{type:"string"}}],requestBody:{required:!0,description:"Updated data for the withdrawal method",content:{"application/json":{schema:utils_1.withdrawalMethodUpdateSchema}}},responses:(0,query_1.updateRecordResponses)("Withdraw Method"),requiresAuth:!0,permission:"edit.withdraw.method",logModule:"ADMIN_FIN",logTitle:"Update Withdraw Method"};exports.default=async e=>{const{body:t,params:i,ctx:a}=e,{id:d}=i,{title:s,processingTime:r,instructions:o,image:u,fixedFee:n,percentageFee:m,minAmount:p,maxAmount:h,customFields:c,status:l}=t;null==a||a.step("Updating withdraw method");const w=await(0,query_1.updateRecord)("withdrawMethod",d,{title:s,processingTime:r,instructions:o,image:u,fixedFee:n,percentageFee:m,minAmount:p,maxAmount:h,customFields:c,status:l});null==a||a.success("Withdraw method updated successfully");return w};