"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:"Stores a new withdrawal method",operationId:"storeWithdrawMethod",tags:["Admin","Withdraw Methods"],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:utils_1.baseWithdrawMethodSchema,required:["title","processingTime","instructions","fixedFee","percentageFee","minAmount","maxAmount","status"]}}}},responses:(0,query_1.storeRecordResponses)(utils_1.withdrawalMethodStoreSchema,"Withdraw Method"),requiresAuth:!0,permission:"create.withdraw.method",logModule:"ADMIN_FIN",logTitle:"Create Withdraw Method"};exports.default=async e=>{const{body:t,ctx:s}=e,{title:r,processingTime:i,instructions:o,image:a,fixedFee:d,percentageFee:u,minAmount:n,maxAmount:m,customFields:c,status:l}=t;null==s||s.step("Creating withdraw method");const h=await(0,query_1.storeRecord)({model:"withdrawMethod",data:{title:r,processingTime:i,instructions:o,image:a,fixedFee:d,percentageFee:u,minAmount:n,maxAmount:m,customFields:c,status:l}});null==s||s.success("Withdraw method created successfully");return h};