Skip to content

Add dues & fee tracking#5

Merged
CaptainCo0L merged 1 commit into
mainfrom
dues-fee-tracking
Jun 28, 2026
Merged

Add dues & fee tracking#5
CaptainCo0L merged 1 commit into
mainfrom
dues-fee-tracking

Conversation

@CaptainCo0L

Copy link
Copy Markdown
Owner

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 Payment is a pure ledger (who paid is queryable); this adds the expected fee so outstanding balances can be computed.

Rebased onto main after the hardening PR (#3) merged; supersedes #4, which GitHub auto-closed when its base branch was deleted.

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.
  • 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, "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

  • Smoke test extended: enroll → dues shows owed → pay → clears; bad month 400; parent/tutor 403.
  • alembic upgrade head runs 0001→0002 clean on a fresh SQLite DB.
  • npm run build compiles.

🤖 Generated with Claude Code

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>
@CaptainCo0L CaptainCo0L merged commit f85fa4e into main Jun 28, 2026
1 check passed
@CaptainCo0L CaptainCo0L deleted the dues-fee-tracking branch June 28, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant