Files
CutList/CutList.Web/Data/Entities/Job.cs
AJ Isaacs c5f366a3ef feat: Add optimization result persistence to Job entity
Add OptimizationResultJson and OptimizedAt columns to Job table.
JobService now saves/clears optimization results and auto-clears
stale results when parts, stock, or cutting tool change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 22:12:38 -05:00

25 lines
923 B
C#

namespace CutList.Web.Data.Entities;
public class Job
{
public int Id { get; set; }
public string JobNumber { get; set; } = string.Empty;
public string? Name { get; set; }
public string? Customer { get; set; }
public int? CuttingToolId { get; set; }
public string? Notes { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime? UpdatedAt { get; set; }
public DateTime? LockedAt { get; set; }
public string? OptimizationResultJson { get; set; }
public DateTime? OptimizedAt { get; set; }
public bool IsLocked => LockedAt.HasValue;
public CuttingTool? CuttingTool { get; set; }
public ICollection<JobPart> Parts { get; set; } = new List<JobPart>();
public ICollection<JobStock> Stock { get; set; } = new List<JobStock>();
public string DisplayName => string.IsNullOrWhiteSpace(Name) ? JobNumber : $"{JobNumber} - {Name}";
}