Fee management restructure

commit

2025-09-07 · mystockaid

Tore out the old fee schema and replaced it with something that can actually express the rules stockyards use. FeeTemplate now carries enums for type, level, and calculation base, with a separate FeeApplicabilityRule table feeding a rule engine and a single AppliedFee table replacing the split between invoice_fees and livestock_fees. Briefly tried moving all of this into Postgres triggers, got 450 lines of plpgsql working, then deleted it in the next migration and moved calculation back to the application layer where it belongs. Also added a rule builder UI, skeleton loading states across settings tables, and a CLAUDE.md note about both.

3 commits across 1 repo (heeler: 3). 41 files changed; 1 skipped. Diff was truncated for summarization.