Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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}";
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace PowderCoating.Application.DTOs.QuickBooks;
|
||||
|
||||
/// <summary>
|
||||
/// Result of an import operation from QuickBooks IIF file.
|
||||
/// </summary>
|
||||
public class ImportResultDto
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public int TotalRecords { get; set; }
|
||||
public int ImportedCount { get; set; }
|
||||
public int UpdatedCount { get; set; }
|
||||
public int SkippedCount { get; set; }
|
||||
/// <summary>
|
||||
/// Records that were intentionally not re-imported because they already exist
|
||||
/// in the destination (positive outcome — not an error or warning).
|
||||
/// Displayed to the user separately from SkippedCount to avoid confusion.
|
||||
/// </summary>
|
||||
public int AlreadyRecordedCount { get; set; }
|
||||
public List<ImportErrorDto> Errors { get; set; } = new();
|
||||
|
||||
public string Summary =>
|
||||
$"{ImportedCount} imported, {UpdatedCount} updated, {SkippedCount} skipped out of {TotalRecords} total records.";
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace PowderCoating.Application.DTOs.QuickBooks;
|
||||
|
||||
/// <summary>
|
||||
/// Result of validating an IIF file before import.
|
||||
/// </summary>
|
||||
public class ValidationResultDto
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public List<ImportErrorDto> Errors { get; set; } = new();
|
||||
}
|
||||
Reference in New Issue
Block a user