Files
PowderCoatingLogix/src/PowderCoating.Application/DTOs/QuickBooks/ImportErrorDto.cs
T
2026-04-23 21:38:24 -04:00

23 lines
792 B
C#

namespace PowderCoating.Application.DTOs.QuickBooks;
/// <summary>
/// A single entry in an import log — covers errors, warnings, and skipped records.
/// </summary>
public class ImportErrorDto
{
/// <summary>"Error", "Warning", or "Skipped"</summary>
public string Severity { get; set; } = "Error";
public int LineNumber { get; set; }
public string? RecordName { get; set; }
public string? FieldName { get; set; }
public string ErrorMessage { get; set; } = string.Empty;
public string DisplayMessage =>
$"[{Severity}]" +
(LineNumber > 0 ? $" Line {LineNumber}" : "") +
(string.IsNullOrEmpty(RecordName) ? "" : $" ({RecordName})") +
(string.IsNullOrEmpty(FieldName) ? "" : $" — {FieldName}") +
$": {ErrorMessage}";
}