// src/SIGCM.Application/DTOs/ListingDtos.cs
namespace SIGCM.Application.DTOs;

public class CreateListingDto
{
    public int CategoryId { get; set; }
    public int OperationId { get; set; }
    public string Title { get; set; } = string.Empty;
    public string? Description { get; set; }
    public decimal Price { get; set; }
    public decimal AdFee { get; set; }
    public string Status { get; set; } = "Draft";
    public string Currency { get; set; } = "ARS";
    public int? UserId { get; set; }
    public int? ClientId { get; set; }
    public string? ClientName { get; set; }
    public string? ClientDni { get; set; }
    public string Origin { get; set; } = "Mostrador";
    public List<string>? ImagesToClone { get; set; }

    // Impresión
    public string? PrintText { get; set; }
    public DateTime? PrintStartDate { get; set; }
    public int PrintDaysCount { get; set; }
    public bool IsBold { get; set; }
    public bool IsFrame { get; set; }
    public string PrintFontSize { get; set; } = "normal";
    public string PrintAlignment { get; set; } = "left";

    // Public Web Features
    public DateTime? PublicationStartDate { get; set; }
    public bool IsFeatured { get; set; }
    public bool AllowContact { get; set; } = true;
    public string? CouponCode { get; set; }

    // Atributos Dinámicos
    public Dictionary<int, string> Attributes { get; set; } = new();

    // Pagos
    public List<PaymentDto>? Payments { get; set; }
}

public class ListingDto : CreateListingDto
{
    public int Id { get; set; }
    public DateTime CreatedAt { get; set; }
}

public class ListingDetailDto : ListingDto
{
    public IEnumerable<ListingAttributeDto> AttributeValues { get; set; } = new List<ListingAttributeDto>();
    public IEnumerable<ListingImageDto> Images { get; set; } = new List<ListingImageDto>();
}

public class ListingAttributeDto
{
    public int ListingId { get; set; }
    public int AttributeDefinitionId { get; set; }
    public string AttributeName { get; set; } = string.Empty;
    public string Value { get; set; } = string.Empty;
}

public class ListingImageDto
{
    public int Id { get; set; }
    public string Url { get; set; } = string.Empty;
    public bool IsMainInfo { get; set; }
    public int DisplayOrder { get; set; }
}

public class PaymentDto
{
    public decimal Amount { get; set; }
    public string PaymentMethod { get; set; } = string.Empty;
    public string? CardPlan { get; set; }
    public decimal Surcharge { get; set; }
}
