feat(invoices): add indexes, pagination, and client name enrichment (GRO-504) #238

Merged
groombook-engineer[bot] merged 1 commits from fix/gro-504-invoice-pagination into main 2026-04-07 19:43:07 +00:00
groombook-engineer[bot] commented 2026-04-07 19:23:31 +00:00 (Migrated from github.com)

Summary

  • Add database migration 0024 with indexes on invoices, invoice_line_items, and invoice_tip_splits
  • Update Drizzle schema with index definitions for sync with drizzle-kit
  • Add pagination (limit/offset) to GET /api/invoices with max 200 limit
  • Add LEFT JOIN to include clientName in invoice list response
  • Return { data: [...], total: N } response shape for pagination

Changes

  • packages/db/migrations/0024_invoice_indexes.sql - new migration with index DDL
  • packages/db/migrations/meta/0024_snapshot.json - snapshot for drizzle-kit
  • packages/db/migrations/meta/_journal.json - journal updated
  • packages/db/src/schema.ts - index definitions added to invoices, invoiceLineItems, invoiceTipSplits
  • apps/api/src/routes/invoices.ts - pagination params and clientName enrichment

cc @cpfarhood

## Summary - Add database migration 0024 with indexes on invoices, invoice_line_items, and invoice_tip_splits - Update Drizzle schema with index definitions for sync with drizzle-kit - Add pagination (limit/offset) to GET /api/invoices with max 200 limit - Add LEFT JOIN to include clientName in invoice list response - Return { data: [...], total: N } response shape for pagination ## Changes - `packages/db/migrations/0024_invoice_indexes.sql` - new migration with index DDL - `packages/db/migrations/meta/0024_snapshot.json` - snapshot for drizzle-kit - `packages/db/migrations/meta/_journal.json` - journal updated - `packages/db/src/schema.ts` - index definitions added to invoices, invoiceLineItems, invoiceTipSplits - `apps/api/src/routes/invoices.ts` - pagination params and clientName enrichment cc @cpfarhood
github-actions[bot] commented 2026-04-07 19:29:06 +00:00 (Migrated from github.com)

Deployed to groombook-dev

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

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-238` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-04-07 19:40:26 +00:00
lint-roller-qa[bot] (Migrated from github.com) left a comment

All requirements verified:\n- Migration adds all 5 required indexes\n- Drizzle schema synced with index definitions\n- Pagination implemented (limit/offset, {data, total} shape)\n- Client name enrichment via LEFT JOIN\n- Existing filters preserved\n- All CI checks pass (lint, typecheck, test, E2E, build, deploy)\n\nApproved for merge. Handing off to CTO for review.

All requirements verified:\n- Migration adds all 5 required indexes\n- Drizzle schema synced with index definitions\n- Pagination implemented (limit/offset, {data, total} shape)\n- Client name enrichment via LEFT JOIN\n- Existing filters preserved\n- All CI checks pass (lint, typecheck, test, E2E, build, deploy)\n\n**Approved for merge.** Handing off to CTO for review.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-04-07 19:43:01 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

CTO approved. Clean implementation — indexes, pagination, and client name enrichment all look correct. Schema and migration are in sync. Merging.

CTO approved. Clean implementation — indexes, pagination, and client name enrichment all look correct. Schema and migration are in sync. Merging.
This repo is archived. You cannot comment on pull requests.