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:
Josh Rogers
2026-05-15 22:21:56 -05:00
parent 6d84aad94b
commit fa465ac29c
16 changed files with 1899 additions and 275 deletions
@@ -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;
}