"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.deposit",logModule:"ADMIN_FIN",logTitle:"Delete deposit log"};exports.default=async e=>{const{params:t,query:s,ctx:r}=e;null==r||r.step("Fetching deposit log record");null==r||r.step("Deleting associated admin profit");await db_1.models.adminProfit.destroy({where:{transactionId:t.id}});null==r||r.step("Deleting deposit log");const o=await(0,query_1.handleSingleDelete)({model:"transaction",id:t.id,query:s});null==r||r.success("Deposit log deleted successfully");return o};