Compare commits

..

No commits in common. "564b171e84a5e0bcbf68e9c3dc34696b812c489a" and "109ef556b94c16ef3a68b06c7c0ecd17cf08d8d2" have entirely different histories.

2 changed files with 0 additions and 72 deletions

View File

@ -1,69 +0,0 @@
using Domain.Entities;
using Microsoft.AspNetCore.Mvc;
using System.Reflection;
namespace phronCare.API.Controllers.Sales
{
[Route("api/[controller]")]
[ApiController]
public class DeliveryNoteController : ControllerBase
{
private readonly IDeliveryNoteDom _deliveryNoteService;
public DeliveryNoteController(IDeliveryNoteDom deliveryNoteService)
{
_deliveryNoteService = deliveryNoteService ?? throw new ArgumentNullException(nameof(deliveryNoteService));
}
[HttpGet("{id:int}")]
public async Task<ActionResult<EDeliveryNote>> GetById(int id)
{
try
{
var deliveryNote = await _deliveryNoteService.GetByIdAsync(id);
if (deliveryNote == null)
return NotFound($"Remito con ID {id} no encontrado.");
return Ok(deliveryNote);
}
catch (Exception ex)
{
var methodName = MethodBase.GetCurrentMethod()?.Name ?? "UnknownMethod";
return StatusCode(500, $"{methodName} Message: {ex.Message}");
}
}
[HttpGet("number/{deliveryNoteNumber}")]
public async Task<ActionResult<EDeliveryNote>> GetByDeliveryNoteNumber(string deliveryNoteNumber)
{
try
{
var deliveryNote = await _deliveryNoteService.GetByDeliveryNoteNumberAsync(deliveryNoteNumber);
if (deliveryNote == null)
return NotFound($"Remito con número {deliveryNoteNumber} no encontrado.");
return Ok(deliveryNote);
}
catch (Exception ex)
{
var methodName = MethodBase.GetCurrentMethod()?.Name ?? "UnknownMethod";
return StatusCode(500, $"{methodName} Message: {ex.Message}");
}
}
[HttpGet("by-quote/{quoteId:int}")]
public async Task<ActionResult<IEnumerable<EDeliveryNote>>> GetByQuoteId(int quoteId)
{
try
{
var deliveryNotes = await _deliveryNoteService.GetByQuoteIdAsync(quoteId);
return Ok(deliveryNotes);
}
catch (Exception ex)
{
var methodName = MethodBase.GetCurrentMethod()?.Name ?? "UnknownMethod";
return StatusCode(500, $"{methodName} Message: {ex.Message}");
}
}
}
}

View File

@ -238,9 +238,6 @@ static void RepositorysAndServices(WebApplicationBuilder builder)
builder.Services.AddScoped<IAdjustmentReasonDom, AdjustmentReasonService>();
builder.Services.AddScoped<IPhSAdjustmentReasonRepository, PhSAdjustmentReasonRepository>();
builder.Services.AddScoped<IDeliveryNoteDom, DeliveryNoteService>();
builder.Services.AddScoped<IPhSDeliveryNoteRepository, PhSDeliveryNoteRepository>();
builder.Services.AddScoped<ITaxTypeDom, TaxTypeService>();
builder.Services.AddScoped<IPhOhArcataxTypeRepository, PhOhArcataxTypeRepository>();