Initial commit

This commit is contained in:
2026-04-23 21:38:24 -04:00
commit 63e12a9636
1762 changed files with 1672620 additions and 0 deletions
@@ -0,0 +1,30 @@
namespace PowderCoating.Core.Entities;
/// <summary>
/// Records actual powder consumption against a specific coat on a job.
/// Links the InventoryTransaction (the deduction) to the JobItemCoat (what the powder was used on).
/// This is the bridge that enables prediction vs actual reporting per powder SKU.
/// </summary>
public class PowderUsageLog : BaseEntity
{
public int JobId { get; set; }
public int JobItemId { get; set; }
public int JobItemCoatId { get; set; }
public int? InventoryItemId { get; set; } // null for custom/vendor powder
public int? InventoryTransactionId { get; set; } // FK to the inventory deduction (if auto-linked)
public decimal ActualLbsUsed { get; set; }
public decimal EstimatedLbs { get; set; } // Snapshot of PowderToOrder at time of recording
public decimal VarianceLbs { get; set; } // ActualLbsUsed - EstimatedLbs (positive = used more than estimated)
public string RecordedByUserId { get; set; } = string.Empty;
public DateTime RecordedAt { get; set; } = DateTime.UtcNow;
public string? Notes { get; set; }
// Navigation
public virtual Job Job { get; set; } = null!;
public virtual JobItem JobItem { get; set; } = null!;
public virtual JobItemCoat JobItemCoat { get; set; } = null!;
public virtual InventoryItem? InventoryItem { get; set; }
public virtual InventoryTransaction? InventoryTransaction { get; set; }
}