Section defaults on products with prompt-on-divergence
- Add DefaultSection (string?) to Product, FamilyProduct, and
FamilyProductOverride. Resolution order on item add: per-store memory
(ProductStoreSection) → family default (override or family product) →
global product default, matched case-insensitively by name to the
current store''s StoreSection rows.
- Drop the section dropdown from the add-item form; the backend resolves
on POST. Section change on a list row syncs the family default:
silently creates it when none exists, no-op when it matches, returns
promptSaveDefault=true when it differs so the client confirms before
updating.
- Expose DefaultSection on the catalog page form. Replace the native
datalist with a styled TextCombobox component for autocomplete
suggestions (seeded from typicalSections) while still allowing
free-text entry. Pattern doc-noted as the sibling of ProductTypeahead.
- Remove the now-unused GET /api/products/{kind}/{id}/section endpoint
and its tests; the add-form pre-fill they backed is gone.
This commit is contained in:
@@ -18,5 +18,8 @@ public class FamilyProductOverride
|
||||
// Nullable so "inherit global" (null) is distinguishable from
|
||||
// "explicitly None / any unit" (UnitCategoryFlags.None).
|
||||
public UnitCategoryFlags? AllowedUnitCategories { get; set; }
|
||||
// Null = inherit Product.DefaultSection. Non-null = family override of
|
||||
// the recommended section name.
|
||||
public string? DefaultSection { get; set; }
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user