Add admin control for member dues payment availability - #505
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change replaces the fixed dues-payment cutoff with persisted admin-controlled availability. Authorized administrators can pause or enable payments. Paused members cannot start checkout and see paused messaging. Paid status remains unchanged. ChangesDues payment availability
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Admin
participant AdminDashboard
participant memberAdminRouter
participant DuesConfiguration
participant Member
participant duesRouter
Admin->>AdminDashboard: Enable or pause payments
AdminDashboard->>memberAdminRouter: Update availability
memberAdminRouter->>DuesConfiguration: Persist global setting
Member->>duesRouter: Request dues status or checkout
duesRouter->>DuesConfiguration: Read availability
duesRouter-->>Member: Return paused state or create payment flow
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 6 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (6 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
alexanderpaolini
left a comment
There was a problem hiding this comment.
I have a few concerns about how its done. I think either it should be full hacky or full implementation, not a mix of both. Best to standardize in database as global option, or env, or something stable. Approving because code LGTM and I know its urgent, but if theres time, I vote to formalize it as an option
Maybe in the admin page "Disable Club Dues" check box. Or "Disable Club Dues Until". Codex got that for sure. Tell it to just amend and --force-with-lease and prolly will figure it out
Just delete the format if you're not going to use it. If you're lazy just tell codex to make the PR for you. You might need to install a CLI but it'll figure it out |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.forge/features/member-dues-payment/test-cases.md:
- Line 397: Update the read-only member admin test case to directly invoke
memberAdmin.setDuesPaymentsEnabled, assert the API returns FORBIDDEN, then read
the dues-payment configuration and verify its value remains unchanged.
In `@packages/db/scripts/dev-db-backup-sanitizer.ts`:
- Line 26: Update teamDataSanitizerSql() to include an UPDATE for
knight_hacks_dues_configuration that sets payments_enabled to FALSE in sanitized
backups. Add a regression test verifying that an input value of true becomes
false.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9a57cd4d-b133-4f0b-8341-b95bb0404950
⛔ Files ignored due to path filters (1)
packages/api/src/tests/root/__snapshots__/api-surface.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (32)
.forge/features/admin-member-dashboard/spec.md.forge/features/admin-member-dashboard/srd.md.forge/features/admin-member-dashboard/status.md.forge/features/admin-member-dashboard/test-cases.md.forge/features/member-dues-payment/spec.md.forge/features/member-dues-payment/srd.md.forge/features/member-dues-payment/status.md.forge/features/member-dues-payment/test-cases.mdapps/blade/src/app/_components/admin/members/member-admin-dashboard.tsxapps/blade/src/app/admin/members/page.tsxapps/blade/src/tests/admin/member-admin-dashboard.test.tsxapps/blade/src/tests/e2e/member-dues-payment.spec.tsapps/blade/src/tests/member/member-dashboard.test.tsxapps/blade/src/tests/member/member-dues-page.test.tsxdocs/DATABASE-USAGE.mdpackages/api/src/routers/dues.tspackages/api/src/routers/member-admin.tspackages/api/src/tests/admin/dues-configuration.test.tspackages/api/src/tests/dues/router.test.tspackages/api/src/tests/root/api-surface.test.tspackages/api/src/utils/audit/coverage.tspackages/api/src/utils/dues/configuration.tspackages/db/drizzle/0040_gigantic_blockbuster.sqlpackages/db/drizzle/meta/0040_snapshot.jsonpackages/db/drizzle/meta/_journal.jsonpackages/db/scripts/dev-db-backup-sanitizer.tspackages/db/src/schemas/knight-hacks.tspackages/db/src/tests/dev-db-backup-sanitizer.test.tspackages/db/src/tests/migration-lineage.test.tspackages/validators/src/admin-member.tspackages/validators/src/audit.tspackages/validators/src/tests/admin-member.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- apps/blade/src/tests/member/member-dues-page.test.tsx
- apps/blade/src/tests/member/member-dashboard.test.tsx
- packages/api/src/routers/dues.ts
- .forge/features/member-dues-payment/spec.md
- packages/api/src/tests/dues/router.test.ts
alexanderpaolini
left a comment
There was a problem hiding this comment.
Def some open comments, but LGTM
Would appreciate if you can do 2 part PR. We can ship these RQ then fix tm
aeb7530 to
530a963
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.forge/features/admin-member-dashboard/test-cases.md:
- Around line 266-282: Extend TC-014 with executable checks that reload
/admin/members after each toggle and verify the persisted payment state, then
have a member attempt checkout while payments are paused and assert the dues API
rejects the request before Stripe setup or PaymentIntent creation. Preserve the
existing assertions for read-only visibility and unchanged dues rows and paid
statuses.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 94fdac13-e6a7-4823-bdc5-46f5030f47bf
📒 Files selected for processing (12)
.forge/features/admin-member-dashboard/srd.md.forge/features/admin-member-dashboard/status.md.forge/features/admin-member-dashboard/test-cases.md.forge/features/member-dues-payment/srd.md.forge/features/member-dues-payment/status.md.forge/features/member-dues-payment/test-cases.mdpackages/api/src/routers/dues.tspackages/api/src/routers/member-admin.tspackages/api/src/tests/admin/dues-configuration.test.tspackages/api/src/utils/dues/configuration.tspackages/db/scripts/dev-db-backup-sanitizer.tspackages/db/src/tests/dev-db-backup-sanitizer.test.ts
🚧 Files skipped from review as they are similar to previous changes (7)
- packages/api/src/routers/dues.ts
- .forge/features/member-dues-payment/test-cases.md
- .forge/features/admin-member-dashboard/srd.md
- packages/api/src/tests/admin/dues-configuration.test.ts
- .forge/features/admin-member-dashboard/status.md
- packages/api/src/routers/member-admin.ts
- .forge/features/member-dues-payment/srd.md
530a963 to
f367d12
Compare
Why
Member dues payments need to remain paused while the constitution is being reworked. A hardcoded reopening date would require another deployment and could become outdated, so payment availability should be controlled by administrators instead.
What
/admin/memberspage.EDIT_MEMBERS; read-only admins can still see the current status.0040_gigantic_blockbuster.sql.Test Plan
pnpm db:generate.pnpm db:migrate.pnpm format.pnpm lint.pnpm typecheck.pnpm analyze:react:changed.Checklist
pnpm db:generateand committed the generated files inpackages/db/drizzle/.Summary by CodeRabbit
New Features
Bug Fixes
Tests