Files
PowderCoatingLogix/src/PowderCoating.Application/DTOs/Import/JobImportDto.cs
T
spouliot 82fb48f7a5 Patch export/import for missing fields; add CustomerContacts export
- DataExportController + AccountDataExportController: add ProjectName to
  Jobs, Quotes, Invoices (XLSX + CSV); add LeadSource + ShipTo fields to
  Customers (XLSX + CSV); add CustomerContacts sheet/CSV (new)
- Both export views: add Customer Contacts checkbox (checked by default)
- CustomerImportDto: add LeadSource + ShipTo* fields
- JobImportDto: add ProjectName
- QuoteImportDto: add ProjectName
- InvoiceImportDto: add Project Name (dual-name alias for round-trip)
- CsvImportService: wire all new import fields to entity creation;
  also patch invoice update path for ProjectName
- Add scripts/purge_imported_data.sql (dry-run T-SQL for data cleanup)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 15:14:27 -04:00

58 lines
1.9 KiB
C#

using CsvHelper.Configuration.Attributes;
namespace PowderCoating.Application.DTOs.Import;
/// <summary>
/// DTO for importing jobs from CSV files.
/// CustomerEmail is the preferred customer lookup key; CustomerName is used as a fallback
/// when the customer has no email address on file (the importer tries email first, then name).
/// </summary>
public class JobImportDto
{
// "Job Number" = old export header (spaced); "JobNumber" = current header
[Name("JobNumber", "Job Number")]
public string? JobNumber { get; set; }
// Optional — importer falls back to CustomerName when blank
[Name("CustomerEmail")]
public string? CustomerEmail { get; set; }
// Fallback identifier when CustomerEmail is absent; matched against CompanyName
[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";
[Name("Priority")]
public string Priority { get; set; } = "Normal";
[Name("ScheduledDate")]
public DateTime? ScheduledDate { get; set; }
// "Due Date" = old export header (spaced); "DueDate" = current header
[Name("DueDate", "Due Date")]
public DateTime? DueDate { get; set; }
// "Final Price" = old export header (spaced); "FinalPrice" = current header
[Name("FinalPrice", "Final Price")]
public decimal? FinalPrice { get; set; }
[Name("CustomerPO")]
public string? CustomerPO { get; set; }
[Name("SpecialInstructions")]
public string? SpecialInstructions { get; set; }
[Name("ProjectName")]
public string? ProjectName { get; set; }
[Name("Notes")]
public string? Notes { get; set; }
}