"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const Websocket_1=require("@b/handler/Websocket"),query_1=require("@b/utils/query");exports.metadata={summary:"Deletes an announcement",operationId:"deleteAnnouncement",tags:["Admin","Announcements"],parameters:(0,query_1.deleteRecordParams)("announcement"),responses:(0,query_1.deleteRecordResponses)("Announcement"),permission:"delete.announcement",requiresAuth:!0,logModule:"ADMIN_SYS",logTitle:"Delete announcement"};exports.default=async e=>{const{params:n,query:t,ctx:s}=e,{id:o}=n;null==s||s.step(`Deleting announcement ${o}`);const u=(0,query_1.handleSingleDelete)({model:"announcement",id:o,query:t});null==s||s.step("Broadcasting announcement deletion");(0,Websocket_1.handleBroadcastMessage)({type:"announcements",method:"delete",id:o});null==s||s.success("Announcement deleted successfully");return u};