Refactor: Mejora la lógica de facturación y la UI
Este commit introduce una refactorización significativa en el módulo de
suscripciones para alinear el sistema con reglas de negocio clave:
facturación consolidada por empresa, cobro a mes adelantado con
imputación de ajustes diferida, y una interfaz de usuario más clara.
Backend:
- **Facturación por Empresa:** Se modifica `FacturacionService` para
agrupar las suscripciones por cliente y empresa, generando una
factura consolidada para cada combinación. Esto asegura la correcta
separación fiscal.
- **Imputación de Ajustes:** Se ajusta la lógica para que la facturación
de un período (ej. Septiembre) aplique únicamente los ajustes
pendientes cuya fecha corresponde al período anterior (Agosto).
- **Cierre Secuencial:** Se implementa una validación en
`GenerarFacturacionMensual` que impide generar la facturación de un
período si el anterior no ha sido cerrado, garantizando el orden
cronológico.
- **Emails Consolidados:** El proceso de notificación automática al
generar el cierre ahora envía un único email consolidado por
suscriptor, detallando los cargos de todas sus facturas/empresas.
- **Envío de PDF Individual:** Se refactoriza el endpoint de envío manual
para que opere sobre una `idFactura` individual y adjunte el PDF
correspondiente si existe.
- **Repositorios Mejorados:** Se optimizan y añaden métodos en
`FacturaRepository` y `AjusteRepository` para soportar los nuevos
requisitos de filtrado y consulta de datos consolidados.
Frontend:
- **Separación de Vistas:** La página de "Facturación" se divide en dos:
- `ProcesosPage`: Para acciones masivas (generar cierre, archivo de
débito, procesar respuesta).
- `ConsultaFacturasPage`: Una nueva página dedicada a buscar,
filtrar y gestionar facturas individuales con una interfaz de doble
acordeón (Suscriptor -> Empresa).
- **Filtros Avanzados:** La página `ConsultaFacturasPage` ahora incluye
filtros por nombre de suscriptor, estado de pago y estado de
facturación.
- **Filtros de Fecha por Defecto:** La página de "Cuenta Corriente"
ahora filtra por el mes actual por defecto para mejorar el rendimiento
y la usabilidad.
- **Validación de Fechas:** Se añade lógica en los filtros de fecha para
impedir la selección de rangos inválidos.
- **Validación de Monto de Pago:** El modal de pago manual ahora impide
registrar un monto superior al saldo pendiente de la factura.
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
// --- REEMPLAZAR ARCHIVO: Controllers/Reportes/PdfTemplates/DistribucionCanillasDocument.cs ---
|
||||
using GestionIntegral.Api.Dtos.Reportes;
|
||||
using GestionIntegral.Api.Dtos.Reportes.ViewModels;
|
||||
using QuestPDF.Fluent;
|
||||
using QuestPDF.Helpers;
|
||||
using QuestPDF.Infrastructure;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace GestionIntegral.Api.Controllers.Reportes.PdfTemplates
|
||||
{
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
using GestionIntegral.Api.Dtos.Reportes.ViewModels;
|
||||
using QuestPDF.Fluent;
|
||||
using QuestPDF.Helpers;
|
||||
using QuestPDF.Infrastructure;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace GestionIntegral.Api.Controllers.Reportes.PdfTemplates
|
||||
{
|
||||
public class FacturasPublicidadDocument : IDocument
|
||||
{
|
||||
public FacturasPublicidadViewModel Model { get; }
|
||||
|
||||
public FacturasPublicidadDocument(FacturasPublicidadViewModel model)
|
||||
{
|
||||
Model = model;
|
||||
}
|
||||
|
||||
public DocumentMetadata GetMetadata() => DocumentMetadata.Default;
|
||||
|
||||
public void Compose(IDocumentContainer container)
|
||||
{
|
||||
container.Page(page =>
|
||||
{
|
||||
page.Margin(1, Unit.Centimetre);
|
||||
page.DefaultTextStyle(x => x.FontFamily("Arial").FontSize(9));
|
||||
|
||||
page.Header().Element(ComposeHeader);
|
||||
page.Content().Element(ComposeContent);
|
||||
page.Footer().AlignCenter().Text(x => { x.Span("Página "); x.CurrentPageNumber(); });
|
||||
});
|
||||
}
|
||||
|
||||
void ComposeHeader(IContainer container)
|
||||
{
|
||||
// Se envuelve todo el contenido del header en una única Columna.
|
||||
container.Column(column =>
|
||||
{
|
||||
// El primer item de la columna es la fila con los títulos.
|
||||
column.Item().Row(row =>
|
||||
{
|
||||
row.RelativeItem().Column(col =>
|
||||
{
|
||||
col.Item().Text($"Reporte de Suscripciones a Facturar").SemiBold().FontSize(14);
|
||||
col.Item().Text($"Período: {Model.Periodo}").FontSize(11);
|
||||
});
|
||||
|
||||
row.ConstantItem(150).AlignRight().Column(col => {
|
||||
col.Item().AlignRight().Text($"Fecha de Generación:");
|
||||
col.Item().AlignRight().Text(Model.FechaGeneracion);
|
||||
});
|
||||
});
|
||||
|
||||
// El segundo item de la columna es el separador.
|
||||
column.Item().PaddingTop(5).BorderBottom(1).BorderColor(Colors.Grey.Lighten2);
|
||||
});
|
||||
}
|
||||
|
||||
void ComposeContent(IContainer container)
|
||||
{
|
||||
container.PaddingTop(10).Column(column =>
|
||||
{
|
||||
column.Spacing(20);
|
||||
|
||||
foreach (var empresaData in Model.DatosPorEmpresa)
|
||||
{
|
||||
column.Item().Element(c => ComposeTablaPorEmpresa(c, empresaData));
|
||||
}
|
||||
|
||||
column.Item().AlignRight().PaddingTop(15).Text($"Total General a Facturar: {Model.TotalGeneral.ToString("C", new CultureInfo("es-AR"))}").Bold().FontSize(12);
|
||||
});
|
||||
}
|
||||
|
||||
void ComposeTablaPorEmpresa(IContainer container, DatosEmpresaViewModel empresaData)
|
||||
{
|
||||
container.Table(table =>
|
||||
{
|
||||
table.ColumnsDefinition(columns =>
|
||||
{
|
||||
columns.RelativeColumn(3); // Nombre Suscriptor
|
||||
columns.ConstantColumn(100); // Documento
|
||||
columns.ConstantColumn(100, Unit.Point); // Importe
|
||||
});
|
||||
|
||||
table.Header(header =>
|
||||
{
|
||||
header.Cell().ColumnSpan(3).Background(Colors.Grey.Lighten2)
|
||||
.Padding(5).Text(empresaData.NombreEmpresa).Bold().FontSize(12);
|
||||
|
||||
header.Cell().BorderBottom(1).BorderColor(Colors.Grey.Lighten3).Padding(2).Text("Suscriptor").SemiBold();
|
||||
header.Cell().BorderBottom(1).BorderColor(Colors.Grey.Lighten3).Padding(2).Text("Documento").SemiBold();
|
||||
header.Cell().BorderBottom(1).BorderColor(Colors.Grey.Lighten3).Padding(2).AlignRight().Text("Importe a Facturar").SemiBold();
|
||||
});
|
||||
|
||||
var facturasPorSuscriptor = empresaData.Facturas.GroupBy(f => f.NombreSuscriptor);
|
||||
|
||||
foreach (var grupoSuscriptor in facturasPorSuscriptor.OrderBy(g => g.Key))
|
||||
{
|
||||
foreach(var item in grupoSuscriptor)
|
||||
{
|
||||
table.Cell().Padding(2).Text(item.NombreSuscriptor);
|
||||
table.Cell().Padding(2).Text($"{item.TipoDocumento} {item.NroDocumento}");
|
||||
table.Cell().Padding(2).AlignRight().Text(item.ImporteFinal.ToString("C", new CultureInfo("es-AR")));
|
||||
}
|
||||
|
||||
if(grupoSuscriptor.Count() > 1)
|
||||
{
|
||||
var subtotal = grupoSuscriptor.Sum(i => i.ImporteFinal);
|
||||
table.Cell().ColumnSpan(2).AlignRight().Padding(2).Text($"Subtotal {grupoSuscriptor.Key}:").Italic();
|
||||
table.Cell().AlignRight().Padding(2).Text(subtotal.ToString("C", new CultureInfo("es-AR"))).Italic().SemiBold();
|
||||
}
|
||||
}
|
||||
|
||||
table.Cell().ColumnSpan(2).BorderTop(1).BorderColor(Colors.Grey.Darken1).AlignRight()
|
||||
.PaddingTop(5).Text("Total Empresa:").Bold();
|
||||
table.Cell().BorderTop(1).BorderColor(Colors.Grey.Darken1).AlignRight()
|
||||
.PaddingTop(5).Text(empresaData.TotalEmpresa.ToString("C", new CultureInfo("es-AR"))).Bold();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,8 @@
|
||||
using GestionIntegral.Api.Services.Reportes;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Reporting.NETCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using GestionIntegral.Api.Dtos.Reportes;
|
||||
using GestionIntegral.Api.Data.Repositories.Impresion;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using GestionIntegral.Api.Data.Repositories.Distribucion;
|
||||
using GestionIntegral.Api.Services.Distribucion;
|
||||
using GestionIntegral.Api.Services.Pdf;
|
||||
@@ -45,6 +38,7 @@ namespace GestionIntegral.Api.Controllers
|
||||
private const string PermisoVerReporteConsumoBobinas = "RR007";
|
||||
private const string PermisoVerReporteNovedadesCanillas = "RR004";
|
||||
private const string PermisoVerReporteListadoDistMensual = "RR009";
|
||||
private const string PermisoVerReporteFacturasPublicidad = "RR010";
|
||||
|
||||
public ReportesController(
|
||||
IReportesService reportesService,
|
||||
@@ -1676,5 +1670,54 @@ namespace GestionIntegral.Api.Controllers
|
||||
return StatusCode(500, "Error interno al generar el PDF del reporte.");
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("suscripciones/facturas-para-publicidad/pdf")]
|
||||
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<IActionResult> GetReporteFacturasPublicidadPdf([FromQuery] int anio, [FromQuery] int mes)
|
||||
{
|
||||
if (!TienePermiso(PermisoVerReporteFacturasPublicidad)) return Forbid();
|
||||
|
||||
var (data, error) = await _reportesService.ObtenerFacturasParaReportePublicidad(anio, mes);
|
||||
if (error != null) return BadRequest(new { message = error });
|
||||
if (data == null || !data.Any())
|
||||
{
|
||||
return NotFound(new { message = "No hay facturas pagadas y pendientes de facturar para el período seleccionado." });
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// --- INICIO DE LA LÓGICA DE AGRUPACIÓN ---
|
||||
var datosAgrupados = data
|
||||
.GroupBy(f => f.IdEmpresa)
|
||||
.Select(g => new DatosEmpresaViewModel
|
||||
{
|
||||
NombreEmpresa = g.First().NombreEmpresa,
|
||||
Facturas = g.ToList()
|
||||
})
|
||||
.OrderBy(e => e.NombreEmpresa);
|
||||
|
||||
var viewModel = new FacturasPublicidadViewModel
|
||||
{
|
||||
DatosPorEmpresa = datosAgrupados,
|
||||
Periodo = new DateTime(anio, mes, 1).ToString("MMMM yyyy", new CultureInfo("es-ES")),
|
||||
FechaGeneracion = DateTime.Now.ToString("dd/MM/yyyy HH:mm")
|
||||
};
|
||||
// --- FIN DE LA LÓGICA DE AGRUPACIÓN ---
|
||||
|
||||
var document = new FacturasPublicidadDocument(viewModel);
|
||||
byte[] pdfBytes = await _pdfGenerator.GeneratePdfAsync(document);
|
||||
string fileName = $"ReportePublicidad_Suscripciones_{anio}-{mes:D2}.pdf";
|
||||
return File(pdfBytes, "application/pdf", fileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error al generar PDF para Reporte de Facturas a Publicidad.");
|
||||
return StatusCode(500, "Error interno al generar el PDF del reporte.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,10 +34,10 @@ namespace GestionIntegral.Api.Controllers.Suscripciones
|
||||
// GET: api/suscriptores/{idSuscriptor}/ajustes
|
||||
[HttpGet("~/api/suscriptores/{idSuscriptor:int}/ajustes")]
|
||||
[ProducesResponseType(typeof(IEnumerable<AjusteDto>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetAjustesPorSuscriptor(int idSuscriptor)
|
||||
public async Task<IActionResult> GetAjustesPorSuscriptor(int idSuscriptor, [FromQuery] DateTime? fechaDesde, [FromQuery] DateTime? fechaHasta)
|
||||
{
|
||||
if (!TienePermiso(PermisoGestionarAjustes)) return Forbid();
|
||||
var ajustes = await _ajusteService.ObtenerAjustesPorSuscriptor(idSuscriptor);
|
||||
var ajustes = await _ajusteService.ObtenerAjustesPorSuscriptor(idSuscriptor, fechaDesde, fechaHasta);
|
||||
return Ok(ajustes);
|
||||
}
|
||||
|
||||
@@ -74,5 +74,21 @@ namespace GestionIntegral.Api.Controllers.Suscripciones
|
||||
|
||||
return Ok(new { message = "Ajuste anulado correctamente." });
|
||||
}
|
||||
|
||||
// PUT: api/ajustes/{id}
|
||||
[HttpPut("{id:int}")]
|
||||
public async Task<IActionResult> UpdateAjuste(int id, [FromBody] UpdateAjusteDto updateDto)
|
||||
{
|
||||
if (!TienePermiso(PermisoGestionarAjustes)) return Forbid();
|
||||
if (!ModelState.IsValid) return BadRequest(ModelState);
|
||||
|
||||
var (exito, error) = await _ajusteService.ActualizarAjuste(id, updateDto);
|
||||
if (!exito)
|
||||
{
|
||||
if (error != null && error.Contains("no encontrado")) return NotFound(new { message = error });
|
||||
return BadRequest(new { message = error });
|
||||
}
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,9 +13,8 @@ namespace GestionIntegral.Api.Controllers.Suscripciones
|
||||
{
|
||||
private readonly IFacturacionService _facturacionService;
|
||||
private readonly ILogger<FacturacionController> _logger;
|
||||
|
||||
// Permiso para generar facturación (a crear en la BD)
|
||||
private const string PermisoGenerarFacturacion = "SU006";
|
||||
private const string PermisoGestionarFacturacion = "SU006";
|
||||
private const string PermisoEnviarEmail = "SU009";
|
||||
|
||||
public FacturacionController(IFacturacionService facturacionService, ILogger<FacturacionController> logger)
|
||||
{
|
||||
@@ -28,67 +27,94 @@ namespace GestionIntegral.Api.Controllers.Suscripciones
|
||||
private int? GetCurrentUserId()
|
||||
{
|
||||
if (int.TryParse(User.FindFirstValue(ClaimTypes.NameIdentifier) ?? User.FindFirstValue("sub"), out int userId)) return userId;
|
||||
_logger.LogWarning("No se pudo obtener el UserId del token JWT en FacturacionController.");
|
||||
return null;
|
||||
}
|
||||
|
||||
// POST: api/facturacion/{anio}/{mes}
|
||||
[HttpPost("{anio:int}/{mes:int}")]
|
||||
public async Task<IActionResult> GenerarFacturacion(int anio, int mes)
|
||||
[HttpPut("{idFactura:int}/numero-factura")]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public async Task<IActionResult> UpdateNumeroFactura(int idFactura, [FromBody] string numeroFactura)
|
||||
{
|
||||
if (!TienePermiso(PermisoGenerarFacturacion)) return Forbid();
|
||||
if (!TienePermiso(PermisoGestionarFacturacion)) return Forbid();
|
||||
|
||||
var userId = GetCurrentUserId();
|
||||
if (userId == null) return Unauthorized();
|
||||
|
||||
if (anio < 2020 || mes < 1 || mes > 12)
|
||||
{
|
||||
return BadRequest(new { message = "El año y el mes proporcionados no son válidos." });
|
||||
}
|
||||
|
||||
var (exito, mensaje, facturasGeneradas) = await _facturacionService.GenerarFacturacionMensual(anio, mes, userId.Value);
|
||||
var (exito, error) = await _facturacionService.ActualizarNumeroFactura(idFactura, numeroFactura, userId.Value);
|
||||
|
||||
if (!exito)
|
||||
{
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, new { message = mensaje });
|
||||
if (error != null && error.Contains("no existe")) return NotFound(new { message = error });
|
||||
return BadRequest(new { message = error });
|
||||
}
|
||||
|
||||
return Ok(new { message = mensaje, facturasGeneradas });
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// GET: api/facturacion/{anio}/{mes}
|
||||
[HttpGet("{anio:int}/{mes:int}")]
|
||||
[ProducesResponseType(typeof(IEnumerable<FacturaDto>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
||||
public async Task<IActionResult> GetFacturas(int anio, int mes)
|
||||
// POST: api/facturacion/{idFactura}/enviar-factura-pdf
|
||||
[HttpPost("{idFactura:int}/enviar-factura-pdf")]
|
||||
public async Task<IActionResult> EnviarFacturaPdf(int idFactura)
|
||||
{
|
||||
// Usamos el permiso de generar facturación también para verlas.
|
||||
if (!TienePermiso(PermisoGenerarFacturacion)) return Forbid();
|
||||
|
||||
if (anio < 2020 || mes < 1 || mes > 12)
|
||||
{
|
||||
return BadRequest(new { message = "El período no es válido." });
|
||||
}
|
||||
|
||||
var facturas = await _facturacionService.ObtenerFacturasPorPeriodo(anio, mes);
|
||||
return Ok(facturas);
|
||||
}
|
||||
|
||||
// POST: api/facturacion/{idFactura}/enviar-email
|
||||
[HttpPost("{idFactura:int}/enviar-email")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> EnviarEmail(int idFactura)
|
||||
{
|
||||
// Usaremos un nuevo permiso para esta acción
|
||||
if (!TienePermiso("SU009")) return Forbid();
|
||||
|
||||
var (exito, error) = await _facturacionService.EnviarFacturaPorEmail(idFactura);
|
||||
var (exito, error) = await _facturacionService.EnviarFacturaPdfPorEmail(idFactura);
|
||||
|
||||
if (!exito)
|
||||
{
|
||||
return BadRequest(new { message = error });
|
||||
}
|
||||
return Ok(new { message = "Email con factura PDF enviado a la cola de procesamiento." });
|
||||
}
|
||||
|
||||
return Ok(new { message = "Email enviado a la cola de procesamiento." });
|
||||
// POST: api/facturacion/{anio}/{mes}/suscriptor/{idSuscriptor}/enviar-aviso
|
||||
[HttpPost("{anio:int}/{mes:int}/suscriptor/{idSuscriptor:int}/enviar-aviso")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> EnviarAvisoPorEmail(int anio, int mes, int idSuscriptor)
|
||||
{
|
||||
// Usamos el permiso de enviar email
|
||||
if (!TienePermiso("SU009")) return Forbid();
|
||||
|
||||
var (exito, error) = await _facturacionService.EnviarAvisoCuentaPorEmail(anio, mes, idSuscriptor);
|
||||
|
||||
if (!exito)
|
||||
{
|
||||
if (error != null && (error.Contains("no encontrada") || error.Contains("no es válido")))
|
||||
{
|
||||
return NotFound(new { message = error });
|
||||
}
|
||||
return BadRequest(new { message = error });
|
||||
}
|
||||
|
||||
return Ok(new { message = "Email consolidado para el suscriptor ha sido enviado a la cola de procesamiento." });
|
||||
}
|
||||
|
||||
// GET: api/facturacion/{anio}/{mes}
|
||||
[HttpGet("{anio:int}/{mes:int}")]
|
||||
public async Task<IActionResult> GetFacturas(
|
||||
int anio, int mes,
|
||||
[FromQuery] string? nombreSuscriptor,
|
||||
[FromQuery] string? estadoPago,
|
||||
[FromQuery] string? estadoFacturacion)
|
||||
{
|
||||
if (!TienePermiso(PermisoGestionarFacturacion)) return Forbid();
|
||||
if (anio < 2020 || mes < 1 || mes > 12) return BadRequest(new { message = "El período no es válido." });
|
||||
|
||||
var resumenes = await _facturacionService.ObtenerResumenesDeCuentaPorPeriodo(anio, mes, nombreSuscriptor, estadoPago, estadoFacturacion);
|
||||
return Ok(resumenes);
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("{anio:int}/{mes:int}")]
|
||||
public async Task<IActionResult> GenerarFacturacion(int anio, int mes)
|
||||
{
|
||||
if (!TienePermiso(PermisoGestionarFacturacion)) return Forbid();
|
||||
var userId = GetCurrentUserId();
|
||||
if (userId == null) return Unauthorized();
|
||||
if (anio < 2020 || mes < 1 || mes > 12) return BadRequest(new { message = "El año y el mes proporcionados no son válidos." });
|
||||
var (exito, mensaje, facturasGeneradas) = await _facturacionService.GenerarFacturacionMensual(anio, mes, userId.Value);
|
||||
if (!exito) return StatusCode(StatusCodes.Status500InternalServerError, new { message = mensaje });
|
||||
return Ok(new { message = mensaje, facturasGeneradas });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,15 +112,15 @@ namespace GestionIntegral.Api.Controllers.Suscripciones
|
||||
return Ok(promos);
|
||||
}
|
||||
|
||||
// POST: api/suscripciones/{idSuscripcion}/promociones/{idPromocion}
|
||||
[HttpPost("{idSuscripcion:int}/promociones/{idPromocion:int}")]
|
||||
public async Task<IActionResult> AsignarPromocion(int idSuscripcion, int idPromocion)
|
||||
// POST: api/suscripciones/{idSuscripcion}/promociones
|
||||
[HttpPost("{idSuscripcion:int}/promociones")]
|
||||
public async Task<IActionResult> AsignarPromocion(int idSuscripcion, [FromBody] AsignarPromocionDto dto)
|
||||
{
|
||||
if (!TienePermiso(PermisoGestionarSuscripciones)) return Forbid();
|
||||
var userId = GetCurrentUserId();
|
||||
if (userId == null) return Unauthorized();
|
||||
|
||||
var (exito, error) = await _suscripcionService.AsignarPromocion(idSuscripcion, idPromocion, userId.Value);
|
||||
var (exito, error) = await _suscripcionService.AsignarPromocion(idSuscripcion, dto, userId.Value);
|
||||
if (!exito) return BadRequest(new { message = error });
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user