"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query");exports.metadata={summary:"Updates the status of a notification template",operationId:"updateNotificationTemplateStatus",tags:["Admin","Notifications"],parameters:[{index:0,name:"id",in:"path",required:!0,description:"ID of the notification template to update",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{email:{type:"boolean",description:"Enable or disable template for email notifications"},sms:{type:"boolean",description:"Enable or disable template for SMS notifications"},push:{type:"boolean",description:"Enable or disable template for push notifications"}},required:["email","sms","push"]}}}},responses:{200:{description:"Notification template status updated successfully",content:{"application/json":{schema:{type:"object",properties:{message:{type:"string",description:"Confirmation message indicating successful update"}}}}}},401:{description:"Unauthorized access"},500:{description:"Internal server error"}},requiresAuth:!0,permission:"edit.notification.template",logModule:"ADMIN_SYS",logTitle:"Update notification template status"};exports.default=async t=>{const{body:e,params:s,ctx:i}=t,{id:a}=s,{email:o,sms:n,push:p}=e;null==i||i.step(`Updating template ${a} status (email: ${o}, sms: ${n}, push: ${p})`);const r=await Promise.all([(0,query_1.updateStatus)("notificationTemplates",a,o,"email"),(0,query_1.updateStatus)("notificationTemplates",a,n,"sms"),(0,query_1.updateStatus)("notificationTemplates",a,p,"push")]).then(()=>({message:"Notification template statuses updated successfully"}));null==i||i.success("Notification template status updated successfully");return r};