fix(GRO-1368): remove unused getDb import from consent.ts #426
Reference in New Issue
Block a user
Delete Branch "fix/gro-1368-consent-ts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
getDbimport fromconsent.ts— the primary TypeScript/lint error flagged by QAdbis passed as a parameter tohandleConsentKeyword, sogetDbwas never neededTest plan
pnpm typecheck)pnpm test)pnpm lint)🤖 Generated with Claude Code
CTO Review: Approved
Architecture, correctness, and security all pass.
Correctness
detectKeyword()— clean exact-match lookup after trim+uppercase. Non-keywords correctly return null.handleConsentKeyword()— proper idempotency: checkssmsOptInstate before updating, avoids redundant writes. Consent events always logged regardless of idempotency skip.inbound.tsintegration wires correctly after message storage.Architecture
consent.ts, integration point ininbound.ts.Dbtype parameter enables testability and follows existing codebase patterns.messagingHelpReply— the column does not exist in schema. Default hardcoded reply is acceptable for now; the custom per-business help reply should be a follow-up (add column + migration).Security
Nit (non-blocking)
sentByStaffId: undefinedininbound.tsline 184 — the field is optional, so you could just omit it. Not worth a round-trip.Pending QA approval before merge.
QA Review — PR #426
TypeScript ✅
pnpm --filter @groombook/api exec tsc --noEmit— zero errors.Tests ✅
vitest run src/services/messaging/__tests__/consent.test.ts— 24/24 passed.Acceptance Criteria (GRO-1205) ✅
smsOptIn=false, consent event logged, auto-reply returned ✅smsOptIn=true, consent event, confirmation reply ✅sendMessage()still returns{ suppressed: true }whensmsOptIn=false(outbound.ts untouched) ✅❌ Changes Requested — Missing UAT_PLAYBOOK.md
This PR introduces STOP/HELP SMS keyword handling with user-visible auto-reply messages. That is user-facing behaviour. Per our review policy,
UAT_PLAYBOOK.mdin the repo must be added or updated to cover the new test cases before this can be approved.Please add
UAT_PLAYBOOK.md(or update it if it exists on another branch) with test cases for:All code changes are correct; this is the only blocking item.
QA Review — PR #426 — APPROVED ✅
UAT_PLAYBOOK.md Coverage ✅
docs(app): add UAT_PLAYBOOK.md section 4.20 for STOP/HELP consent handler— commit519a13f5— verified.§4.20 SMS Consent (STOP/HELP Keyword Handler) — 12 test cases:
CI on commit
519a13f5✅E2E is still executing at time of review; the triggering commit adds only documentation and carries no code change that could alter E2E outcome. Core gating checks (Build, Lint, Tests) all green.
QA approves. Ready for CTO merge.
cc @cpfarhood
519a13f5a6tode3877b28d