using System.Text.Json; using ECPBLL.Communication.Interfaces; using ECPDAL.Communication.Interfaces; using GB5Shared.DTO.Framework.Login; using GB5Shared.Telemetry; using Microsoft.Extensions.Logging; namespace ECPBLL.Communication.Implementations; public class CommentMentionBLL( ICommentMentionDAL _dal, ILogger _logger ) : ICommentMentionBLL { // PropertyNamingPolicy left at its default (preserve declared PascalCase names) -- see // CommentThreadBLL.cs for why this override was removed. private static readonly JsonSerializerOptions JsonOpts = new(); public async Task GetPendingCommentMentionsAsync(LoginDTO login, CancellationToken ct) { GB5Trace.Step("get-pending-comment-mentions", new { login.UserId }); try { var mentions = await _dal.GetPendingMentionsForUserAsync(login.UserId, login, ct).ConfigureAwait(false); return JsonSerializer.Serialize(mentions, JsonOpts); } catch (Exception ex) { GB5Trace.MarkFailed("get-pending-comment-mentions-failed", ex); _logger.LogError(ex, "GetPendingCommentMentions failed for UserId {UserId}", login.UserId); throw; } } }