Ya perdí el hilo de los cambios pero ahi van.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
namespace GestionIntegral.Api.Models.Contables
|
||||
{
|
||||
public class NotaCreditoDebito // Corresponde a cue_CreditosDebitos
|
||||
{
|
||||
public int IdNota { get; set; } // Id_Nota (PK, Identity)
|
||||
public string Destino { get; set; } = string.Empty; // "Distribuidores" o "Canillas"
|
||||
public int IdDestino { get; set; } // Id del distribuidor o canillita
|
||||
public string? Referencia { get; set; } // varchar(50), NULL
|
||||
public string Tipo { get; set; } = string.Empty; // "Debito" o "Credito"
|
||||
public DateTime Fecha { get; set; }
|
||||
public decimal Monto { get; set; }
|
||||
public string? Observaciones { get; set; } // varchar(250), NULL
|
||||
public int IdEmpresa { get; set; } // Empresa a la que corresponde el saldo afectado
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
namespace GestionIntegral.Api.Models.Contables
|
||||
{
|
||||
public class NotaCreditoDebitoHistorico // Corresponde a cue_CreditosDebitos_H
|
||||
{
|
||||
// No hay PK explícita en _H
|
||||
public int Id_Nota { get; set; } // Coincide con columna en _H
|
||||
public string Destino { get; set; } = string.Empty;
|
||||
public int Id_Destino { get; set; }
|
||||
public string? Referencia { get; set; }
|
||||
public string Tipo { get; set; } = string.Empty;
|
||||
public DateTime Fecha { get; set; }
|
||||
public decimal Monto { get; set; }
|
||||
public string? Observaciones { get; set; }
|
||||
public int Id_Empresa { get; set; }
|
||||
public int Id_Usuario { get; set; }
|
||||
public DateTime FechaMod { get; set; }
|
||||
public string TipoMod { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
namespace GestionIntegral.Api.Models.Contables
|
||||
{
|
||||
public class PagoDistribuidor // Corresponde a cue_PagosDistribuidor
|
||||
{
|
||||
public int IdPago { get; set; } // Id_Pago (PK, Identity)
|
||||
public int IdDistribuidor { get; set; }
|
||||
public DateTime Fecha { get; set; }
|
||||
public string TipoMovimiento { get; set; } = string.Empty; // "Recibido" o "Realizado"
|
||||
public int Recibo { get; set; } // Nro de recibo
|
||||
public decimal Monto { get; set; }
|
||||
public int IdTipoPago { get; set; } // FK a cue_dtTipopago
|
||||
public string? Detalle { get; set; }
|
||||
public int IdEmpresa { get; set; } // Empresa a la que corresponde el saldo afectado
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
namespace GestionIntegral.Api.Models.Contables
|
||||
{
|
||||
public class PagoDistribuidorHistorico // Corresponde a cue_PagosDistribuidor_H
|
||||
{
|
||||
// No hay PK explícita en _H
|
||||
public int Id_Pago { get; set; } // Coincide con columna en _H
|
||||
public int Id_Distribuidor { get; set; }
|
||||
public DateTime Fecha { get; set; }
|
||||
public string TipoMovimiento { get; set; } = string.Empty;
|
||||
public int Recibo { get; set; }
|
||||
public decimal Monto { get; set; }
|
||||
public int Id_TipoPago { get; set; }
|
||||
public string? Detalle { get; set; }
|
||||
public int Id_Empresa { get; set; }
|
||||
public int Id_Usuario { get; set; }
|
||||
public DateTime FechaMod { get; set; }
|
||||
public string TipoMod { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
namespace GestionIntegral.Api.Models.Distribucion
|
||||
{
|
||||
public class ControlDevoluciones // Corresponde a dist_dtCtrlDevoluciones
|
||||
{
|
||||
public int IdControl { get; set; } // Id_Control (PK, Identity)
|
||||
public int IdEmpresa { get; set; }
|
||||
public DateTime Fecha { get; set; }
|
||||
public int Entrada { get; set; } // Cantidad total de ejemplares que ingresaron como devolución
|
||||
public int Sobrantes { get; set; }
|
||||
public string? Detalle { get; set; }
|
||||
public int SinCargo { get; set; } // DEFAULT 0 NOT NULL
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
namespace GestionIntegral.Api.Models.Distribucion
|
||||
{
|
||||
public class ControlDevolucionesHistorico // Corresponde a dist_dtCtrlDevoluciones_H
|
||||
{
|
||||
// No hay PK explícita en _H
|
||||
public int Id_Control { get; set; } // Coincide con columna en _H
|
||||
public int Id_Empresa { get; set; }
|
||||
public DateTime Fecha { get; set; }
|
||||
public int Entrada { get; set; }
|
||||
public int Sobrantes { get; set; }
|
||||
public string? Detalle { get; set; }
|
||||
public int SinCargo { get; set; }
|
||||
public int Id_Usuario { get; set; }
|
||||
public DateTime FechaMod { get; set; }
|
||||
public string TipoMod { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
namespace GestionIntegral.Api.Models.Distribucion
|
||||
{
|
||||
public class EntradaSalidaCanilla // Corresponde a dist_EntradasSalidasCanillas
|
||||
{
|
||||
public int IdParte { get; set; }
|
||||
public int IdPublicacion { get; set; }
|
||||
public int IdCanilla { get; set; }
|
||||
public DateTime Fecha { get; set; }
|
||||
public int CantSalida { get; set; }
|
||||
public int CantEntrada { get; set; }
|
||||
public int IdPrecio { get; set; } // FK a dist_Precios
|
||||
public int IdRecargo { get; set; } // FK a dist_RecargoZona (0 si no aplica)
|
||||
public int IdPorcMon { get; set; } // FK a dist_PorcMonPagoCanilla (0 si no aplica)
|
||||
public string? Observacion { get; set; }
|
||||
public bool Liquidado { get; set; }
|
||||
public DateTime? FechaLiquidado { get; set; }
|
||||
public int? UserLiq { get; set; } // Usuario que liquidó
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Contables
|
||||
{
|
||||
public class CreateNotaDto
|
||||
{
|
||||
[Required(ErrorMessage = "El tipo de destino es obligatorio ('Distribuidores' o 'Canillas').")]
|
||||
[RegularExpression("^(Distribuidores|Canillas)$", ErrorMessage = "Destino debe ser 'Distribuidores' o 'Canillas'.")]
|
||||
public string Destino { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "El destinatario es obligatorio.")]
|
||||
[Range(1, int.MaxValue)]
|
||||
public int IdDestino { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string? Referencia { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "El tipo de nota es obligatorio ('Debito' o 'Credito').")]
|
||||
[RegularExpression("^(Debito|Credito)$", ErrorMessage = "Tipo debe ser 'Debito' o 'Credito'.")]
|
||||
public string Tipo { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public DateTime Fecha { get; set; }
|
||||
|
||||
[Required, Range(0.01, (double)decimal.MaxValue, ErrorMessage = "El monto debe ser mayor a cero.")]
|
||||
public decimal Monto { get; set; }
|
||||
|
||||
[StringLength(250)]
|
||||
public string? Observaciones { get; set; }
|
||||
|
||||
[Required]
|
||||
public int IdEmpresa { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Contables
|
||||
{
|
||||
public class CreatePagoDistribuidorDto
|
||||
{
|
||||
[Required]
|
||||
public int IdDistribuidor { get; set; }
|
||||
[Required]
|
||||
public DateTime Fecha { get; set; }
|
||||
[Required]
|
||||
[RegularExpression("^(Recibido|Realizado)$", ErrorMessage = "Tipo de movimiento debe ser 'Recibido' o 'Realizado'.")]
|
||||
public string TipoMovimiento { get; set; } = string.Empty;
|
||||
[Required, Range(1, int.MaxValue)]
|
||||
public int Recibo { get; set; } // Nro de Recibo
|
||||
[Required, Range(0.01, (double)decimal.MaxValue, ErrorMessage = "El monto debe ser mayor a cero.")]
|
||||
public decimal Monto { get; set; }
|
||||
[Required]
|
||||
public int IdTipoPago { get; set; }
|
||||
[StringLength(150)]
|
||||
public string? Detalle { get; set; }
|
||||
[Required]
|
||||
public int IdEmpresa { get; set; } // Empresa cuyo saldo se verá afectado
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace GestionIntegral.Api.Dtos.Contables
|
||||
{
|
||||
public class NotaCreditoDebitoDto
|
||||
{
|
||||
public int IdNota { get; set; }
|
||||
public string Destino { get; set; } = string.Empty; // "Distribuidores", "Canillas"
|
||||
public int IdDestino { get; set; }
|
||||
public string NombreDestinatario { get; set; } = string.Empty; // Nombre del Distribuidor o Canillita
|
||||
public string? Referencia { get; set; }
|
||||
public string Tipo { get; set; } = string.Empty; // "Debito", "Credito"
|
||||
public string Fecha { get; set; } = string.Empty; // yyyy-MM-dd
|
||||
public decimal Monto { get; set; }
|
||||
public string? Observaciones { get; set; }
|
||||
public int IdEmpresa { get; set; }
|
||||
public string NombreEmpresa { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace GestionIntegral.Api.Dtos.Contables
|
||||
{
|
||||
public class PagoDistribuidorDto
|
||||
{
|
||||
public int IdPago { get; set; }
|
||||
public int IdDistribuidor { get; set; }
|
||||
public string NombreDistribuidor { get; set; } = string.Empty;
|
||||
public string Fecha { get; set; } = string.Empty; // yyyy-MM-dd
|
||||
public string TipoMovimiento { get; set; } = string.Empty; // "Recibido" / "Realizado"
|
||||
public int Recibo { get; set; }
|
||||
public decimal Monto { get; set; }
|
||||
public int IdTipoPago { get; set; }
|
||||
public string NombreTipoPago { get; set; } = string.Empty;
|
||||
public string? Detalle { get; set; }
|
||||
public int IdEmpresa { get; set; }
|
||||
public string NombreEmpresa { get; set; } = string.Empty; // Empresa del saldo afectado
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Para las notas, la edición es limitada. Si se comete un error grave, se anula y se crea una nueva.
|
||||
// Podríamos permitir cambiar Monto y Observaciones.
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Contables
|
||||
{
|
||||
public class UpdateNotaDto
|
||||
{
|
||||
[Required, Range(0.01, (double)decimal.MaxValue, ErrorMessage = "El monto debe ser mayor a cero.")]
|
||||
public decimal Monto { get; set; }
|
||||
|
||||
[StringLength(250)]
|
||||
public string? Observaciones { get; set; }
|
||||
// No se permite cambiar Destino, IdDestino, Tipo, Fecha, Referencia, IdEmpresa de una nota existente.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// La edición de un pago puede ser delicada por la afectación de saldos.
|
||||
// Podríamos permitir cambiar Monto, TipoPago, Detalle.
|
||||
// Cambiar Fecha, Distribuidor, Empresa, TipoMovimiento, Recibo podría requerir anular y recrear.
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Contables
|
||||
{
|
||||
public class UpdatePagoDistribuidorDto
|
||||
{
|
||||
[Required, Range(0.01, (double)decimal.MaxValue, ErrorMessage = "El monto debe ser mayor a cero.")]
|
||||
public decimal Monto { get; set; }
|
||||
[Required]
|
||||
public int IdTipoPago { get; set; }
|
||||
[StringLength(150)]
|
||||
public string? Detalle { get; set; }
|
||||
// Los campos IdDistribuidor, Fecha, TipoMovimiento, Recibo, IdEmpresa no se cambian aquí.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class ControlDevolucionesDto
|
||||
{
|
||||
public int IdControl { get; set; }
|
||||
public int IdEmpresa { get; set; }
|
||||
public string NombreEmpresa { get; set; } = string.Empty;
|
||||
public string Fecha { get; set; } = string.Empty; // yyyy-MM-dd
|
||||
public int Entrada { get; set; }
|
||||
public int Sobrantes { get; set; }
|
||||
public string? Detalle { get; set; }
|
||||
public int SinCargo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class CreateBulkEntradaSalidaCanillaDto
|
||||
{
|
||||
[Required(ErrorMessage = "El ID del canillita es obligatorio.")]
|
||||
public int IdCanilla { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "La fecha del movimiento es obligatoria.")]
|
||||
public DateTime Fecha { get; set; } // Fecha común para todos los ítems
|
||||
|
||||
[Required(ErrorMessage = "Debe haber al menos un ítem de movimiento.")]
|
||||
[MinLength(1, ErrorMessage = "Debe agregar al menos una publicación.")]
|
||||
public List<EntradaSalidaCanillaItemDto> Items { get; set; } = new List<EntradaSalidaCanillaItemDto>();
|
||||
|
||||
// Validar que no haya publicaciones duplicadas en la lista de items
|
||||
[CustomValidation(typeof(CreateBulkEntradaSalidaCanillaDto), nameof(ValidateNoDuplicatePublications))]
|
||||
public string? DuplicateError { get; set; }
|
||||
|
||||
public static ValidationResult? ValidateNoDuplicatePublications(CreateBulkEntradaSalidaCanillaDto dto, ValidationContext context)
|
||||
{
|
||||
if (dto.Items != null)
|
||||
{
|
||||
var duplicatePublications = dto.Items
|
||||
.GroupBy(item => item.IdPublicacion)
|
||||
.Where(group => group.Count() > 1)
|
||||
.Select(group => group.Key)
|
||||
.ToList();
|
||||
|
||||
if (duplicatePublications.Any())
|
||||
{
|
||||
return new ValidationResult($"No puede agregar la misma publicación varias veces. Publicaciones duplicadas: {string.Join(", ", duplicatePublications)}");
|
||||
}
|
||||
}
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class CreateControlDevolucionesDto
|
||||
{
|
||||
[Required]
|
||||
public int IdEmpresa { get; set; }
|
||||
[Required]
|
||||
public DateTime Fecha { get; set; }
|
||||
[Required, Range(0, int.MaxValue)] // Entrada puede ser 0 si solo hay sobrantes/sin cargo
|
||||
public int Entrada { get; set; }
|
||||
[Required, Range(0, int.MaxValue)]
|
||||
public int Sobrantes { get; set; }
|
||||
[StringLength(250)]
|
||||
public string? Detalle { get; set; }
|
||||
[Required, Range(0, int.MaxValue)]
|
||||
public int SinCargo { get; set; } = 0; // Default 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class CreateEntradaSalidaCanillaDto
|
||||
{
|
||||
[Required]
|
||||
public int IdPublicacion { get; set; }
|
||||
[Required]
|
||||
public int IdCanilla { get; set; }
|
||||
[Required]
|
||||
public DateTime Fecha { get; set; } // Fecha del movimiento (retiro/devolución)
|
||||
[Required, Range(0, int.MaxValue)] // Puede retirar 0 si es solo para registrar devolución
|
||||
public int CantSalida { get; set; }
|
||||
[Required, Range(0, int.MaxValue)]
|
||||
public int CantEntrada { get; set; }
|
||||
[StringLength(150)]
|
||||
public string? Observacion { get; set; }
|
||||
// Liquidado, FechaLiquidado, UserLiq se manejan por una acción de "Liquidar" separada.
|
||||
// IdPrecio, IdRecargo, IdPorcMon se determinan en el backend.
|
||||
|
||||
[CustomValidation(typeof(CreateEntradaSalidaCanillaDto), nameof(ValidateCantidades))]
|
||||
public string? CantidadesError { get; set; } // Dummy para validación
|
||||
|
||||
public static ValidationResult? ValidateCantidades(CreateEntradaSalidaCanillaDto dto, ValidationContext context)
|
||||
{
|
||||
if (dto.CantEntrada > dto.CantSalida)
|
||||
{
|
||||
return new ValidationResult("La cantidad de entrada (devolución) no puede ser mayor a la cantidad de salida (retiro).");
|
||||
}
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class EntradaSalidaCanillaDto
|
||||
{
|
||||
public int IdParte { get; set; }
|
||||
public int IdPublicacion { get; set; }
|
||||
public string NombrePublicacion { get; set; } = string.Empty;
|
||||
public int IdCanilla { get; set; }
|
||||
public string NomApeCanilla { get; set; } = string.Empty;
|
||||
public bool CanillaEsAccionista { get; set; }
|
||||
public string Fecha { get; set; } = string.Empty; // yyyy-MM-dd
|
||||
public int CantSalida { get; set; }
|
||||
public int CantEntrada { get; set; }
|
||||
public int Vendidos { get; set; } // Calculado
|
||||
public string? Observacion { get; set; }
|
||||
public bool Liquidado { get; set; }
|
||||
public string? FechaLiquidado { get; set; } // yyyy-MM-dd
|
||||
public int? UserLiq { get; set; }
|
||||
public string? NombreUserLiq { get; set; } // Para mostrar en UI
|
||||
public decimal MontoARendir { get; set; } // Calculado por el backend
|
||||
public decimal PrecioUnitarioAplicado { get; set; } // Info para UI
|
||||
public decimal RecargoAplicado { get; set; } // Info para UI
|
||||
public decimal PorcentajeOMontoCanillaAplicado { get; set; } // Info para UI
|
||||
public bool EsPorcentajeCanilla { get; set; } // Info para UI
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class EntradaSalidaCanillaItemDto
|
||||
{
|
||||
[Required(ErrorMessage = "El ID de la publicación es obligatorio.")]
|
||||
public int IdPublicacion { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "La cantidad de salida es obligatoria.")]
|
||||
[Range(0, int.MaxValue, ErrorMessage = "La cantidad de salida debe ser un número positivo o cero.")]
|
||||
public int CantSalida { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "La cantidad de entrada es obligatoria.")]
|
||||
[Range(0, int.MaxValue, ErrorMessage = "La cantidad de entrada debe ser un número positivo o cero.")]
|
||||
public int CantEntrada { get; set; }
|
||||
|
||||
[StringLength(150)]
|
||||
public string? Observacion { get; set; } // Observación por línea
|
||||
|
||||
// Validar que CantEntrada no sea mayor que CantSalida
|
||||
[CustomValidation(typeof(EntradaSalidaCanillaItemDto), nameof(ValidateCantidades))]
|
||||
public string? CantidadesError { get; set; }
|
||||
|
||||
public static ValidationResult? ValidateCantidades(EntradaSalidaCanillaItemDto item, ValidationContext context)
|
||||
{
|
||||
if (item.CantEntrada > item.CantSalida)
|
||||
{
|
||||
return new ValidationResult("La cantidad de entrada (devolución) no puede ser mayor a la cantidad de salida (retiro) para esta publicación.", new[] { nameof(CantEntrada) });
|
||||
}
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class LiquidarMovimientosCanillaRequestDto // Para liquidar uno o más movimientos
|
||||
{
|
||||
[Required]
|
||||
[MinLength(1)]
|
||||
public List<int> IdsPartesALiquidar { get; set; } = new List<int>();
|
||||
[Required]
|
||||
public DateTime FechaLiquidacion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class UpdateControlDevolucionesDto
|
||||
{
|
||||
// IdEmpresa y Fecha no deberían cambiar para un registro existente. Si cambian, es un nuevo registro.
|
||||
[Required, Range(0, int.MaxValue)]
|
||||
public int Entrada { get; set; }
|
||||
[Required, Range(0, int.MaxValue)]
|
||||
public int Sobrantes { get; set; }
|
||||
[StringLength(250)]
|
||||
public string? Detalle { get; set; }
|
||||
[Required, Range(0, int.MaxValue)]
|
||||
public int SinCargo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Similar a E/S Distribuidores, la edición es limitada para no afectar cálculos complejos ya hechos.
|
||||
// Principalmente para corregir cantidades si aún no está liquidado.
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Distribucion
|
||||
{
|
||||
public class UpdateEntradaSalidaCanillaDto
|
||||
{
|
||||
[Required, Range(0, int.MaxValue)]
|
||||
public int CantSalida { get; set; }
|
||||
[Required, Range(0, int.MaxValue)]
|
||||
public int CantEntrada { get; set; }
|
||||
[StringLength(150)]
|
||||
public string? Observacion { get; set; }
|
||||
|
||||
[CustomValidation(typeof(UpdateEntradaSalidaCanillaDto), nameof(ValidateCantidades))]
|
||||
public string? CantidadesError { get; set; } // Dummy para validación
|
||||
|
||||
public static ValidationResult? ValidateCantidades(UpdateEntradaSalidaCanillaDto dto, ValidationContext context)
|
||||
{
|
||||
if (dto.CantEntrada > dto.CantSalida)
|
||||
{
|
||||
return new ValidationResult("La cantidad de entrada no puede ser mayor a la de salida.");
|
||||
}
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Backend/GestionIntegral.Api/Models/Dtos/Radios/CancionDto.cs
Normal file
18
Backend/GestionIntegral.Api/Models/Dtos/Radios/CancionDto.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class CancionDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Tema { get; set; }
|
||||
public string? CompositorAutor { get; set; }
|
||||
public string? Interprete { get; set; }
|
||||
public string? Sello { get; set; }
|
||||
public string? Placa { get; set; }
|
||||
public int? Pista { get; set; }
|
||||
public string? Introduccion { get; set; }
|
||||
public int? IdRitmo { get; set; } // Renombrado de Ritmo a IdRitmo para claridad en DTO
|
||||
public string? NombreRitmo { get; set; } // Para mostrar en UI
|
||||
public string? Formato { get; set; }
|
||||
public string? Album { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class CancionEnListaDto // Lo que se va a escribir en cada fila del Excel
|
||||
{
|
||||
public string? Tema { get; set; }
|
||||
public string? Interprete { get; set; }
|
||||
public string? CompositorAutor { get; set; }
|
||||
public string? Album { get; set; }
|
||||
public string? Sello { get; set; }
|
||||
public string? Placa { get; set; } // Nro de Catálogo / Identificador
|
||||
public int? Pista { get; set; }
|
||||
public string? Ritmo { get; set; } // Nombre del ritmo
|
||||
public string? Formato { get; set; }
|
||||
public string? Introduccion { get; set; } // Para saber duración o cues
|
||||
// Podrías añadir campos como "HoraProgramada" si la generación es por franjas
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class CreateCancionDto
|
||||
{
|
||||
[StringLength(255)]
|
||||
public string? Tema { get; set; } // Tema podría ser el campo más importante
|
||||
|
||||
[StringLength(255)]
|
||||
public string? CompositorAutor { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Interprete { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Sello { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Placa { get; set; }
|
||||
|
||||
public int? Pista { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Introduccion { get; set; }
|
||||
|
||||
public int? IdRitmo { get; set; } // FK
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Formato { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Album { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class CreateRitmoDto
|
||||
{
|
||||
[StringLength(255, ErrorMessage = "El nombre del ritmo no puede exceder los 255 caracteres.")]
|
||||
// Aunque la BD permite NULL, para crear usualmente se requeriría un nombre.
|
||||
// Si se permite crear ritmos sin nombre, quitar [Required]
|
||||
[Required(ErrorMessage = "El nombre del ritmo es obligatorio.")]
|
||||
public string NombreRitmo { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class GenerarListaRadioRequestDto
|
||||
{
|
||||
[Required(ErrorMessage = "El mes es obligatorio.")]
|
||||
[Range(1, 12, ErrorMessage = "El mes debe estar entre 1 y 12.")]
|
||||
public int Mes { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "El año es obligatorio.")]
|
||||
[Range(2000, 2999, ErrorMessage = "El año debe ser un valor válido (ej. 2024).")] // Ajusta el rango si es necesario
|
||||
public int Anio { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "La institución es obligatoria.")]
|
||||
[RegularExpression("^(AADI|SADAIC)$", ErrorMessage = "La institución debe ser 'AADI' o 'SADAIC'.")]
|
||||
public string Institucion { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "La radio es obligatoria.")]
|
||||
[RegularExpression("^(FM 99.1|FM 100.3)$", ErrorMessage = "La radio debe ser 'FM 99.1' o 'FM 100.3'.")]
|
||||
public string Radio { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class ProgramacionHorariaExcelDto
|
||||
{
|
||||
public int Dia { get; set; }
|
||||
public int Hora { get; set; }
|
||||
public string? TituloObra { get; set; } // Mapeado desde Cancion.Tema
|
||||
public string? CompositorAutor { get; set; }
|
||||
public string? Interprete { get; set; }
|
||||
public string? Sello { get; set; }
|
||||
public string? Album { get; set; }
|
||||
// No se incluyen Pista, Introducción, Formato, Placa, NombreRitmo
|
||||
// porque el Excel original de VB.NET no los tenía.
|
||||
// Si se decide mantenerlos en el futuro, se podrían añadir aquí.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class RitmoDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? NombreRitmo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class UpdateCancionDto
|
||||
{
|
||||
[StringLength(255)]
|
||||
public string? Tema { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? CompositorAutor { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Interprete { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Sello { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Placa { get; set; }
|
||||
|
||||
public int? Pista { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Introduccion { get; set; }
|
||||
|
||||
public int? IdRitmo { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Formato { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? Album { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace GestionIntegral.Api.Dtos.Radios
|
||||
{
|
||||
public class UpdateRitmoDto
|
||||
{
|
||||
[StringLength(255, ErrorMessage = "El nombre del ritmo no puede exceder los 255 caracteres.")]
|
||||
[Required(ErrorMessage = "El nombre del ritmo es obligatorio.")]
|
||||
public string NombreRitmo { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace GestionIntegral.Api.Dtos.Usuarios.Auditoria
|
||||
{
|
||||
public class UsuarioHistorialDto
|
||||
{
|
||||
public int IdHist { get; set; } // PK de la tabla gral_Usuarios_H
|
||||
public int IdUsuarioAfectado { get; set; } // IdUsuario (el usuario cuyos datos cambiaron)
|
||||
public string UserAfectado { get; set; } = string.Empty; // UserNvo (username del usuario afectado)
|
||||
|
||||
// Campos del historial
|
||||
public string? UserAnt { get; set; }
|
||||
public string UserNvo { get; set; } = string.Empty;
|
||||
public bool? HabilitadaAnt { get; set; }
|
||||
public bool HabilitadaNva { get; set; }
|
||||
public bool? SupAdminAnt { get; set; }
|
||||
public bool SupAdminNvo { get; set; }
|
||||
public string? NombreAnt { get; set; }
|
||||
public string NombreNvo { get; set; } = string.Empty;
|
||||
public string? ApellidoAnt { get; set; }
|
||||
public string ApellidoNvo { get; set; } = string.Empty;
|
||||
public int? IdPerfilAnt { get; set; }
|
||||
public int IdPerfilNvo { get; set; }
|
||||
public string? NombrePerfilAnt { get; set; } // Join con gral_Perfiles
|
||||
public string NombrePerfilNvo { get; set; } = string.Empty; // Join con gral_Perfiles
|
||||
public bool? DebeCambiarClaveAnt { get; set; }
|
||||
public bool DebeCambiarClaveNva { get; set; }
|
||||
|
||||
// Auditoría del registro de historial
|
||||
public int IdUsuarioModifico { get; set; } // Id_UsuarioMod
|
||||
public string NombreUsuarioModifico { get; set; } = string.Empty; // Nombre del usuario que hizo el cambio
|
||||
public DateTime FechaModificacion { get; set; } // FechaMod
|
||||
public string TipoModificacion { get; set; } = string.Empty; // TipoMod
|
||||
}
|
||||
}
|
||||
17
Backend/GestionIntegral.Api/Models/Radios/Cancion.cs
Normal file
17
Backend/GestionIntegral.Api/Models/Radios/Cancion.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace GestionIntegral.Api.Models.Radios
|
||||
{
|
||||
public class Cancion // Corresponde a rad_dtCanciones
|
||||
{
|
||||
public int Id { get; set; } // Id (PK, Identity)
|
||||
public string? Tema { get; set; }
|
||||
public string? CompositorAutor { get; set; }
|
||||
public string? Interprete { get; set; }
|
||||
public string? Sello { get; set; }
|
||||
public string? Placa { get; set; }
|
||||
public int? Pista { get; set; }
|
||||
public string? Introduccion { get; set; }
|
||||
public int? Ritmo { get; set; } // FK a rad_dtRitmos.Id
|
||||
public string? Formato { get; set; }
|
||||
public string? Album { get; set; }
|
||||
}
|
||||
}
|
||||
8
Backend/GestionIntegral.Api/Models/Radios/Ritmo.cs
Normal file
8
Backend/GestionIntegral.Api/Models/Radios/Ritmo.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace GestionIntegral.Api.Models.Radios
|
||||
{
|
||||
public class Ritmo // Corresponde a rad_dtRitmos
|
||||
{
|
||||
public int Id { get; set; } // Id (PK, Identity)
|
||||
public string? NombreRitmo { get; set; } // Columna "Ritmo" (nvarchar(255), NULL) - Renombrado para claridad
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user