namespace PowderCoating.Application.DTOs.Quote;

public class QuotePhotoDto
{
    public int Id { get; set; }
    public int? QuoteId { get; set; }
    public string TempId { get; set; } = string.Empty;
    public string FilePath { get; set; } = string.Empty;
    public string FileName { get; set; } = string.Empty;
    public long FileSize { get; set; }
    public string ContentType { get; set; } = string.Empty;
    public string? Caption { get; set; }
    public bool IsAiAnalysisPhoto { get; set; }
    public string? UploadedById { get; set; }
    public string? UploadedByName { get; set; }
    public DateTime UploadedDate { get; set; }
    public string FileSizeDisplay => FormatFileSize(FileSize);
    private static string FormatFileSize(long bytes)
    {
        string[] sizes = { "B", "KB", "MB", "GB" };
        double len = bytes;
        int order = 0;
        while (len >= 1024 && order < sizes.Length - 1) { order++; len /= 1024; }
        return $"{len:0.##} {sizes[order]}";
    }
}
