"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 Binary Market",operationId:"storeBinaryMarket",tags:["Admin","Binary Markets"],requestBody:{required:!0,content:{"application/json":{schema:utils_1.BinaryMarketUpdateSchema}}},responses:(0,query_1.storeRecordResponses)(utils_1.BinaryMarketStoreSchema,"Binary Market"),requiresAuth:!0,permission:"create.binary.market",logModule:"ADMIN_BINARY",logTitle:"Create binary market"};exports.default=async e=>{const{body:r,ctx:t}=e,{currency:a,pair:s,isTrending:i,isHot:n,status:o}=r;null==t||t.step("Validating binary market data");null==t||t.step("Creating binary market record");const u=await(0,query_1.storeRecord)({model:"binaryMarket",data:{currency:a,pair:s,isTrending:void 0!==i&&i,isHot:void 0!==n&&n,status:void 0===o||o}});null==t||t.success("Binary market created successfully");return u};