using System; using System.Collections.Generic; using System.Linq; namespace BoundaryLab.Domain; public record InventoryState(int Version, int Available) { public InventoryState? Reserve(int units) => units < 1 || units > Available ? null : new(checked(Version + 1), Available - units); } public record ReservationNotice(int Version, int Units);