Add PurchaseItem entity with status tracking (Pending/Ordered/Received), supplier and job relationships. Add LockedAt timestamp to Job entity for controlling editability after materials are ordered. Includes PurchaseItemService (CRUD + bulk create), JobService Lock/Unlock methods, EF Core migrations, and DI registration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
820 B
C#
23 lines
820 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 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}";
|
|
}
|