Init Commit

This commit is contained in:
2026-01-29 13:43:44 -03:00
commit b9aa8478db
126 changed files with 20649 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace MotoresArgentinosV2.Core.DTOs;
public class CreateAdRequestDto
{
[Required]
[Range(1, 3, ErrorMessage = "Tipo de vehículo inválido")]
[JsonPropertyName("vehicleTypeID")]
public int VehicleTypeID { get; set; }
[Required]
[JsonPropertyName("brandID")]
public int BrandID { get; set; }
[JsonPropertyName("modelID")]
public int ModelID { get; set; }
[Required]
[StringLength(100, MinimumLength = 1, ErrorMessage = "La versión debe tener entre 1 y 100 caracteres.")]
[RegularExpression(@"^[a-zA-Z0-9\s\-\.\(\),/áéíóúÁÉÍÓÚñÑ]+$", ErrorMessage = "Caracteres no permitidos en el nombre de versión.")]
[JsonPropertyName("versionName")]
public string VersionName { get; set; } = string.Empty;
[Range(1900, 2100)]
[JsonPropertyName("year")]
public int Year { get; set; }
[Range(0, 2000000)]
[JsonPropertyName("km")]
public int KM { get; set; }
[Range(0, 999999999)]
[JsonPropertyName("price")]
public decimal Price { get; set; }
[Required]
[StringLength(3, MinimumLength = 3)]
[RegularExpression(@"^(ARS|USD)$", ErrorMessage = "Moneda inválida.")]
[JsonPropertyName("currency")]
public string Currency { get; set; } = "ARS";
[StringLength(1000, ErrorMessage = "La descripción no puede superar los 1000 caracteres.")]
[RegularExpression(@"^(?!.*<script>).*$", ErrorMessage = "Contenido no permitido.")]
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
[JsonPropertyName("isFeatured")]
public bool IsFeatured { get; set; }
[StringLength(50)]
[JsonPropertyName("fuelType")]
public string? FuelType { get; set; }
[StringLength(50)]
[JsonPropertyName("color")]
public string? Color { get; set; }
[StringLength(50)]
[JsonPropertyName("segment")]
public string? Segment { get; set; }
[StringLength(100)]
[JsonPropertyName("location")]
public string? Location { get; set; }
[StringLength(50)]
[JsonPropertyName("condition")]
public string? Condition { get; set; }
[JsonPropertyName("doorCount")]
public int? DoorCount { get; set; }
[StringLength(50)]
[JsonPropertyName("transmission")]
public string? Transmission { get; set; }
[StringLength(50)]
[JsonPropertyName("steering")]
public string? Steering { get; set; }
// --- Contacto Personalizado ---
[StringLength(50)]
[RegularExpression(@"^\+?[0-9\s\-\(\)]+$", ErrorMessage = "Formato de teléfono inválido.")]
[JsonPropertyName("contactPhone")]
public string? ContactPhone { get; set; }
[StringLength(100)]
[EmailAddress(ErrorMessage = "Formato de email inválido.")]
[JsonPropertyName("contactEmail")]
public string? ContactEmail { get; set; }
[JsonPropertyName("displayContactInfo")]
public bool DisplayContactInfo { get; set; } = true;
// --- Admin Only ---
[JsonPropertyName("targetUserID")]
public int? TargetUserID { get; set; }
[StringLength(100)]
[EmailAddress(ErrorMessage = "Email de usuario fantasma inválido.")]
[JsonPropertyName("ghostUserEmail")]
public string? GhostUserEmail { get; set; }
[StringLength(100)]
[JsonPropertyName("ghostFirstName")]
public string? GhostFirstName { get; set; }
[StringLength(100)]
[JsonPropertyName("ghostLastName")]
public string? GhostLastName { get; set; }
[StringLength(50)]
[RegularExpression(@"^\+?[0-9\s\-\(\)]+$", ErrorMessage = "Teléfono de usuario fantasma inválido.")]
[JsonPropertyName("ghostUserPhone")]
public string? GhostUserPhone { get; set; }
}

View File

@@ -0,0 +1,50 @@
namespace MotoresArgentinosV2.Core.DTOs;
public class LoginRequest
{
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
}
public class MigrateRequest
{
public string Username { get; set; } = string.Empty;
public string NewPassword { get; set; } = string.Empty;
}
public class MFARequest
{
public string Username { get; set; } = string.Empty;
public string Code { get; set; } = string.Empty;
}
public class RegisterRequest
{
public string Username { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string FirstName { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
public string PhoneNumber { get; set; } = string.Empty;
}
public class VerifyEmailRequest
{
public string Token { get; set; } = string.Empty;
}
public class ResendVerificationRequest
{
public string Email { get; set; } = string.Empty;
}
public class ForgotPasswordRequest
{
public string Email { get; set; } = string.Empty;
}
public class ResetPasswordRequest
{
public string Token { get; set; } = string.Empty;
public string NewPassword { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,13 @@
namespace MotoresArgentinosV2.Core.DTOs;
public class AvisoWebDto
{
public string NombreAviso { get; set; } = string.Empty;
public DateTime? FechaInicio { get; set; }
public decimal ImporteAviso { get; set; }
public string? Estado { get; set; }
// Agrego campos extra útiles si existen (deducidos)
public int? NroOperacion { get; set; }
public string? Razon { get; set; }
}

View File

@@ -0,0 +1,66 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace MotoresArgentinosV2.Core.DTOs;
public class DatosAvisoDto
{
// --- Bytes (TinyInt en SQL) ---
[Column("ID_TIPOAVI")]
public byte IdTipoavi { get; set; }
[Column("ID_SUBRUBRO")]
public byte IdSubrubro { get; set; }
// --- Shorts (SmallInt en SQL) ---
// ESTE ERA EL CAUSANTE DEL ERROR PRINCIPAL
[Column("ID_RUBRO")]
public short IdRubro { get; set; }
// --- Ints (Int32 en SQL) ---
[Column("ID_COMBINADO")]
public int IdCombinado { get; set; }
[Column("PORCENTAJE_COMBINADO")]
public int PorcentajeCombinado { get; set; }
[Column("CANTIDAD_DIAS")]
public int CantidadDias { get; set; }
[Column("DIAS_CORRIDOS")]
public int DiasCorridos { get; set; }
[Column("PALABRAS")]
public int Palabras { get; set; }
[Column("CENTIMETROS")]
public int Centimetros { get; set; }
[Column("COLUMNAS")]
public int Columnas { get; set; }
[Column("TOTAL_AVISOS")]
public int TotalAvisos { get; set; }
[Column("DESTACADO")]
public int Destacado { get; set; }
[Column("PAQUETE")]
public int Paquete { get; set; }
// --- Decimales ---
[Column("IMPORTE_SINIVA")]
public decimal ImporteSiniva { get; set; }
[Column("IMPORTE_TOTSINIVA")]
public decimal ImporteTotsiniva { get; set; }
// --- Strings ---
[Column("NOMAVI")]
public string Nomavi { get; set; } = string.Empty;
[Column("TEXTOAVI")]
public string Textoavi { get; set; } = string.Empty;
[Column("DESCRIPCION")]
public string Descripcion { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,70 @@
namespace MotoresArgentinosV2.Core.DTOs;
/// <summary>
/// DTO para insertar un aviso mediante el SP spInsertaAvisos
/// </summary>
public class InsertarAvisoDto
{
// Datos básicos
public string Tipo { get; set; } = string.Empty;
public int NroOperacion { get; set; }
public int IdCliente { get; set; }
public int Tipodoc { get; set; }
public string NroDoc { get; set; } = string.Empty;
public string Razon { get; set; } = string.Empty;
// Ubicación del cliente
public string Calle { get; set; } = string.Empty;
public string Numero { get; set; } = string.Empty;
public string Localidad { get; set; } = string.Empty;
public string CodigoPostal { get; set; } = string.Empty;
// Contacto
public string Telefono { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
// Impuestos
public byte IdTipoiva { get; set; }
public decimal PorcentajeIva1 { get; set; }
public decimal PorcentajeIva2 { get; set; }
public decimal PorcentajePercepcion { get; set; }
// Datos del aviso
public byte IdTipoaviso { get; set; }
public string Nombreaviso { get; set; } = string.Empty;
public short IdRubro { get; set; }
public byte IdSubrubro { get; set; }
public byte IdCombinado { get; set; }
public decimal PorcentajeCombinado { get; set; }
// Publicación
public DateTime FechaInicio { get; set; }
public byte CantDias { get; set; }
public bool DiasCorridos { get; set; }
public byte Palabras { get; set; }
public decimal Centimetros { get; set; }
public byte Columnas { get; set; }
// Pago
public byte IdTarjeta { get; set; }
public string NroTarjeta { get; set; } = string.Empty;
public int CvcTarjeta { get; set; }
public DateTime Vencimiento { get; set; }
// Dirección de envío (si aplica)
public string CalleEnvio { get; set; } = string.Empty;
public string NumeroEnvio { get; set; } = string.Empty;
public string LocalidadEnvio { get; set; } = string.Empty;
// Importes
public decimal Tarifa { get; set; }
public decimal ImporteAviso { get; set; }
public decimal ImporteIva1 { get; set; }
public decimal ImporteIva2 { get; set; }
public decimal ImportePercepcion { get; set; }
// Extras
public int Cantavi { get; set; } = 1;
public int Paquete { get; set; } = 0;
public bool Destacado { get; set; } = false;
}

View File

@@ -0,0 +1,38 @@
using System.ComponentModel.DataAnnotations;
namespace MotoresArgentinosV2.Core.DTOs;
public class CreatePaymentRequestDto
{
[Required]
public int AdId { get; set; } // ID del aviso que se está pagando
[Required]
public string Token { get; set; } = string.Empty; // Token de la tarjeta generado en el front
[Required]
public string PaymentMethodId { get; set; } = string.Empty; // ej: "visa", "master"
[Required]
public int Installments { get; set; } // Cuotas
[Required]
public string IssuerId { get; set; } = string.Empty; // Banco emisor
[Required]
public decimal TransactionAmount { get; set; }
[Required]
[EmailAddress]
public string PayerEmail { get; set; } = string.Empty;
public string? Description { get; set; }
}
public class PaymentResponseDto
{
public long PaymentId { get; set; }
public string Status { get; set; } = string.Empty; // approved, rejected, in_process
public string StatusDetail { get; set; } = string.Empty;
public string OperationCode { get; set; } = string.Empty; // Nuestro ID interno (M2-...)
}

View File

@@ -0,0 +1,32 @@
namespace MotoresArgentinosV2.Core.DTOs;
public class UserDetailDto
{
public int UserID { get; set; }
public string UserName { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? PhoneNumber { get; set; }
public byte UserType { get; set; }
public bool IsBlocked { get; set; }
public byte MigrationStatus { get; set; }
public bool IsEmailVerified { get; set; }
public DateTime CreatedAt { get; set; }
}
public class UserUpdateDto
{
public string UserName { get; set; } = string.Empty;
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? PhoneNumber { get; set; }
public byte UserType { get; set; }
}
public class ProfileUpdateDto
{
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? PhoneNumber { get; set; }
}

View File

@@ -0,0 +1,41 @@
namespace MotoresArgentinosV2.Core.DTOs;
public class UsuarioLegacyDto
{
// Mapeo tentativo basado en convenciones v_particulares
public int Part_Id { get; set; }
public string Part_Usu_Nombre { get; set; } = string.Empty;
public string? Part_Nombre { get; set; } // O razon social
public string? Part_Apellido { get; set; }
public string? Part_Email { get; set; }
public string? Part_Telefono { get; set; }
// Dirección
public string? Part_Calle { get; set; }
public string? Part_Nro { get; set; }
public string? Part_Localidad { get; set; }
public string? Part_CP { get; set; }
// Fiscal
public int? Part_TipoDoc { get; set; }
public string? Part_NroDoc { get; set; }
public int? Part_IdIVA { get; set; }
}
public class AgenciaLegacyDto
{
// Mapeo tentativo basado en convenciones v_agencias
public int Agen_Id { get; set; }
public string Agen_usuario { get; set; } = string.Empty;
public string? Agen_Nombre { get; set; } // Razon social
public string? Agen_Email { get; set; }
public string? Agen_Telefono { get; set; }
// Dirección
public string? Agen_Domicilio { get; set; }
public string? Agen_Localidad { get; set; }
// Fiscal
public string? Agen_Cuit { get; set; }
public int? Agen_IdIVA { get; set; }
}