"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const db_1=require("@b/db"),query_1=require("@b/utils/query");exports.metadata={summary:"Deletes a transaction",operationId:"deleteTransaction",tags:["Admin","Transaction"],parameters:(0,query_1.deleteRecordParams)("transaction"),responses:(0,query_1.deleteRecordResponses)("Transaction"),requiresAuth:!0,permission:"delete.transfer",logModule:"ADMIN_FIN",logTitle:"Delete Transfer"};exports.default=async e=>{const{params:r,query:t,ctx:a}=e;await db_1.models.adminProfit.destroy({where:{transactionId:r.id}});return(0,query_1.handleSingleDelete)({model:"transaction",id:r.id,query:t})};