"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 Investment Duration",operationId:"storeInvestmentDuration",tags:["Admin","Investment Durations"],requestBody:{required:!0,content:{"application/json":{schema:utils_1.investmentDurationUpdateSchema}}},responses:(0,query_1.storeRecordResponses)(utils_1.investmentDurationStoreSchema,"Investment Duration"),requiresAuth:!0,permission:"create.investment.duration",logModule:"ADMIN_FIN",logTitle:"Create Investment Duration"};exports.default=async e=>{const{body:t,ctx:n}=e,{duration:r,timeframe:s}=t;null==n||n.step("Validating investment duration data");null==n||n.step("Creating investment duration record");const a=await(0,query_1.storeRecord)({model:"investmentDuration",data:{duration:r,timeframe:s}});null==n||n.success("Investment duration created successfully");return a};