Skip to content

Phase 2B: Align Notification contracts and Identity review totals - #95

Merged
qonnow merged 2 commits into
mainfrom
feature/notification-contract-alignment
Nov 21, 2026
Merged

qonnow merged 2 commits into
mainfrom
feature/notification-contract-alignment

Conversation

@SaBo4K

@SaBo4K SaBo4K commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Restore the Notification inbox, delivery logging, recipient rules and Prisma migration from the Phase 2B checkpoint.
  • For E11 ReviewPublished, notify company HR once per review on change: PUBLISHED and skip change: REMOVED. Treat legacy events with no change as PUBLISHED. E10 ADMIN_REMOVE continues to notify the student.
  • Let Identity Directory apply absolute review totals of 0/0 on removal of the final review. Invalid totals are rejected and older entity_version values leave the current snapshot intact.
  • Update the Notification recipient and schema documentation and wire Notification to Identity via Docker Compose.

Scope

19 files from the approved Phase 2B worktree across Notification (14), Identity (2), documentation (2) and Compose (1). Verified the commit is based on 8277e87 and has zero path overlap with the 13 files in #92.

Verification

  • Notification passed 11 tests on disposable PostgreSQL, covering E11 publish, removal, replay, out-of-order delivery, missing change and invalid change.
  • Identity passed 78 tests on disposable PostgreSQL, including final-review removal to 0/0, stale events, legacy events and rejection of impossible totals.
  • Notification and Identity lint and build passed. Docker Compose config and git diff --check passed.

E11 integration pending

  • Shared TypeScript ReviewPublishedPayload includes change: 'PUBLISHED' | 'REMOVED'.
  • Lifecycle emits PUBLISHED when it publishes a review and REMOVED when it removes a published review.
  • Tester verifies end to end that publish creates one HR inbox entry, removal creates no HR inbox entry, and removal of the last review updates Identity Directory to review_count: 0 and rating_avg: 0.

Full E11 end-to-end verification is pending the producer and shared-contract changes. A legacy removal event without change follows the backward-compatibility rule and can generate an HR notification before the producer is updated.

@SaBo4K
SaBo4K requested a review from qonnow November 21, 2026 17:43
@SaBo4K
SaBo4K marked this pull request as ready for review November 21, 2026 18:10
@qonnow
qonnow merged commit 4afe743 into main Nov 21, 2026
5 checks passed
@qonnow
qonnow deleted the feature/notification-contract-alignment branch November 21, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants