"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:"Bulk deletes announcements by IDs",operationId:"bulkDeleteAnnouncements",tags:["Admin","Announcements"],parameters:(0,query_1.commonBulkDeleteParams)("Announcements"),requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{ids:{type:"array",items:{type:"string"},description:"Array of announcement IDs to delete"}},required:["ids"]}}}},responses:(0,query_1.commonBulkDeleteResponses)("Announcements"),requiresAuth:!0,permission:"delete.announcement",logModule:"ADMIN_SYS",logTitle:"Bulk delete announcements"};exports.default=async e=>{const{body:n,query:t,ctx:s}=e,{ids:o}=n;null==s||s.step(`Deleting ${o.length} announcements`);const u=(0,query_1.handleBulkDelete)({model:"announcement",ids:o,query:t});null==s||s.step("Broadcasting bulk deletion");(0,Websocket_1.handleBroadcastMessage)({type:"announcements",method:"delete",id:o});null==s||s.success(`${o.length} announcements deleted successfully`);return u};