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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user