"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query");exports.metadata={summary:"Bulk updates the status of Investments",operationId:"bulkUpdateInvestmentStatus",tags:["Admin","Investments"],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{ids:{type:"array",description:"Array of Investment IDs to update",items:{type:"string"}},status:{type:"string",enum:["ACTIVE","COMPLETED","CANCELLED","REJECTED"],description:"New status to apply to the Investments"}},required:["ids","status"]}}}},responses:(0,query_1.updateRecordResponses)("Investment"),requiresAuth:!0,permission:"edit.investment",logModule:"ADMIN_FIN",logTitle:"Bulk Update Investment Status"};exports.default=async t=>{const{body:e,ctx:s}=t,{ids:n,status:u}=e;null==s||s.step("Validating investment IDs and status");null==s||s.step("Bulk updating investment status");const a=await(0,query_1.updateStatus)("investment",n,u);null==s||s.success();return a};