feat: add feedback comments activity notifications
This commit is contained in:
@@ -54,11 +54,25 @@ public class CancelMyFeedbackHandler(AppDbContext dbContext)
|
||||
}
|
||||
|
||||
DateTimeOffset now = DateTimeOffset.UtcNow;
|
||||
FeedbackStatus previousStatus = report.Status;
|
||||
report.Status = FeedbackStatus.Cancelled;
|
||||
report.CancelledAt = now;
|
||||
report.CancelledByUserId = reporterUserId;
|
||||
report.CancellationReason = string.IsNullOrWhiteSpace(request.Reason) ? null : request.Reason.Trim();
|
||||
report.LastActivityAt = now;
|
||||
report.ActivityEntries.Add(new FeedbackActivityEntry
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
FeedbackReportId = report.Id,
|
||||
ActorUserId = reporterUserId,
|
||||
ActorDisplayName = User.GetAlias() ?? User.GetName(),
|
||||
ActorEmail = User.GetEmail(),
|
||||
ActivityType = FeedbackActivityTypes.Cancelled,
|
||||
FromValue = previousStatus.ToFeedbackDisplayString(),
|
||||
ToValue = FeedbackStatus.Cancelled.ToFeedbackDisplayString(),
|
||||
Note = report.CancellationReason,
|
||||
CreatedAt = now,
|
||||
});
|
||||
|
||||
await dbContext.SaveChangesAsync(ct);
|
||||
await SendOkAsync(report.ToDto(), ct);
|
||||
|
||||
Reference in New Issue
Block a user