Update fees mapping
updateFeesMapping is the API entry point that recomputes a member’s
stored fee state — what they owe, what’s due, what’s overdue — after
something happens that could change it. It is intended to be the
single point of truth the rest of the platform calls into; nothing
else should write to the fee mapping directly.
Callers
The pieces of the platform that invoke updateFeesMapping today:
- Payment reminder cron — on its schedule.
- Approve-skill path — when an instructor approves a skill that carries a fee.
- Change-request path — on role changes, deactivations, and skill removals.
- Member directory admin tool — on manual member edits.
- Profile → Payment history view — on load, as a runtime safety net in case any of the writes above were missed.
Triggering events
The events that should cause a fee-state recompute (whether or not every code path above already calls in for each):
- Membership card view (runtime fallback if a write was missed upstream).
- Membership fee paid.
- Stripe webhook fired.
- Change request: skill removed.
- Change request: instructor deactivated.
- Change request: role change.
- Manage request: skill approved.
- Skill assigned.
- Approval confirmation.
- Scheduled cron pass.
If you’re adding a new operation that can change a member’s fee state,
call updateFeesMapping from it. Don’t write to the fee mapping
directly.
Last updated on