Pre-fill list section on product pick; tighten backend warnings

- Adds GET /api/products/{kind}/{id}/section?storeId=... exposing the
  per-store memory the list page mirrors when a product is picked, so the
  section dropdown reflects what the backend would auto-assign on POST.
- Treats backend warnings as errors via Directory.Build.props; fixes the
  surfaced warnings (obsolete PostgreSqlBuilder ctor, nullable string[]
  in IsEquivalentTo, redundant nullable flow).
- Annotates wire-exposed enums (ProductKind, UnitKind, UnitCategory,
  UnitCategoryFlags) with JsonStringEnumConverter so they round-trip as
  strings regardless of caller options. Unblocks the integration tests
  that deserialize DTOs via GetFromJsonAsync without the global converter.
This commit is contained in:
Josh Rogers
2026-05-15 21:30:00 -05:00
parent f38530cf81
commit 6d84aad94b
11 changed files with 205 additions and 28 deletions
@@ -1,3 +1,4 @@
using System.Text.Json.Serialization;
using Microsoft.EntityFrameworkCore;
using YesChef.Api.Auth;
using YesChef.Api.Data;
@@ -9,6 +10,7 @@ public static class UnitEndpoints
{
/// <summary>Discriminator so the client can route subsequent PUT/DELETE
/// calls to the right code path. Global units cannot be edited.</summary>
[JsonConverter(typeof(JsonStringEnumConverter<UnitKind>))]
public enum UnitKind { Global, Family }
public record UnitDto(