"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query");exports.metadata={summary:"Updates the status of an investment plan",operationId:"updateInvestmentPlanStatus",tags:["Admin","Investment Plans"],logModule:"ADMIN_FIN",logTitle:"Update Plan Status",parameters:[{index:0,name:"id",in:"path",required:!0,description:"ID of the investment plan to update",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{status:{type:"boolean",description:"New status to apply (true for active, false for inactive)"}},required:["status"]}}}},responses:(0,query_1.updateRecordResponses)("Investment Plan"),requiresAuth:!0,permission:"edit.investment.plan"};exports.default=async e=>{const{body:t,params:s,ctx:a}=e,{id:n}=s,{status:r}=t;null==a||a.step("Updating investment plan status");const u=await(0,query_1.updateStatus)("investmentPlan",n,r);null==a||a.success("Investment plan status updated successfully");return u};