Feat: Selector de Contacto Independiente y Formato de Precio

- Se divide la selección de medios de contacto entre los datos del usuario, permitiendo mostras el tipo de contacto que prefiera.
- Cuando el precio es igual a 0, se muestra la palabra "Consultar" en lugar de $0 o ARS 0.
This commit is contained in:
2026-02-19 19:47:13 -03:00
parent 2dfd5f1fb8
commit 042cd8c6f1
9 changed files with 1374 additions and 486 deletions

View File

@@ -326,6 +326,9 @@ public class AdsV2Controller : ControllerBase
contactPhone = ad.ContactPhone,
contactEmail = ad.ContactEmail,
displayContactInfo = ad.DisplayContactInfo,
showPhone = ad.ShowPhone,
allowWhatsApp = ad.AllowWhatsApp,
showEmail = ad.ShowEmail,
photos = ad.Photos.Select(p => new { p.PhotoID, p.FilePath, p.IsCover, p.SortOrder }),
features = ad.Features.Select(f => new { f.FeatureKey, f.FeatureValue }),
brand = ad.Brand != null ? new { id = ad.Brand.BrandID, name = ad.Brand.Name } : null,
@@ -432,6 +435,9 @@ public class AdsV2Controller : ControllerBase
ContactPhone = request.ContactPhone,
ContactEmail = request.ContactEmail,
DisplayContactInfo = request.DisplayContactInfo,
ShowPhone = request.ShowPhone,
AllowWhatsApp = request.AllowWhatsApp,
ShowEmail = request.ShowEmail,
CreatedAt = DateTime.UtcNow
};
@@ -655,6 +661,9 @@ public class AdsV2Controller : ControllerBase
ad.ContactPhone = updatedAdDto.ContactPhone;
ad.ContactEmail = updatedAdDto.ContactEmail;
ad.DisplayContactInfo = updatedAdDto.DisplayContactInfo;
ad.ShowPhone = updatedAdDto.ShowPhone;
ad.AllowWhatsApp = updatedAdDto.AllowWhatsApp;
ad.ShowEmail = updatedAdDto.ShowEmail;
// Nota: IsFeatured y otros campos sensibles se manejan por separado (pago/admin)
// LÓGICA DE ESTADO TRAS RECHAZO

View File

@@ -95,6 +95,15 @@ public class CreateAdRequestDto
[JsonPropertyName("displayContactInfo")]
public bool DisplayContactInfo { get; set; } = true;
[JsonPropertyName("showPhone")]
public bool ShowPhone { get; set; } = true;
[JsonPropertyName("allowWhatsApp")]
public bool AllowWhatsApp { get; set; } = true;
[JsonPropertyName("showEmail")]
public bool ShowEmail { get; set; } = true;
// --- Admin Only ---
[JsonPropertyName("targetUserID")]

View File

@@ -125,6 +125,11 @@ public class Ad
public string? ContactPhone { get; set; }
public string? ContactEmail { get; set; }
public bool DisplayContactInfo { get; set; } = true;
public bool ShowPhone { get; set; } = true;
public bool AllowWhatsApp { get; set; } = true;
public bool ShowEmail { get; set; } = true;
public bool IsFeatured { get; set; }
public int StatusID { get; set; }