using FastEndpoints; using Microsoft.EntityFrameworkCore; using Socialize.Api.Data; using Socialize.Api.Modules.Feedback.Contracts; using Socialize.Api.Modules.Identity.Contracts; namespace Socialize.Api.Modules.Feedback.Handlers; public class GetDeveloperFeedbackTimelineHandler(AppDbContext dbContext) : EndpointWithoutRequest> { public override void Configure() { Get("/api/feedback/{id}/timeline"); Roles(KnownRoles.Developer); Options(o => o.WithTags("Feedback")); } public override async Task HandleAsync(CancellationToken ct) { Guid id = Route("id"); bool exists = await dbContext.FeedbackReports.AnyAsync(candidate => candidate.Id == id, ct); if (!exists) { await SendNotFoundAsync(ct); return; } IReadOnlyCollection timeline = await GetMyFeedbackTimelineHandler.LoadTimelineAsync(dbContext, id, ct); await SendOkAsync(timeline, ct); } }