Expanded evidence and project endpoints coverage

This commit is contained in:
2026-08-30 17:46:46 +02:00
parent 9d90f9120b
commit 346cb8da5f
12 changed files with 295 additions and 123 deletions
@@ -1,4 +1,4 @@
using PostFundManagement.Application.Extensions;
using PostFundManagement.Application.Extensions;
using PostFundManagement.Application.Services.Projects;
using PostFundManagement.Domain.Abstractions;
using PostFundManagement.Domain.Extensions;
@@ -7,20 +7,20 @@ using PostFundManagement.Domain.Security;
namespace PostFundManagement.Api.Endpoints.Projects;
[ApiVersionTarget(1)]
public class UpdateProjectEndpoint : IEndpoint
public sealed class UpdateProjectEndpoint : IEndpoint
{
public void Map(IEndpointRouteBuilder builder)
{
builder.MapPost("api/projects/status", async (UpdateProjectStatusRequest request, HttpContext context,
ProjectService service, CancellationToken cancellationToken = default) =>
builder.MapPut("api/projects", async (UpdateProjectRequest request,
ProjectService service, HttpContext context, CancellationToken cancellationToken = default) =>
{
var result = await service.UpdateProjectStatusAsync(request, context.GetUserId(), cancellationToken);
var result = await service.UpdateProjectAsync(request, userId: context.GetUserId(), cancellationToken);
return result.IsSuccess
? Results.Ok()
: Results.BadRequest(result.Errors.ToProblems());
})
.WithDescription("Update project status (M04)")
.WithDescription("Update project details")
.WithName(typeof(UpdateProjectEndpoint).ToEndpointName())
.MapToApiVersion(new ApiVersion(1))
.Produces(StatusCodes.Status200OK)