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>
This commit is contained in:
@@ -234,6 +234,8 @@ public class ApplicationDbContext : DbContext
|
||||
entity.Property(e => e.Customer).HasMaxLength(100);
|
||||
entity.Property(e => e.CreatedAt).HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
entity.Property(e => e.OptimizationResultJson).HasColumnType("nvarchar(max)");
|
||||
|
||||
entity.HasIndex(e => e.JobNumber).IsUnique();
|
||||
|
||||
entity.HasOne(e => e.CuttingTool)
|
||||
|
||||
@@ -11,6 +11,8 @@ public class Job
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user