< Summary - pva.SuperV

Information
Class: pva.SuperV.Api.Routes.FieldProcessings.FieldProcessingEndpoints
Assembly: pva.SuperV.Api
File(s): /home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Api/Routes/FieldProcessings/FieldProcessingEndpoints.cs
Tag: dotnet-ubuntu_22190969454
Line coverage
100%
Covered lines: 74
Uncovered lines: 0
Coverable lines: 74
Total lines: 92
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
MapFieldProcessingEndpoints(...)100%11100%

File(s)

/home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Api/Routes/FieldProcessings/FieldProcessingEndpoints.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Mvc;
 2using pva.SuperV.Model.FieldDefinitions;
 3using pva.SuperV.Model.FieldProcessings;
 4using pva.SuperV.Model.Services;
 5using System.ComponentModel;
 6
 7namespace pva.SuperV.Api.Routes.FieldProcessings
 8{
 9    public static class FieldProcessingEndpoints
 10    {
 11        public static WebApplication MapFieldProcessingEndpoints(this WebApplication app)
 14512        {
 14513            RouteGroupBuilder fieldProcessingsApi = app.MapGroup("/field-processings");
 14514            fieldProcessingsApi.MapGet("/{projectId}/{className}/{fieldName}",
 14515                async (IFieldProcessingService fieldProcessingService,
 14516                [Description("ID of project")] string projectId,
 14517                [Description("Name of class")] string className,
 14518                [Description("Name of field")] string fieldName)
 219                    => await GetProcessings.Handle(fieldProcessingService, projectId, className, fieldName))
 14520                .WithName("GetFieldProcessings")
 14521                .WithDisplayName("GetFieldProcessings")
 14522                .WithSummary("Gets the list of available processings of a field in a class from a project")
 14523                .WithDescription("Gets the list of available processings of a field in a class from a project")
 14524                .Produces<List<FieldDefinitionModel>>(StatusCodes.Status200OK)
 14525                .Produces<string>(StatusCodes.Status404NotFound)
 14526                .Produces<string>(StatusCodes.Status400BadRequest);
 27
 14528            fieldProcessingsApi.MapGet("/{projectId}/{className}/{fieldName}/{processingName}",
 14529                async (IFieldProcessingService fieldProcessingService,
 14530                [Description("ID of project")] string projectId,
 14531                [Description("Name of class")] string className,
 14532                [Description("Name of field")] string fieldName,
 14533                [Description("Name of processing")] string processingName)
 234                    => await GetProcessing.Handle(fieldProcessingService, projectId, className, fieldName, processingNam
 14535                .WithName("GetFieldProcessing")
 14536                .WithDisplayName("GetFieldProcessing")
 14537                .WithSummary("Gets a field processing from a class of a project by its name")
 14538                .WithDescription("Gets a field processing from a class of a project by its name")
 14539                .Produces<FieldDefinitionModel>(StatusCodes.Status200OK)
 14540                .Produces<string>(StatusCodes.Status404NotFound)
 14541                .Produces<string>(StatusCodes.Status400BadRequest);
 42
 14543            fieldProcessingsApi.MapPut("/{wipProjectId}/{className}/{fieldName}/{processingName}",
 14544                async (IFieldProcessingService fieldProcessingService,
 14545                [Description("ID of WIP project")] string wipProjectId,
 14546                [Description("Name of class")] string className,
 14547                [Description("Name of field")] string fieldName,
 14548                [Description("Name of field processing")] string processingName,
 14549                [Description("Field processing update request")][FromBody] FieldValueProcessingModel createRequest)
 350                    => await UpdateProcessing.Handle(fieldProcessingService, wipProjectId, className, fieldName, process
 14551                .WithName("UpdateProcessing")
 14552                .WithDisplayName("UpdateProcessing")
 14553                .WithSummary("Updates a field processing in a class of a WIP project")
 14554                .WithDescription("Updates a field processing in a class of a WIP project")
 14555                .Produces<FieldDefinitionModel>(StatusCodes.Status200OK)
 14556                .Produces<string>(StatusCodes.Status404NotFound)
 14557                .Produces<string>(StatusCodes.Status400BadRequest);
 58
 14559            fieldProcessingsApi.MapPost("/{wipProjectId}/{className}/{fieldName}",
 14560                async (IFieldProcessingService fieldProcessingService,
 14561                [Description("ID of WIP project")] string wipProjectId,
 14562                [Description("Name of class")] string className,
 14563                [Description("Name of field")] string fieldName,
 14564                [Description("Field processing creation request")][FromBody] FieldValueProcessingModel createRequest)
 2065                    => await CreateProcessing.Handle(fieldProcessingService, wipProjectId, className, fieldName, createR
 14566                .WithName("CreateProcessing")
 14567                .WithDisplayName("CreateProcessing")
 14568                .WithSummary("Creates a field processing in a class of a WIP project")
 14569                .WithDescription("Creates a field processing in a class of a WIP project")
 14570                .Produces<FieldDefinitionModel>(StatusCodes.Status201Created)
 14571                .Produces<string>(StatusCodes.Status404NotFound)
 14572                .Produces<string>(StatusCodes.Status400BadRequest);
 73
 14574            fieldProcessingsApi.MapDelete("/{wipProjectId}/{className}/{fieldName}/{processingName}",
 14575                async (IFieldProcessingService fieldProcessingService,
 14576                [Description("ID of WIP project")] string wipProjectId,
 14577                [Description("Name of class")] string className,
 14578                [Description("Name of field")] string fieldName,
 14579                [Description("Name of processing")] string processingName)
 380                    => await DeleteProcessing.Handle(fieldProcessingService, wipProjectId, className, fieldName, process
 14581                .WithName("DeleteProcessing")
 14582                .WithDisplayName("DeleteProcessing")
 14583                .WithSummary("Deletes a field processing from a class of a WIP project by its name")
 14584                .WithDescription("Deletes a field processing from a class of a WIP project by its name")
 14585                .Produces(StatusCodes.Status204NoContent)
 14586                .Produces<string>(StatusCodes.Status404NotFound)
 14587                .Produces<string>(StatusCodes.Status400BadRequest);
 88
 14589            return app;
 14590        }
 91    }
 92}