Update Expeditions Details Draw
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 6m33s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 6m33s
This commit is contained in:
parent
be690849fd
commit
813bcc24b1
@ -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)
|
#region Endpoint de emision de expedicion (encabezado + detalles)
|
||||||
[HttpPost("createfull")]
|
[HttpPost("createfull")]
|
||||||
public async Task<IActionResult> CreateFullExpedition([FromBody] CreateFullExpeditionRequest request)
|
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");
|
return File(pdfBytes, "application/pdf", $"Expedicion_{expedition.Expeditionnumber}.pdf");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public class CreateFullExpeditionRequest
|
public class CreateFullExpeditionRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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",
|
"ContainingType": "phronCare.API.Controllers.Stock.ExpeditionController",
|
||||||
"Method": "GetQuotePdf",
|
"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",
|
"ContainingType": "phronCare.API.Controllers.Sales.InstitutionController",
|
||||||
"Method": "GetById",
|
"Method": "GetById",
|
||||||
|
|||||||
@ -111,7 +111,7 @@ namespace phronCare.UIBlazor.Services.Stock.Expeditions
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var dto = await _http.GetFromJsonAsync<ExpeditionDto>($"/expedition/{id}");
|
var dto = await _http.GetFromJsonAsync<ExpeditionDto>($"/api/expedition/{id}");
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user