diff --git a/Backend/MotoresArgentinosV2.API/Controllers/AdsV2Controller.cs b/Backend/MotoresArgentinosV2.API/Controllers/AdsV2Controller.cs index e98f936..fa7ac2a 100644 --- a/Backend/MotoresArgentinosV2.API/Controllers/AdsV2Controller.cs +++ b/Backend/MotoresArgentinosV2.API/Controllers/AdsV2Controller.cs @@ -829,6 +829,10 @@ public class AdsV2Controller : ControllerBase { ad.DeletedAt = DateTime.UtcNow; } + else + { + ad.DeletedAt = null; + } // 📝 AUDITORÍA var statusBrandName = (await _context.Brands.FindAsync(ad.BrandID))?.Name ?? ""; @@ -838,7 +842,7 @@ public class AdsV2Controller : ControllerBase Entity = "Ad", EntityID = ad.AdID, UserID = userId, - Details = $"Estado de aviso ({statusBrandName} {ad.VersionName}) cambiado de {oldStatus} a {newStatus}." + Details = $"Estado de aviso ({statusBrandName} {ad.VersionName}) cambiado de {AdStatusHelper.GetStatusDisplayName(oldStatus)} a {AdStatusHelper.GetStatusDisplayName(newStatus)}." }); await _context.SaveChangesAsync(); diff --git a/Backend/MotoresArgentinosV2.Core/Entities/AppEntities.cs b/Backend/MotoresArgentinosV2.Core/Entities/AppEntities.cs index f0e9c1e..e42f3ba 100644 --- a/Backend/MotoresArgentinosV2.Core/Entities/AppEntities.cs +++ b/Backend/MotoresArgentinosV2.Core/Entities/AppEntities.cs @@ -35,6 +35,27 @@ public enum AdStatusEnum Reserved = 10 } +public static class AdStatusHelper +{ + public static string GetStatusDisplayName(int statusId) + { + return statusId switch + { + 1 => "Borrador", + 2 => "Pago Pendiente", + 3 => "En Revisión", + 4 => "Activo", + 5 => "Rechazado", + 6 => "Pausado", + 7 => "Vendido", + 8 => "Vencido", + 9 => "Eliminado", + 10 => "Reservado", + _ => "Desconocido" + }; + } +} + public class User { public int UserID { get; set; }