using ECPDAL.Communication.DTOs; using ECPDAL.Communication.Interfaces; using ECPDAL.Communication.QueryBuilders; using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; namespace ECPDAL.Communication.Implementations; public class CommentMentionDAL(IQueryExecutor _qe) : ICommentMentionDAL { public async Task SaveCommentMentionAsync( CommentMentionDTO dto, LoginDTO login, CancellationToken ct) { return await _qe.ExecuteAsync( login, CommentMentionQB.SAVE_COMMENT_MENTION, dto, cancellationToken: ct).ConfigureAwait(false); } public async Task> GetPendingMentionsForUserAsync( int userId, LoginDTO login, CancellationToken ct) { var rows = await _qe.QueryAsync( login, CommentMentionQB.GET_PENDING_MENTIONS_FOR_USER, new { UserId = userId, login.DatabaseName }, cancellationToken: ct).ConfigureAwait(false); return rows.ToList(); } public async Task MarkMentionsNotifiedAsync( int commentThreadId, LoginDTO login, CancellationToken ct) { await _qe.ExecuteAsync( login, CommentMentionQB.MARK_MENTIONS_NOTIFIED, new { CommentThreadId = commentThreadId, IsNotified = true, NotifiedOn = DateTime.UtcNow, login.DatabaseName, }, cancellationToken: ct).ConfigureAwait(false); } }