Compare commits

...

20 Commits

Author SHA1 Message Date
The Dogfather e7032e46bf Merge pull request 'promote: dev → uat (GRO-1489 lint fixes)' (#433) from dev into uat
promote: dev → uat (GRO-1489 lint fixes) (#433)
2026-05-23 19:27:34 +00:00
The Dogfather 09edd1b8ec Merge pull request 'Promote dev → uat: fix(e2e) PLAYWRIGHT_BASE_URL + host.docker.internal (GRO-1496)' (#431) from dev into uat
Promote dev → uat: fix(e2e) PLAYWRIGHT_BASE_URL + host.docker.internal (GRO-1496) (#431)
2026-05-21 21:04:20 +00:00
The Dogfather 7bb7d8c32b Merge pull request 'promote: dev → uat (GRO-1369 types sync)' (#428) from dev into uat
Merge dev → uat: GRO-1369 types sync, cascade logic, SMS consent
2026-05-21 20:53:19 +00:00
The Dogfather 6f160dde51 Merge pull request 'promote: dev → uat (GRO-1248 path prefix fix)' (#425) from dev into uat
promote: dev → uat (GRO-1248 path prefix fix) (#425)
2026-05-20 13:01:26 +00:00
the-dogfather-cto[bot] 733af4f5f2 Merge pull request #420 from groombook/dev
chore: promote dev → uat (GRO-1289 CI path fix)
2026-05-14 21:03:16 +00:00
the-dogfather-cto[bot] 13abbdcec8 chore: promote dev to uat — GRO-1287 ci.yml path fix (#419)
chore: promote dev to uat (GRO-1287 ci.yml path fix)
2026-05-14 20:49:13 +00:00
the-dogfather-cto[bot] e4e783dec6 chore: promote dev to uat — VITE_API_URL fix (GRO-1280, GRO-1206)
chore: promote dev to uat — VITE_API_URL fix (GRO-1280)
2026-05-14 20:32:09 +00:00
the-dogfather-cto[bot] 1a88528eae promote: dev → uat (GRO-1236 OAuth callback fix)
promote: dev → uat (GRO-1236 OAuth callback fix)
2026-05-14 19:36:13 +00:00
Chris Farhood 0f6a5ebe35 Promote dev→uat: OAuth callback session fix (GRO-1236) 2026-05-14 19:25:42 +00:00
the-dogfather-cto[bot] 121735edca promote: dev → uat (GRO-1207 portal Communication tab real backend)
promote: dev → uat (GRO-1207 portal Communication tab real backend)
2026-05-14 16:59:09 +00:00
the-dogfather-cto[bot] 5b2f45e5f3 chore: promote dev → uat (GRO-1212 portal test mock fix)
chore: promote dev → uat (GRO-1212 portal test mock fix)
2026-05-14 12:08:38 +00:00
the-dogfather-cto[bot] ff0bd2903e promote: dev → uat (GRO-1208 conversations API + GRO-1211 telnyx webhook fix)
promote: dev → uat (GRO-1208 conversations API + GRO-1211 telnyx webhook fix)
2026-05-14 08:45:38 +00:00
the-dogfather-cto[bot] 831b90dbe2 Merge dev→uat: auth rate limiting (GRO-1024)
chore: promote dev → uat (fix auth rate limits)
2026-05-11 03:40:46 +00:00
the-dogfather-cto[bot] 4b4ffa0ca4 Promote dev → uat: TELNYX_WEBHOOK_SECRET .env.example
Promote dev → uat: TELNYX_WEBHOOK_SECRET .env.example
2026-05-11 02:27:54 +00:00
the-dogfather-cto[bot] f0f271e046 feat(GRO-106): inbound Telnyx webhook + persistence (#378) (#388)
* feat(GRO-106): messaging schema + migrations

- Add conversations, messages, message_attachments, message_consent_events tables
- Add messagingChannelEnum, messageDirectionEnum, messageStatusEnum, messageConsentKindEnum
- Extend business_settings with messagingPhoneNumber and telnyxMessagingProfileId columns
- Add required indexes and unique constraints with cascade-on-delete FKs
- Add migration 0030_messaging.sql



* fix(GRO-981): restore journal entries and add DESC to indexes

- _journal.json: restore idx 28 (0028_sms_reminders), add idx 29
  (0029_db_indexes_constraints), renumber 0030_messaging to idx 30
  (was missing 0028 and 0029 entries — they were silently skipped)
- schema.ts: add .desc() to conversations.lastMessageAt and
  messages.createdAt indexes per spec
- 0030_messaging.sql: add DESC to both generated index statements



* feat(GRO-106): inbound Telnyx webhook + persistence

- Add POST /api/webhooks/telnyx/messaging route with HMAC signature verification
- Add services/messaging/inbound.ts: findOrCreateConversation, upsertMessage (idempotent on providerMessageId), delivery receipt handling
- Register telnyxWebhooksRouter in index.ts (before auth middleware)
- Add unit tests for signature validation, find-or-create, idempotent insert, delivery receipt



* fix(GRO-982): address all QA blocking failures

- #7: Extract validateTelnyxSignature in sms.ts as standalone exported fn,
  reuse in TelnyxProvider.validateWebhookSignature and telnyx.ts route
- #1: Replace uuid v4 import with crypto.randomUUID() (built-in, no dep)
- #2: Remove updatedAt from messages update in handleMessageFinalized
  (no such column exists)
- #3: Fix test import path ../../ → ../../../ for telnyx route import
- #4: validateTelnyxSignature accepts string | undefined | null to match
  Hono c.req.header() return type
- #5&6: Add null guards for .returning() results in findOrCreateConversation
  and upsertMessage
- #8: Remove dead buildFindOrCreateConversationParams function
- #9: Remove unused imports (messageDirectionEnum, messageStatusEnum,
  resolveBusinessIdByMessagingNumber in test)
- #10: Wrap upsertMessage insert in try/catch; unique violation returns
  {isNew: false} instead of crashing
- #11: Add EOF newlines to all modified files



* chore: add uuid dependency for messaging services

* fix(GRO-982): address 5 test failures in inbound webhook

- Fix signature route tests: use /messaging not full mount path
- Fix handleMessageReceived mock order: business lookup first
- Fix stale mock state: add full mockReset in handleMessageFinalized beforeEach
- Fix delivery logic: set delivered for all message.finalized events
- Deduplicate test that was accidentally added twice



* fix(GRO-982): look up or create client by phone before inserting conversation

Fixes FK constraint violation where clientId was set to businessSettings.id
or a random UUID. Now looks up clients.phone = clientPhone first; if no match,
creates a placeholder client with phone as name and a placeholder email.

* fix(GRO-982): address QA round 4 blocking failures

- Fix URL in signature tests: use /messaging not full path
- Reorder mocks: businessSettings first, then conversations, clients, messages
- Add mockDb.mockReset in handleMessageFinalized beforeEach
- Remove direction guard: set delivered for any message.finalized

* fix(GRO-982): add missing message insert mock in handleMessageReceived test

* fix(GRO-982): simplify test mocks to match actual code flow

---------

Co-authored-by: groombook-engineer[bot] <269742240+groombook-engineer[bot]@users.noreply.github.com>
Co-authored-by: Chris Farhood <chris@farhood.org>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-11 00:51:17 +00:00
the-dogfather-cto[bot] 673b85b64b Merge pull request #386 from groombook/dev
chore: promote dev → uat (GRO-1036 security fixes)
2026-05-04 22:53:58 +00:00
the-dogfather-cto[bot] a368d567d8 promote dev → uat: portal mobile overflow fix (GRO-730) (#384)
promote dev → uat: portal mobile overflow fix (GRO-730)
2026-05-04 21:25:36 +00:00
the-dogfather-cto[bot] 5332147ac1 Merge dev → uat: 10DLC pilot registration runbook (GRO-106)
promote dev → uat: 10DLC pilot registration runbook (GRO-106)
2026-05-04 20:55:50 +00:00
the-dogfather-cto[bot] b38de28d2e Merge pull request #380 from groombook/dev
promote: dev → uat (GRO-693 E2E mock fixes)
2026-05-04 15:16:52 +00:00
the-dogfather-cto[bot] 66a80cf9e7 Merge pull request #376 from groombook/dev
promote: GRO-106 messaging schema → UAT
2026-05-04 02:25:31 +00:00

Diff Content Not Available