# from utilities.notification_manager import NotificationManager
# from utilities.telegram_utilities import extract_region_number, format_message
# from flask import current_app
#
#
#
# class NotificationService:
#     def __init__(self):
#         self.logger = current_app.logger
#         self.manager = NotificationManager(self.logger)
#
#     def process_notification(self, data):
#         self.logger.info(f"Получены данные уведомления: {data}")
#
#         region_id = extract_region_number(data.get("host"))
#         if region_id is None:
#             self.logger.error(f"Не удалось извлечь номер региона из host: {data.get('host')}")
#             return {"status": "error", "message": "Invalid host format"}, 400
#
#         self.logger.debug(f"Извлечён номер региона: {region_id}")
#
#         subscribers = self.manager.get_subscribers(region_id, data['severity'])
#
#         if self.manager.is_region_active(region_id):
#             message = format_message(data)
#             self.manager.send_notifications(subscribers, message)
#
#         return {"status": "success"}, 200
