Port backend-claim-dev notification and chat Nest modules into backend-pms-dev, wired to the shared Portal uam database (FCM tokens + user notification inbox), with PMS-specific CONTEXT_TYPE and routes bound to projectId instead of payment-request IDs.
Claim production already uses Portal-backed notifications and a conversation-based chat stack (see [[Projects/anabatic-claim/context/production-architecture]]). PMS needs the same cross-cutting capabilities on project records without reimplementing from scratch.
Source of truth (Claim repo, local path):
| Module | Path |
|---|---|
| Notification | backend-claim-dev/src/modules/notification/ |
| Chat | backend-claim-dev/src/modules/chat/ |
Reference entities (Claim):
FcmToken, UserNotification — TypeORM connection uamConversation, ConversationParticipant, Message, MessageAttachment, MessageMention — connection claim today; PMS must decide same DB vs PMS schema (prefer shared Portal/UAM patterns per Claim prod architecture)Integration pattern in Claim:
ChatModule imports NotificationModule; ChatNotificationAdapter implements CHAT_NOTIFICATION_SENDERpayment-request controllers expose thin routes that delegate to ChatService with CONTEXT_TYPE.PAYMENT_REQUESTTarget for PMS:
backend-pms-dev/src/modules/main.module.tsCONTEXT_TYPE.PROJECT (or equivalent) in chat serviceGET/POST .../projects/:projectId/chat/... mirroring Claim’s payment-request chat surfaceNote: CMS chat-system (polymorphic chatboxes tables) is a different design. This backlog explicitly tracks Claim modules per management request, not CMS legal/cover-letter chat.
NotificationModule + NotificationService + controller ported; TypeOrmModule.forFeature(..., 'uam') matches PMS datasource configFIREBASE_* in docs/DATABASE.md)ChatModule + ChatService + ChatNotificationAdapter portedCONTEXT_TYPE extended for project; conversation keyed by projectIdProjectChatController delegates to ChatService (no Claim payment-request routes)npm run db:schema:chat then exercise routes against dev DB (see docs/DATABASE.md)chat-system polymorphic tables migrationp1 — raised after 2026-05-21 emergency PMS priority meeting.
uam (and chat DB) datasource configuration in backend-pms-devprojectId from [[Projects/anabatic-project-manager/changelog/2026-05-22-pms-progress-snapshot|projects CRUD]] (local implementation exists)