Init Commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using MotoresArgentinosV2.Core.DTOs;
|
||||
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public interface IAdSyncService
|
||||
{
|
||||
Task<bool> SyncAdToLegacyAsync(int adId);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using MotoresArgentinosV2.Core.DTOs;
|
||||
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Interfaz para servicios que interactúan con stored procedures legacy
|
||||
/// relacionados con avisos
|
||||
/// </summary>
|
||||
public interface IAvisosLegacyService
|
||||
{
|
||||
/// <summary>
|
||||
/// Ejecuta el SP spDatosAvisos para obtener tarifas y configuración
|
||||
/// </summary>
|
||||
/// <param name="tarea">Tipo de tarea (EMOTORES, EREPUESTOS, EAUTOS, etc.)</param>
|
||||
/// <param name="paquete">ID del paquete (opcional)</param>
|
||||
/// <returns>Lista de configuraciones de avisos disponibles</returns>
|
||||
Task<List<DatosAvisoDto>> ObtenerDatosAvisosAsync(string tarea, int paquete = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Ejecuta el SP spInsertaAvisos para crear un nuevo aviso
|
||||
/// </summary>
|
||||
/// <param name="aviso">Datos del aviso a crear</param>
|
||||
/// <returns>True si se insertó correctamente</returns>
|
||||
Task<bool> InsertarAvisoAsync(InsertarAvisoDto aviso);
|
||||
|
||||
Task<List<DatosAvisoDto>> ObtenerTarifasAsync(string formulario, int paquete);
|
||||
Task<List<AvisoWebDto>> ObtenerAvisosPorClienteAsync(string nroDocumento);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public interface IEmailService
|
||||
{
|
||||
Task SendEmailAsync(string to, string subject, string htmlBody);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using MotoresArgentinosV2.Core.DTOs;
|
||||
using MotoresArgentinosV2.Core.Entities;
|
||||
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public interface IIdentityService
|
||||
{
|
||||
Task<(User? User, string? MigrationMessage)> AuthenticateAsync(string username, string password);
|
||||
|
||||
Task<bool> MigratePasswordAsync(string username, string newPassword);
|
||||
|
||||
// métodos para registro
|
||||
Task<(bool Success, string Message)> RegisterUserAsync(RegisterRequest request);
|
||||
Task<(bool Success, string Message)> VerifyEmailAsync(string token);
|
||||
Task<(bool Success, string Message)> ResendVerificationEmailAsync(string email);
|
||||
Task<(bool Success, string Message)> ForgotPasswordAsync(string email);
|
||||
Task<(bool Success, string Message)> ResetPasswordAsync(string token, string newPassword);
|
||||
Task<(bool Success, string Message)> ChangePasswordAsync(int userId, string current, string newPwd);
|
||||
Task<User> CreateGhostUserAsync(string email, string firstName, string lastName, string phone);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public record AdPriceResult(decimal BasePrice, decimal Tax, decimal TotalPrice, string Currency);
|
||||
|
||||
public interface ILegacyPaymentService
|
||||
{
|
||||
/// <summary>
|
||||
/// Consulta el precio en el sistema legacy (SPDATOSAVISOS)
|
||||
/// </summary>
|
||||
Task<AdPriceResult> GetAdPriceAsync(string category, bool isFeatured);
|
||||
|
||||
/// <summary>
|
||||
/// Finaliza la operación tras el pago (Simula callback de Decidir y ejecuta spInsertaAvisos)
|
||||
/// </summary>
|
||||
Task<bool> ProcessPaymentResponseAsync(string operationCode, string status, string providerData);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public interface INotificationService
|
||||
{
|
||||
Task SendChatNotificationEmailAsync(string toEmail, string fromUser, string message, int adId);
|
||||
Task SendAdStatusChangedEmailAsync(string toEmail, string adTitle, string status, string? reason = null);
|
||||
Task SendSecurityAlertEmailAsync(string toEmail, string actionDescription);
|
||||
Task SendExpirationWarningEmailAsync(string toEmail, string userName, string adTitle, DateTime expirationDate);
|
||||
Task SendAdExpiredEmailAsync(string toEmail, string userName, string adTitle);
|
||||
Task SendWeeklyPerformanceEmailAsync(string toEmail, string userName, string adTitle, int views, int favorites);
|
||||
Task SendPaymentReminderEmailAsync(string toEmail, string userName, string adTitle, string link);
|
||||
Task SendPaymentReceiptEmailAsync(string toEmail, string userName, string adTitle, decimal amount, string operationCode);
|
||||
Task SendUnreadMessagesReminderEmailAsync(string toEmail, string userName, int unreadCount);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using MotoresArgentinosV2.Core.Entities;
|
||||
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Interfaz para servicios que interactúan con stored procedures legacy
|
||||
/// relacionados con operaciones de pago
|
||||
/// </summary>
|
||||
public interface IOperacionesLegacyService
|
||||
{
|
||||
/// <summary>
|
||||
/// Ejecuta el SP sp_inserta_operaciones para registrar una nueva operación
|
||||
/// </summary>
|
||||
/// <param name="operacion">Datos de la operación a registrar</param>
|
||||
/// <returns>True si se insertó correctamente</returns>
|
||||
Task<bool> InsertarOperacionAsync(Operacion operacion);
|
||||
|
||||
/// <summary>
|
||||
/// Obtiene operaciones por número de operación
|
||||
/// </summary>
|
||||
/// <param name="noperacion">Número de operación a buscar</param>
|
||||
/// <returns>Lista de operaciones encontradas</returns>
|
||||
Task<List<Operacion>> ObtenerOperacionesPorNumeroAsync(string noperacion);
|
||||
|
||||
/// <summary>
|
||||
/// Obtiene operaciones en un rango de fechas
|
||||
/// </summary>
|
||||
/// <param name="fechaInicio">Fecha inicial</param>
|
||||
/// <param name="fechaFin">Fecha final</param>
|
||||
/// <returns>Lista de operaciones en el rango</returns>
|
||||
Task<List<Operacion>> ObtenerOperacionesPorFechasAsync(DateTime fechaInicio, DateTime fechaFin);
|
||||
|
||||
/// <summary>
|
||||
/// Obtiene todos los medios de pago disponibles
|
||||
/// </summary>
|
||||
/// <returns>Lista de medios de pago</returns>
|
||||
Task<List<MedioDePago>> ObtenerMediosDePagoAsync();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public interface IPasswordService
|
||||
{
|
||||
string HashPassword(string password);
|
||||
bool VerifyPassword(string password, string hash, string? salt, bool isLegacy);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MotoresArgentinosV2.Core.DTOs;
|
||||
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public interface IPaymentService
|
||||
{
|
||||
Task<PaymentResponseDto> ProcessPaymentAsync(CreatePaymentRequestDto request, int userId);
|
||||
Task ProcessWebhookAsync(string topic, string id);
|
||||
Task<PaymentResponseDto> CheckPaymentStatusAsync(int adId);
|
||||
}
|
||||
15
Backend/MotoresArgentinosV2.Core/Interfaces/ITokenService.cs
Normal file
15
Backend/MotoresArgentinosV2.Core/Interfaces/ITokenService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using MotoresArgentinosV2.Core.Entities;
|
||||
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public interface ITokenService
|
||||
{
|
||||
string GenerateJwtToken(User user);
|
||||
RefreshToken GenerateRefreshToken(string ipAddress);
|
||||
string GenerateMFACode(); // Legacy email code
|
||||
|
||||
// TOTP (Google Authenticator)
|
||||
string GenerateBase32Secret();
|
||||
string GetQrCodeUri(string userEmail, string secret);
|
||||
bool ValidateTOTP(string secret, string code);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using MotoresArgentinosV2.Core.DTOs;
|
||||
|
||||
namespace MotoresArgentinosV2.Core.Interfaces;
|
||||
|
||||
public interface IUsuariosLegacyService
|
||||
{
|
||||
Task<UsuarioLegacyDto?> ObtenerParticularPorUsuarioAsync(string nombreUsuario);
|
||||
Task<AgenciaLegacyDto?> ObtenerAgenciaPorUsuarioAsync(string nombreUsuario);
|
||||
}
|
||||
Reference in New Issue
Block a user