1.2 KiB
1.2 KiB
Implementer — F-024 Notifications: transactional email
Summary
Implemented notifications module with NotificationsService dispatching email through an EmailProvider port. notifications_messages.event_id enforces idempotency. Provider is injected at composition root so swapping providers only touches infrastructure.
Files changed
project/migrations/018_notifications.jsproject/src/modules/notifications/**project/src/app/build-app.ts
Acceptance evidence
- AC1 dispatch on first event:
notifications-service.test.tsconfirms first call returns 'sent' and provider.send called once. - AC2 replay no duplicate: same test injects
findByEventIdreturning an existing row and asserts 'duplicate' with no second provider call. - AC3 provider swap:
boundary.test.tsasserts onlyinfrastructure/referencesLoggingEmailProvideroremailProvider.send.
Commands run
cd project && npm run lint/typecheck/build/testpassedcd project && TEST_DATABASE_URL='postgres://mdv:mdv_dev_only@localhost:5432/mdv_test' npm run test:integration -- migrations.itestpassed; 14 files, 53 tests./scripts/verify.shpassed
Notes
- No new runtime dependency.
LoggingEmailProviderwrites JSON lines for v1.