From 91a176ce5c1827ac4e2ee5fb8a0f59b9be26f16f Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Mon, 25 May 2026 23:41:58 -0400 Subject: [PATCH] Add Description field to job CSV import template JobImportDto was missing Description despite Job entity having the field. Downloadable template now includes a Description column; the importer maps it directly to Job.Description with a fallback chain of Description -> SpecialInstructions -> "Imported job". Co-Authored-By: Claude Sonnet 4.6 --- src/PowderCoating.Application/DTOs/Import/JobImportDto.cs | 5 +++++ .../Services/CsvImportService.cs | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/PowderCoating.Application/DTOs/Import/JobImportDto.cs b/src/PowderCoating.Application/DTOs/Import/JobImportDto.cs index b35e053..d134dad 100644 --- a/src/PowderCoating.Application/DTOs/Import/JobImportDto.cs +++ b/src/PowderCoating.Application/DTOs/Import/JobImportDto.cs @@ -21,6 +21,11 @@ public class JobImportDto [Name("CustomerName")] public string? CustomerName { get; set; } + // Optional short label for the job (maps directly to Job.Description). + // When blank, the system falls back to SpecialInstructions, then "Imported job". + [Name("Description")] + public string? Description { get; set; } + [Name("Status")] public string Status { get; set; } = "Pending"; diff --git a/src/PowderCoating.Infrastructure/Services/CsvImportService.cs b/src/PowderCoating.Infrastructure/Services/CsvImportService.cs index 7b8bde7..7320048 100644 --- a/src/PowderCoating.Infrastructure/Services/CsvImportService.cs +++ b/src/PowderCoating.Infrastructure/Services/CsvImportService.cs @@ -262,6 +262,7 @@ public class CsvImportService : ICsvImportService JobNumber = "JOB-2601-0001", CustomerEmail = "customer@example.com", CustomerName = "Acme Corp (used if email is blank or not found)", + Description = "Sample job description", Status = "Pending", Priority = "Normal", ScheduledDate = DateTime.Today.AddDays(7), @@ -269,7 +270,7 @@ public class CsvImportService : ICsvImportService FinalPrice = 750.00m, CustomerPO = "PO-12345", SpecialInstructions = "Handle with care", - Notes = "Sample job" + Notes = "Internal notes" }); csv.NextRecord(); @@ -1435,7 +1436,9 @@ public class CsvImportService : ICsvImportService CustomerPO = record.CustomerPO?.Trim(), SpecialInstructions = record.SpecialInstructions?.Trim(), InternalNotes = record.Notes?.Trim(), - Description = record.SpecialInstructions?.Trim() ?? "Imported job", + Description = record.Description?.Trim() + ?? record.SpecialInstructions?.Trim() + ?? "Imported job", CreatedAt = DateTime.UtcNow, UpdatedAt = DateTime.UtcNow };