Update Expeditions Details Draw
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 6m33s

This commit is contained in:
Leandro Hernan Rojas 2025-09-05 23:56:28 -03:00
parent be690849fd
commit 813bcc24b1
3 changed files with 94 additions and 2 deletions

View File

@ -60,6 +60,29 @@ namespace phronCare.API.Controllers.Stock
}
}
// GET /api/expedition/{id}
[HttpGet("{id:int}")]
[ProducesResponseType(typeof(ExpeditionDto), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult<ExpeditionDto>> GetById(int id)
{
var dto = await _expeditionService.GetDtoByIdAsync(id);
if (dto is null) return NotFound($"Expedición con ID {id} no encontrada.");
return Ok(dto);
}
// (opcional) GET /api/expedition/summary/{expeditionNumber}
[HttpGet("summary/{expeditionNumber}")]
[ProducesResponseType(typeof(ExpeditionDto), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult<ExpeditionDto>> GetByNumber(string expeditionNumber)
{
var dto = await _expeditionService.GetDtoByExpeditionNumberAsync(expeditionNumber);
if (dto is null) return NotFound($"No se encontró expedición {expeditionNumber}.");
return Ok(dto);
}
#region Endpoint de emision de expedicion (encabezado + detalles)
[HttpPost("createfull")]
public async Task<IActionResult> CreateFullExpedition([FromBody] CreateFullExpeditionRequest request)
@ -108,7 +131,6 @@ namespace phronCare.API.Controllers.Stock
return File(pdfBytes, "application/pdf", $"Expedicion_{expedition.Expeditionnumber}.pdf");
}
}
public class CreateFullExpeditionRequest
{

View File

@ -627,6 +627,41 @@
}
]
},
{
"ContainingType": "phronCare.API.Controllers.Stock.ExpeditionController",
"Method": "GetById",
"RelativePath": "api/Expedition/{id}",
"HttpMethod": "GET",
"IsController": true,
"Order": 0,
"Parameters": [
{
"Name": "id",
"Type": "System.Int32",
"IsRequired": true
}
],
"ReturnTypes": [
{
"Type": "Domain.Dtos.Stock.ExpeditionDto",
"MediaTypes": [
"text/plain",
"application/json",
"text/json"
],
"StatusCode": 200
},
{
"Type": "Microsoft.AspNetCore.Mvc.ProblemDetails",
"MediaTypes": [
"text/plain",
"application/json",
"text/json"
],
"StatusCode": 404
}
]
},
{
"ContainingType": "phronCare.API.Controllers.Stock.ExpeditionController",
"Method": "GetQuotePdf",
@ -715,6 +750,41 @@
}
]
},
{
"ContainingType": "phronCare.API.Controllers.Stock.ExpeditionController",
"Method": "GetByNumber",
"RelativePath": "api/Expedition/summary/{expeditionNumber}",
"HttpMethod": "GET",
"IsController": true,
"Order": 0,
"Parameters": [
{
"Name": "expeditionNumber",
"Type": "System.String",
"IsRequired": true
}
],
"ReturnTypes": [
{
"Type": "Domain.Dtos.Stock.ExpeditionDto",
"MediaTypes": [
"text/plain",
"application/json",
"text/json"
],
"StatusCode": 200
},
{
"Type": "Microsoft.AspNetCore.Mvc.ProblemDetails",
"MediaTypes": [
"text/plain",
"application/json",
"text/json"
],
"StatusCode": 404
}
]
},
{
"ContainingType": "phronCare.API.Controllers.Sales.InstitutionController",
"Method": "GetById",

View File

@ -111,7 +111,7 @@ namespace phronCare.UIBlazor.Services.Stock.Expeditions
{
try
{
var dto = await _http.GetFromJsonAsync<ExpeditionDto>($"/expedition/{id}");
var dto = await _http.GetFromJsonAsync<ExpeditionDto>($"/api/expedition/{id}");
return dto;
}
catch (Exception ex)