Honor the catalog's min-legs setting and carve $500 pieces

Big days (> the $1,700 split threshold) must carve at least the account
type's minLegs from the catalog — pickLegAmount reserves the minimum
piece for each leg still owed, forcing a carve even once the residual
dips below the threshold, clamped to what the pieces allow. Days at or
below the threshold still trade as one leg. The smallest split piece
drops from $800 to $500. An older master without the field means no
minimum.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-09-11 15:32:40 -05:00
co-authored by Claude Fable 5
parent 620ab54d42
commit ae0f93a44f
6 changed files with 43 additions and 8 deletions
+2
View File
@@ -161,6 +161,8 @@ function validatePayload(raw: unknown): FirmCatalogPayload {
...type,
splitEnabled: type.splitEnabled !== false,
combineCmeHolidays: type.combineCmeHolidays === true,
// Lenient: a master from before the min-legs field means "no minimum".
minLegs: typeof type.minLegs === 'number' ? type.minLegs : 0,
} as unknown as CatalogAccountType;
});