| | | 1 | | using FAU.Logica.DTOs; |
| | | 2 | | using FAU.Logica.Services; |
| | | 3 | | using FAU.Entidades; |
| | | 4 | | using Microsoft.AspNetCore.Authorization; |
| | | 5 | | using Microsoft.AspNetCore.Http; |
| | | 6 | | using Microsoft.AspNetCore.Mvc; |
| | | 7 | | |
| | | 8 | | namespace FAU.API.Controllers; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// [DEPRECATED] Reemplazado por Form 3100. Ver /api/form3100. |
| | | 12 | | /// </summary> |
| | | 13 | | [ApiController] |
| | | 14 | | [Route("api/dependientes")] |
| | | 15 | | [Produces("application/json")] |
| | | 16 | | public class DependienteController : ControllerBase |
| | | 17 | | { |
| | | 18 | | private readonly IDependienteService _dependienteService; |
| | | 19 | | private readonly ILogger<DependienteController> _logger; |
| | | 20 | | |
| | 18 | 21 | | public DependienteController(IDependienteService dependienteService, ILogger<DependienteController> logger) |
| | | 22 | | { |
| | 18 | 23 | | _dependienteService = dependienteService; |
| | 18 | 24 | | _logger = logger; |
| | 18 | 25 | | } |
| | | 26 | | |
| | | 27 | | private static IActionResult GoneResult() => |
| | 18 | 28 | | new ObjectResult(new { message = "Este módulo fue reemplazado por Form 3100. Use /api/form3100." }) |
| | 18 | 29 | | { |
| | 18 | 30 | | StatusCode = 410 |
| | 18 | 31 | | }; |
| | | 32 | | |
| | | 33 | | [HttpGet] |
| | | 34 | | [Authorize] |
| | | 35 | | [ProducesResponseType(typeof(object), StatusCodes.Status410Gone)] |
| | | 36 | | public Task<IActionResult> GetDependientes( |
| | | 37 | | [FromQuery] string? cedulaTitular = null, |
| | | 38 | | [FromQuery] string? tipo = null, |
| | | 39 | | [FromQuery] bool? activo = null, |
| | | 40 | | [FromQuery] int page = 1, |
| | | 41 | | [FromQuery] int pageSize = 20) |
| | | 42 | | { |
| | 2 | 43 | | return Task.FromResult(GoneResult()); |
| | | 44 | | } |
| | | 45 | | |
| | | 46 | | [HttpGet("tipos")] |
| | | 47 | | [Authorize] |
| | | 48 | | [ProducesResponseType(typeof(object), StatusCodes.Status410Gone)] |
| | | 49 | | public IActionResult GetTipos() |
| | | 50 | | { |
| | 1 | 51 | | return GoneResult(); |
| | | 52 | | } |
| | | 53 | | |
| | | 54 | | [HttpGet("{id}")] |
| | | 55 | | [Authorize] |
| | | 56 | | [ProducesResponseType(typeof(object), StatusCodes.Status410Gone)] |
| | | 57 | | public Task<IActionResult> GetDependiente(long id) |
| | | 58 | | { |
| | 3 | 59 | | return Task.FromResult(GoneResult()); |
| | | 60 | | } |
| | | 61 | | |
| | | 62 | | [HttpGet("persona/{cedula}")] |
| | | 63 | | [Authorize] |
| | | 64 | | [ProducesResponseType(typeof(object), StatusCodes.Status410Gone)] |
| | | 65 | | public Task<IActionResult> GetDependientesByPersona(string cedula) |
| | | 66 | | { |
| | 2 | 67 | | return Task.FromResult(GoneResult()); |
| | | 68 | | } |
| | | 69 | | |
| | | 70 | | [HttpPost] |
| | | 71 | | [Authorize] |
| | | 72 | | [ProducesResponseType(typeof(object), StatusCodes.Status410Gone)] |
| | | 73 | | public Task<IActionResult> CreateDependiente([FromBody] object? _ = null) |
| | | 74 | | { |
| | 5 | 75 | | return Task.FromResult(GoneResult()); |
| | | 76 | | } |
| | | 77 | | |
| | | 78 | | [HttpPut("{id}")] |
| | | 79 | | [Authorize] |
| | | 80 | | [ProducesResponseType(typeof(object), StatusCodes.Status410Gone)] |
| | | 81 | | public Task<IActionResult> UpdateDependiente(long id, [FromBody] UpdateDependienteRequest request) |
| | | 82 | | { |
| | 5 | 83 | | return Task.FromResult(GoneResult()); |
| | | 84 | | } |
| | | 85 | | } |