Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CulinaryCommandApp/Data/AppDbContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using CulinaryCommand.Data.Entities;
using CulinaryCommand.Inventory.Entities;
using PO = CulinaryCommand.PurchaseOrder.Entities;

namespace CulinaryCommand.Data
{
Expand All @@ -24,6 +25,8 @@ public AppDbContext(DbContextOptions<AppDbContext> options)
public DbSet<ManagerLocation> ManagerLocations => Set<ManagerLocation>();
public DbSet<InventoryTransaction> InventoryTransactions => Set<InventoryTransaction>();
public DbSet<CulinaryCommand.Inventory.Entities.Unit> Units => Set<CulinaryCommand.Inventory.Entities.Unit>();
public DbSet<PO.PurchaseOrder> PurchaseOrders => Set<PO.PurchaseOrder>();
public DbSet<PO.PurchaseOrderLine> PurchaseOrderLines => Set<PO.PurchaseOrderLine>();


protected override void OnModelCreating(ModelBuilder modelBuilder)
Expand Down
31 changes: 31 additions & 0 deletions CulinaryCommandApp/Inventory/Entities/InventoryBatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Allow the same ingredient to exist with multiple expiration dates and quantities.

using CulinaryCommand.Data.Entities;

namespace CulinaryCommand.Inventory.Entities
{
public class InventoryBatch
{
public int Id { get; set; }

public int LocationId { get; set; }
public Location Location { get; set; } = default!;

public int IngredientId { get; set; }
public Ingredient Ingredient { get; set; } = default!;

public DateTime ExpirationDate { get; set; }

public decimal Quantity { get; set; }
public Unit? Unit { get; set; }

// auditing
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public string? CreatedByUserId { get; set; }

// link to Product Oder line for traceability
public int? PurchaseOrderId { get; set; }
public int? PurchaseOrderLineId { get; set; }
}

}
Loading
Loading