| | 1 | | namespace Syki.Back.Features.Academic.UpdateEnrollmentPeriod; |
| | 2 | |
|
| | 3 | | [ApiController, AuthAcademic] |
| | 4 | | [EnableRateLimiting("Medium")] |
| 100 | 5 | | public class UpdateEnrollmentPeriodController(UpdateEnrollmentPeriodService service) : ControllerBase |
| | 6 | | { |
| | 7 | | /// <summary> |
| | 8 | | /// Editar período de matrícula |
| | 9 | | /// </summary> |
| | 10 | | /// <remarks> |
| | 11 | | /// Edita os dados do período de matrícula informado. |
| | 12 | | /// </remarks> |
| | 13 | | [HttpPut("academic/enrollment-periods/{id}")] |
| | 14 | | [SwaggerResponseExample(200, typeof(ResponseExamples))] |
| | 15 | | [SwaggerResponseExample(400, typeof(ErrorsExamples))] |
| | 16 | | public async Task<IActionResult> Update([FromRoute] string id, [FromBody] UpdateEnrollmentPeriodIn data) |
| | 17 | | { |
| 100 | 18 | | var result = await service.Update(User.InstitutionId, id, data); |
| 100 | 19 | | return result.Match<IActionResult>(Ok, BadRequest); |
| 100 | 20 | | } |
| | 21 | | } |
| | 22 | |
|
| | 23 | | internal class RequestExamples : ExamplesProvider<UpdateEnrollmentPeriodIn>; |
| | 24 | | internal class ResponseExamples : ExamplesProvider<EnrollmentPeriodOut>; |
| | 25 | | internal class ErrorsExamples : ErrorExamplesProvider< |
| | 26 | | AcademicPeriodNotFound, |
| | 27 | | EnrollmentPeriodNotFound, |
| | 28 | | InvalidEnrollmentPeriodDates>; |