"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const error_1=require("@b/utils/error"),query_1=require("@b/utils/query"),utils_1=require("../utils");exports.metadata={summary:"Show Binary Order",operationId:"showBinaryOrder",tags:["Binary","Orders"],description:"Retrieves a specific binary order by ID for the authenticated user.",logModule:"EXCHANGE",logTitle:"Get Binary Order",parameters:[{name:"id",in:"path",description:"ID of the binary order to retrieve.",required:!0,schema:{type:"string",format:"uuid"}}],responses:{200:{description:"Binary order data",content:{"application/json":{schema:{type:"object",properties:utils_1.baseBinaryOrderSchema}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("Binary Order"),500:query_1.serverErrorResponse},requiresAuth:!0};exports.default=async r=>{var e;if(!(null===(e=r.user)||void 0===e?void 0:e.id))throw(0,error_1.createError)({statusCode:401,message:"Unauthorized"});const{user:t,params:o,ctx:s}=r,{id:a}=o;if(!a)throw(0,error_1.createError)({statusCode:400,message:"Order ID is required"});if(!t)throw(0,error_1.createError)({statusCode:401,message:"Unauthorized"});const i=await(0,utils_1.getBinaryOrder)(t.id,a,s);if(!i)throw(0,error_1.createError)({statusCode:404,message:"Binary order with ID "+a+" not found"});return i};