using System; namespace FinControl.Web.Services; public interface INotificationService { event Action? OnNotification; void ShowSuccess(string message); void ShowError(string message); void ShowInfo(string message); void ShowWarning(string message); } public class NotificationService : INotificationService { public event Action? OnNotification; public void ShowSuccess(string message) { OnNotification?.Invoke(new Notification { Type = NotificationType.Success, Message = message, Id = Guid.NewGuid() }); } public void ShowError(string message) { OnNotification?.Invoke(new Notification { Type = NotificationType.Error, Message = message, Id = Guid.NewGuid() }); } public void ShowInfo(string message) { OnNotification?.Invoke(new Notification { Type = NotificationType.Info, Message = message, Id = Guid.NewGuid() }); } public void ShowWarning(string message) { OnNotification?.Invoke(new Notification { Type = NotificationType.Warning, Message = message, Id = Guid.NewGuid() }); } } public class Notification { public Guid Id { get; set; } public NotificationType Type { get; set; } public string? Message { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; } public enum NotificationType { Success, Error, Info, Warning }