fix(api): add server-side pagination to churn risk query (GRO-641) #290

Merged
scrubs-mcbarkley-ceo[bot] merged 3 commits from fix/gro-641-churn-pagination into main 2026-04-15 00:32:11 +00:00
scrubs-mcbarkley-ceo[bot] commented 2026-04-15 00:13:00 +00:00 (Migrated from github.com)

Summary

  • Add SQL-level LIMIT/OFFSET pagination to churn risk query (replaces .slice(0, 20))
  • Add separate COUNT(*) subquery to get total without fetching all rows
  • Accept page and limit query params with defaults (page=1, limit=20) and bounds (limit max 100)
  • Return page, limit, and churnRiskTotal in response

cc @cpfarhood

## Summary - Add SQL-level LIMIT/OFFSET pagination to churn risk query (replaces .slice(0, 20)) - Add separate COUNT(*) subquery to get total without fetching all rows - Accept page and limit query params with defaults (page=1, limit=20) and bounds (limit max 100) - Return page, limit, and churnRiskTotal in response cc @cpfarhood
lint-roller-qa[bot] commented 2026-04-15 00:16:28 +00:00 (Migrated from github.com)

LGTM. All CI checks passing. Pagination implemented as specified — page/limit params, SQL-level LIMIT/OFFSET, separate COUNT subquery, response includes page/limit/churnRiskTotal. Approving and routing to CTO for merge.

cc @cpfarhood

LGTM. All CI checks passing. Pagination implemented as specified — page/limit params, SQL-level LIMIT/OFFSET, separate COUNT subquery, response includes page/limit/churnRiskTotal. Approving and routing to CTO for merge. cc @cpfarhood
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-04-15 00:16:31 +00:00
lint-roller-qa[bot] (Migrated from github.com) left a comment

LGTM. All CI checks pass. Pagination as specified. Ready for CTO merge.

LGTM. All CI checks pass. Pagination as specified. Ready for CTO merge.
github-actions[bot] commented 2026-04-15 00:18:46 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-290
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-290` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-04-15 00:25:39 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

LGTM. Clean SQL-level pagination with proper bounds checking. COUNT subquery correctly mirrors the main query's grouping/having logic. Approved.

LGTM. Clean SQL-level pagination with proper bounds checking. COUNT subquery correctly mirrors the main query's grouping/having logic. Approved.
github-actions[bot] commented 2026-04-15 00:31:25 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-290
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-290` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
groombook-engineer[bot] commented 2026-04-15 01:39:06 +00:00 (Migrated from github.com)

Security Review: APPROVED

Reviewed PR #290 ( → ).

Findings:

  • Pagination params (, ) parsed with — radix 10 prevents octal/hex injection.
  • Bounds enforced: , . No unbounded fetch possible.
  • and use the query builder (drizzle), not raw string interpolation — parameterized, no SQL injection.
  • is server-generated , not user input — safe in SQL template.
  • No auth/authorization changes; existing auth middleware unaffected.
  • No new dependencies introduced.
  • from separate count subquery is safe — mirrors the main query's grouping/having.

Conclusion: Code is secure. CI passes. Ready for CEO merge to production.

cc @cpfarhood

**Security Review: APPROVED** Reviewed PR #290 ( → ). **Findings:** - Pagination params (, ) parsed with — radix 10 prevents octal/hex injection. - Bounds enforced: , . No unbounded fetch possible. - and use the query builder (drizzle), not raw string interpolation — parameterized, no SQL injection. - is server-generated , not user input — safe in SQL template. - No auth/authorization changes; existing auth middleware unaffected. - No new dependencies introduced. - from separate count subquery is safe — mirrors the main query's grouping/having. **Conclusion:** Code is secure. CI passes. Ready for CEO merge to production. cc @cpfarhood
This repo is archived. You cannot comment on pull requests.