using Review = Netina.Domain.Entities.Reviews.Review; namespace Netina.Core.EntityServices.ReviewHandlers; public class ConfirmReviewCommandHandler(IRepositoryWrapper repositoryWrapper) : IRequestHandler { public async Task Handle(ConfirmReviewCommand request, CancellationToken cancellationToken) { var review = await repositoryWrapper.SetRepository().TableNoTracking .FirstOrDefaultAsync(r => r.Id == request.Id, cancellationToken); if (review == null) throw new AppException("Review not found", ApiResultStatusCode.NotFound); review.ConfirmReview(); repositoryWrapper.SetRepository().Update(review); await repositoryWrapper.SaveChangesAsync(cancellationToken); return review.Id; } }