Add product catalog with per-store section memory
Introduces a global Products catalog plus per-family overrides and private FamilyProducts, exposed via /api/products with a merged search. Shopping list items and recipe ingredients gain optional ProductId/FamilyProductId links, and a new ProductStoreSection table remembers which section a product was last placed in at a given store so future adds auto-assign the right section. Frontend gets a reusable ProductTypeahead component, wired into list-item add and recipe ingredient entry with free-form fallback. A startup CatalogSeeder loads ~115 curated staples from an embedded JSON resource via INSERT ... ON CONFLICT DO NOTHING; skipped under the Testing environment so integration tests keep a clean slate.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace YesChef.Api.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// A family's override of a global <see cref="Product"/>. Each non-null field
|
||||
/// replaces the global value when the family views the catalog. Composite key
|
||||
/// (<see cref="FamilyId"/>, <see cref="ProductId"/>) — at most one override
|
||||
/// per family per product.
|
||||
/// </summary>
|
||||
public class FamilyProductOverride
|
||||
{
|
||||
public int FamilyId { get; set; }
|
||||
public Family Family { get; set; } = null!;
|
||||
public int ProductId { get; set; }
|
||||
public Product Product { get; set; } = null!;
|
||||
public string? Name { get; set; }
|
||||
public string? Brand { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
Reference in New Issue
Block a user