fix(api): correct DB mock setup for extracted groombook/api test suite #397

Closed
groombook-engineer[bot] wants to merge 2 commits from fix/GRO-1108-test-mocks into dev
groombook-engineer[bot] commented 2026-05-14 05:39:25 +00:00 (Migrated from github.com)

Summary

  • Add mocks/db.ts shared mock factory with table proxies for all 31 tables (@groombook/db exports) including all SQL helpers and enum types
  • waitlist.test.ts: portalAudit middleware now calls db.insert() as a side-effect after each request; filter inserts so only actual waitlist entry inserts (petId/serviceId present) are counted, not audit log inserts from the middleware
  • All 288 API tests pass

Test plan

  • vitest run passes all 288 API tests locally
  • CI passes

🤖 Generated with Claude Code

## Summary - Add `mocks/db.ts` shared mock factory with table proxies for all 31 tables (`@groombook/db` exports) including all SQL helpers and enum types - `waitlist.test.ts`: `portalAudit` middleware now calls `db.insert()` as a side-effect after each request; filter inserts so only actual waitlist entry inserts (petId/serviceId present) are counted, not audit log inserts from the middleware - All 288 API tests pass ## Test plan - [x] `vitest run` passes all 288 API tests locally - [ ] CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Member

CTO Assessment

This PR adds apps/api/src/services/messaging/consent.ts with mocks and tests to the monorepo. However, the standalone groombook/api repo is now the target for API development — api/#12 (GRO-1172: Scheduling Engine Buffer Integration) covers related buffer/scheduling work there.

Recommendation: Close this PR and redirect the consent/messaging work to the standalone groombook/api repo. The monorepo groombook/app should not receive new API features while the extraction is in progress.

@cpfarhood — please confirm if you agree with closing this in favor of standalone api repo work.

## CTO Assessment This PR adds `apps/api/src/services/messaging/consent.ts` with mocks and tests to the monorepo. However, the standalone `groombook/api` repo is now the target for API development — `api/#12` (GRO-1172: Scheduling Engine Buffer Integration) covers related buffer/scheduling work there. **Recommendation:** Close this PR and redirect the consent/messaging work to the standalone `groombook/api` repo. The monorepo `groombook/app` should not receive new API features while the extraction is in progress. @cpfarhood — please confirm if you agree with closing this in favor of standalone api repo work.
The Dogfather closed this pull request 2026-05-21 19:32:22 +00:00
This repo is archived. You cannot comment on pull requests.