"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:"Updates a Binary Market",operationId:"updateBinaryMarket",tags:["Admin","Binary Markets"],parameters:[{index:0,name:"id",in:"path",required:!0,description:"ID of the binary market to update",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:utils_1.BinaryMarketUpdateSchema}}},responses:(0,query_1.updateRecordResponses)("Binary Market"),requiresAuth:!0,permission:"update.binary.market",logModule:"ADMIN_BINARY",logTitle:"Update binary market"};exports.default=async e=>{const{body:t,params:r,ctx:a}=e,{id:s}=r,{currency:i,pair:n,isTrending:u,isHot:d,status:o}=t;null==a||a.step("Fetching binary market record");const p={currency:i,pair:n};void 0!==u&&(p.isTrending=u);void 0!==d&&(p.isHot=d);void 0!==o&&(p.status=o);null==a||a.step("Updating binary market");const c=await(0,query_1.updateRecord)("binaryMarket",s,p,!0);null==a||a.success("Binary market updated successfully");return c};