feat: Add monitoring alerts skeleton and enhance worker with notifications

This commit is contained in:
masoodafar-web
2025-11-30 20:18:10 +03:30
parent 55fa71e09b
commit 199e7e99d1
23 changed files with 5038 additions and 1168 deletions
@@ -0,0 +1,54 @@
namespace CMSMicroservice.Application.Common.Interfaces;
/// <summary>
/// سرویس ارسال Alert و Notification
/// برای ارسال اعلان‌های مختلف از طریق کانال‌های مختلف (Email, SMS, Slack, etc.)
/// </summary>
public interface IAlertService
{
/// <summary>
/// ارسال Alert برای خطاهای Critical
/// </summary>
Task SendCriticalAlertAsync(string title, string message, Exception? exception = null, CancellationToken cancellationToken = default);
/// <summary>
/// ارسال Alert برای Warning
/// </summary>
Task SendWarningAlertAsync(string title, string message, CancellationToken cancellationToken = default);
/// <summary>
/// ارسال اعلان موفقیت
/// </summary>
Task SendSuccessNotificationAsync(string title, string message, CancellationToken cancellationToken = default);
}
/// <summary>
/// سرویس ارسال Notification به کاربران
/// برای ارسال پیامک، ایمیل و پوش به کاربران سیستم
/// </summary>
public interface IUserNotificationService
{
/// <summary>
/// ارسال اعلان دریافت کمیسیون به کاربر
/// </summary>
Task SendCommissionReceivedNotificationAsync(
long userId,
decimal amount,
int weekNumber,
CancellationToken cancellationToken = default);
/// <summary>
/// ارسال اعلان فعال‌سازی عضویت باشگاه
/// </summary>
Task SendClubActivationNotificationAsync(
long userId,
CancellationToken cancellationToken = default);
/// <summary>
/// ارسال اعلان خطا در پرداخت
/// </summary>
Task SendPayoutErrorNotificationAsync(
long userId,
string errorMessage,
CancellationToken cancellationToken = default);
}