< Summary - Estud

Information
Class: Estud.Back.Features.Classes.ReleaseClassForEnrollment.ReleaseClassForEnrollmentController
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Classes/ReleaseClassForEnrollment/ReleaseClassForEnrollmentController.cs
Tag: 114_29044117136
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 28
Line coverage: 0%
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
.ctor(...)100%210%
Release()100%210%

File(s)

/home/runner/work/syki/syki/Back/Features/Classes/ReleaseClassForEnrollment/ReleaseClassForEnrollmentController.cs

#LineLine coverage
 1namespace Estud.Back.Features.Classes.ReleaseClassForEnrollment;
 2
 3[ApiController, Authorize(Policies.ReleaseClassForEnrollment)]
 04public class ReleaseClassForEnrollmentController(ReleaseClassForEnrollmentService service) : ControllerBase
 5{
 6    /// <summary>
 7    /// Liberar turma para matrícula
 8    /// </summary>
 9    /// <remarks>
 10    /// Libera a turma para que os alunos possam se matricular.
 11    /// Só é possível dentro do período de matrícula vigente, e a turma deve estar em pré-matrícula.
 12    /// </remarks>
 13    [HttpPut("classes/{id}/release-for-enrollment")]
 14    [SwaggerResponseExample(200, typeof(ResponseExamples))]
 15    [SwaggerResponseExample(400, typeof(ErrorsExamples))]
 16    public async Task<IActionResult> Release(int id)
 17    {
 018        var result = await service.Release(id);
 019        return result.Match<IActionResult>(Ok, BadRequest);
 020    }
 21}
 22
 23internal class ResponseExamples : ExamplesProvider<SuccessOut>;
 24internal class ErrorsExamples : ErrorExamplesProvider<
 25    ClassNotFound,
 26    NoCurrentEnrollmentPeriod,
 27    ClassMustBeOnPreEnrollment
 28>;