Ya perdí el hilo de los cambios pero ahi van.

This commit is contained in:
2025-05-23 15:47:39 -03:00
parent e7e185a9cb
commit 3c1fe15b1f
141 changed files with 9764 additions and 190 deletions

View File

@@ -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; }
}
}

View File

@@ -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
}
}

View File

@@ -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;
}
}

View File

@@ -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
}
}

View File

@@ -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.
}
}

View File

@@ -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í.
}
}