Add dues & fee tracking#4
Closed
CaptainCo0L wants to merge 1 commit into
Closed
Conversation
Per-batch monthly fee + a derived dues view answering "who hasn't paid this month?" — the studio's biggest missing capability. - Batch.monthly_fee (nullable; batches without a fee aren't dues-tracked). - GET /reports/dues?month=YYYY-MM[&batch_id] — staff-only, outstanding = fee - sum(payments for that student/batch/month), 2 queries, no N+1. - Alembic 0002: idempotent guarded add_column (baseline builds from live metadata, so the column may already exist on fresh DBs). - Frontend: fee input on Batches; new /dues page (native month picker, sortable table); nav + route; Dashboard "outstanding this month" panel. Smoke test extended: enroll -> dues shows owed -> pay -> clears; bad month 400; parent/tutor 403. Scope (ponytail): one fee per batch, currently-active enrollments as the expected-payer set. No per-student overrides, invoices, or reminders. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a per-batch monthly fee and a derived dues view answering "which enrolled students haven't paid this month?" — the studio's biggest missing capability. Today
Paymentis a pure ledger (who paid is queryable); this adds the expected fee so outstanding balances can be computed.Changes
Batch.monthly_fee(nullable) — batches without a fee aren't dues-tracked.GET /reports/dues?month=YYYY-MM[&batch_id=]— staff-only;outstanding = fee − Σ payments for that student/batch/month. Two queries, no N+1. Bad month → 400.add_column(baseline builds from live metadata, so the column may already exist on fresh DBs)./duespage (native month picker, sortable table, "Record payment" link); nav + route; Dashboard "outstanding this month" panel.Scope (deliberately tight)
One fee per batch (no per-student overrides); expected-payers = currently-active enrollments (no enrollment-date history exists). No invoices or reminders.
Verification
alembic upgrade headruns 0001→0002 clean on a fresh SQLite DB.npm run buildcompiles.🤖 Generated with Claude Code