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 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,11 @@ public class JobImportDto
|
|||||||
[Name("CustomerName")]
|
[Name("CustomerName")]
|
||||||
public string? CustomerName { get; set; }
|
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")]
|
[Name("Status")]
|
||||||
public string Status { get; set; } = "Pending";
|
public string Status { get; set; } = "Pending";
|
||||||
|
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ public class CsvImportService : ICsvImportService
|
|||||||
JobNumber = "JOB-2601-0001",
|
JobNumber = "JOB-2601-0001",
|
||||||
CustomerEmail = "customer@example.com",
|
CustomerEmail = "customer@example.com",
|
||||||
CustomerName = "Acme Corp (used if email is blank or not found)",
|
CustomerName = "Acme Corp (used if email is blank or not found)",
|
||||||
|
Description = "Sample job description",
|
||||||
Status = "Pending",
|
Status = "Pending",
|
||||||
Priority = "Normal",
|
Priority = "Normal",
|
||||||
ScheduledDate = DateTime.Today.AddDays(7),
|
ScheduledDate = DateTime.Today.AddDays(7),
|
||||||
@@ -269,7 +270,7 @@ public class CsvImportService : ICsvImportService
|
|||||||
FinalPrice = 750.00m,
|
FinalPrice = 750.00m,
|
||||||
CustomerPO = "PO-12345",
|
CustomerPO = "PO-12345",
|
||||||
SpecialInstructions = "Handle with care",
|
SpecialInstructions = "Handle with care",
|
||||||
Notes = "Sample job"
|
Notes = "Internal notes"
|
||||||
});
|
});
|
||||||
csv.NextRecord();
|
csv.NextRecord();
|
||||||
|
|
||||||
@@ -1435,7 +1436,9 @@ public class CsvImportService : ICsvImportService
|
|||||||
CustomerPO = record.CustomerPO?.Trim(),
|
CustomerPO = record.CustomerPO?.Trim(),
|
||||||
SpecialInstructions = record.SpecialInstructions?.Trim(),
|
SpecialInstructions = record.SpecialInstructions?.Trim(),
|
||||||
InternalNotes = record.Notes?.Trim(),
|
InternalNotes = record.Notes?.Trim(),
|
||||||
Description = record.SpecialInstructions?.Trim() ?? "Imported job",
|
Description = record.Description?.Trim()
|
||||||
|
?? record.SpecialInstructions?.Trim()
|
||||||
|
?? "Imported job",
|
||||||
CreatedAt = DateTime.UtcNow,
|
CreatedAt = DateTime.UtcNow,
|
||||||
UpdatedAt = DateTime.UtcNow
|
UpdatedAt = DateTime.UtcNow
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user