Skip to content

Add dues & fee tracking#4

Closed
CaptainCo0L wants to merge 1 commit into
harden-config-security-alembicfrom
dues-fee-tracking
Closed

Add dues & fee tracking#4
CaptainCo0L wants to merge 1 commit into
harden-config-security-alembicfrom
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.

Base branch: targets harden-config-security-alembic (not main) because it builds on that branch's Alembic setup. Merge the hardening PR (#3) first, then this retargets cleanly to main.

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 deleted the branch harden-config-security-alembic June 28, 2026 16:07
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