Skip to content

Feat/439 notification center emails trigger - #142

Merged
RamRamez merged 5 commits into
stagingfrom
feat/439-notification-center-emails-trigger
Sep 10, 2026
Merged

RamRamez merged 5 commits into
stagingfrom
feat/439-notification-center-emails-trigger

Conversation

@RamRamez

@RamRamez RamRamez commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added optional support for routing notification events through Ortto’s v6 activities and journeys.
    • Notifications continue using legacy activity handling when v6 routing is not enabled.
    • Added v6-specific routing for project verification events, including distinct verification statuses and rejection details.
    • Events without a dedicated v6 journey continue using their existing activity behavior.
  • Tests

    • Expanded coverage for v5/v6 routing, event mappings, and verification attributes.

…T_NAMES_V6 overlay. This update introduces comprehensive test cases for various notification events, ensuring correct routing between v6 and legacy activity IDs. The changes aim to improve the reliability of event-triggered emails in the notification service.
…ies and improve event handling

This update introduces a new optional parameter `useV6Activities` to the `activityCreator` function, allowing for better routing of notifications between v5 and v6 event handling. The `verified-status` attribute is now conditionally set based on this parameter, ensuring correct email templates are used for different event scenarios. Additionally, the resolution of activity slugs has been updated to utilize `resolveOrttoActivitySlug`, improving the clarity and maintainability of the code. Comprehensive comments have been added to clarify the changes and their implications for event handling.
…ution

This commit introduces a new mapping for v6 Ortto activity IDs, allowing for distinct handling of notifications related to v6 events. The `ORTTO_EVENT_NAMES_V6` constant has been added to provide an overlay for v6-specific journeys, ensuring that notifications are routed correctly without affecting legacy v5 events. Additionally, the `resolveOrttoActivitySlug` function has been updated to support the new v6 activities, improving the clarity and maintainability of the notification system. Comprehensive comments have been included to explain the rationale and implications of these changes.
…resolution

This update introduces an optional `orttoV6Activities` property to the `SendNotificationRequest` interface. This flag allows for the resolution of events through `ORTTO_EVENT_NAMES_V6`, enabling a transition to v6's Ortto journey while maintaining compatibility with legacy v5 activities. Comprehensive comments have been added to clarify the purpose and usage of this new property.
…idator schema

This commit introduces the `orttoV6Activities` property to the `sendNotificationValidator` schema, allowing for the inclusion of v6-specific activity routing. The addition is optional and ensures that unknown keys are rejected, preventing errors in v6 notifications. Comprehensive comments have been added to clarify the purpose and implications of this new flag.
@RamRamez
RamRamez merged commit 7d0d8d9 into staging Sep 10, 2026
1 of 2 checks passed
@RamRamez
RamRamez deleted the feat/439-notification-center-emails-trigger branch September 10, 2026 10:42
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f778c44f-cc22-4b96-baf2-2fab2183eb89

📥 Commits

Reviewing files that changed from the base of the PR and between d782984 and c831c40.

📒 Files selected for processing (5)
  • src/services/notificationService.test.ts
  • src/services/notificationService.ts
  • src/types/notifications.ts
  • src/types/requestResponses.ts
  • src/validators/schemaValidators.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The notification API now accepts an optional Ortto v6 routing flag. A resolver selects v6 or legacy activity slugs. Verification events use v6-specific status attributes. Tests cover activity mappings, fallbacks, trigger ids, and coverage exceptions.

Changes

Ortto v6 activity routing

Layer / File(s) Summary
Activity and request contracts
src/types/notifications.ts, src/types/requestResponses.ts, src/validators/schemaValidators.ts
Adds the partial v6 activity map, slug resolver, optional request flag, and Joi validation field.
Notification routing integration
src/services/notificationService.ts
Passes the v6 flag to activityCreator, resolves v6 or legacy slugs, and emits the v6 unverified status when enabled.
Routing and coverage validation
src/services/notificationService.test.ts
Tests v6 mappings, legacy fallbacks, verification attributes, provisioned trigger ids, and documented coverage exceptions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: ae2079

Merge Risk: ⚪ Minimal · up to c831c

This change adds opt-in Ortto v6 notification routing while preserving existing legacy behavior for callers that do not enable it. The current implementation and coverage support merging with normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: triggering notification-center emails for the v6 event handling work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/439-notification-center-emails-trigger

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit hops through routes of green,
V6 activity paths are seen.
Old trails remain when flags are bare,
Status branches bloom with care.
Tests guard each journey bright.

Comment @coderabbitai help to get the list of available commands.

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.

1 participant