< 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_18869653307
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)
 13112        {
 13113            RouteGroupBuilder fieldProcessingsApi = app.MapGroup("/field-processings");
 13114            fieldProcessingsApi.MapGet("/{projectId}/{className}/{fieldName}",
 13115                async (IFieldProcessingService fieldProcessingService,
 13116                [Description("ID of project")] string projectId,
 13117                [Description("Name of class")] string className,
 13118                [Description("Name of field")] string fieldName)
 219                    => await GetProcessings.Handle(fieldProcessingService, projectId, className, fieldName))
 13120                .WithName("GetFieldProcessings")
 13121                .WithDisplayName("GetFieldProcessings")
 13122                .WithSummary("Gets the list of available processings of a field in a class from a project")
 13123                .WithDescription("Gets the list of available processings of a field in a class from a project")
 13124                .Produces<List<FieldDefinitionModel>>(StatusCodes.Status200OK)
 13125                .Produces<string>(StatusCodes.Status404NotFound)
 13126                .Produces<string>(StatusCodes.Status400BadRequest);
 27
 13128            fieldProcessingsApi.MapGet("/{projectId}/{className}/{fieldName}/{processingName}",
 13129                async (IFieldProcessingService fieldProcessingService,
 13130                [Description("ID of project")] string projectId,
 13131                [Description("Name of class")] string className,
 13132                [Description("Name of field")] string fieldName,
 13133                [Description("Name of processing")] string processingName)
 234                    => await GetProcessing.Handle(fieldProcessingService, projectId, className, fieldName, processingNam
 13135                .WithName("GetFieldProcessing")
 13136                .WithDisplayName("GetFieldProcessing")
 13137                .WithSummary("Gets a field processing from a class of a project by its name")
 13138                .WithDescription("Gets a field processing from a class of a project by its name")
 13139                .Produces<FieldDefinitionModel>(StatusCodes.Status200OK)
 13140                .Produces<string>(StatusCodes.Status404NotFound)
 13141                .Produces<string>(StatusCodes.Status400BadRequest);
 42
 13143            fieldProcessingsApi.MapPut("/{wipProjectId}/{className}/{fieldName}/{processingName}",
 13144                async (IFieldProcessingService fieldProcessingService,
 13145                [Description("ID of WIP project")] string wipProjectId,
 13146                [Description("Name of class")] string className,
 13147                [Description("Name of field")] string fieldName,
 13148                [Description("Name of field processing")] string processingName,
 13149                [Description("Field processing update request")][FromBody] FieldValueProcessingModel createRequest)
 350                    => await UpdateProcessing.Handle(fieldProcessingService, wipProjectId, className, fieldName, process
 13151                .WithName("UpdateProcessing")
 13152                .WithDisplayName("UpdateProcessing")
 13153                .WithSummary("Updates a field processing in a class of a WIP project")
 13154                .WithDescription("Updates a field processing in a class of a WIP project")
 13155                .Produces<FieldDefinitionModel>(StatusCodes.Status200OK)
 13156                .Produces<string>(StatusCodes.Status404NotFound)
 13157                .Produces<string>(StatusCodes.Status400BadRequest);
 58
 13159            fieldProcessingsApi.MapPost("/{wipProjectId}/{className}/{fieldName}",
 13160                async (IFieldProcessingService fieldProcessingService,
 13161                [Description("ID of WIP project")] string wipProjectId,
 13162                [Description("Name of class")] string className,
 13163                [Description("Name of field")] string fieldName,
 13164                [Description("Field processing creation request")][FromBody] FieldValueProcessingModel createRequest)
 665                    => await CreateProcessing.Handle(fieldProcessingService, wipProjectId, className, fieldName, createR
 13166                .WithName("CreateProcessing")
 13167                .WithDisplayName("CreateProcessing")
 13168                .WithSummary("Creates a field processing in a class of a WIP project")
 13169                .WithDescription("Creates a field processing in a class of a WIP project")
 13170                .Produces<FieldDefinitionModel>(StatusCodes.Status201Created)
 13171                .Produces<string>(StatusCodes.Status404NotFound)
 13172                .Produces<string>(StatusCodes.Status400BadRequest);
 73
 13174            fieldProcessingsApi.MapDelete("/{wipProjectId}/{className}/{fieldName}/{processingName}",
 13175                async (IFieldProcessingService fieldProcessingService,
 13176                [Description("ID of WIP project")] string wipProjectId,
 13177                [Description("Name of class")] string className,
 13178                [Description("Name of field")] string fieldName,
 13179                [Description("Name of processing")] string processingName)
 380                    => await DeleteProcessing.Handle(fieldProcessingService, wipProjectId, className, fieldName, process
 13181                .WithName("DeleteProcessing")
 13182                .WithDisplayName("DeleteProcessing")
 13183                .WithSummary("Deletes a field processing from a class of a WIP project by its name")
 13184                .WithDescription("Deletes a field processing from a class of a WIP project by its name")
 13185                .Produces(StatusCodes.Status204NoContent)
 13186                .Produces<string>(StatusCodes.Status404NotFound)
 13187                .Produces<string>(StatusCodes.Status400BadRequest);
 88
 13189            return app;
 13190        }
 91    }
 92}