Skip to content

feat: add data field to the employer notification so FE can build a l…#244

Merged
oduwoleeyinojuoluwa44 merged 1 commit into
devfrom
feat/notification-data-field
Jun 13, 2026
Merged

feat: add data field to the employer notification so FE can build a l…#244
oduwoleeyinojuoluwa44 merged 1 commit into
devfrom
feat/notification-data-field

Conversation

@DammyCodes-all

@DammyCodes-all DammyCodes-all commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds the raw data object to the employer notification list response so the frontend can build navigation links itself instead of relying on the backend's link entity mapping.

Related Issue (Link to Github issue)

N/A

Motivation and Context

The backend doesn't know how the routing system works on the backend, so the link object (which encodes entity IDs and types) is insufficient. By returning the full data payload — including offerId, candidateUserId, candidateName, roleTitle, and action , the frontend can construct its own routes.

How Has This Been Tested?

  • Updated existing unit test in employer.service.spec.ts to assert the new data field.
  • Changes are backwards compatible (field is optional).

Screenshots (if appropriate - Postman, etc):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Summary by CodeRabbit

  • New Features
    • Employer notifications now support carrying additional custom data payloads, enabling richer notification content with structured information.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@DammyCodes-all, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 6 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b64c3ca8-5ea9-4dfe-b82d-8a9a14b38466

📥 Commits

Reviewing files that changed from the base of the PR and between 61639a8 and ba68fec.

📒 Files selected for processing (4)
  • src/modules/employer/dto/employer-notification.dto.ts
  • src/modules/employer/employer-notification.mapper.ts
  • src/modules/employer/employer.controller.spec.ts
  • src/modules/employer/employer.service.spec.ts
📝 Walkthrough

Walkthrough

The employer notification system is extended with an optional data field to carry arbitrary payload metadata. The DTO contract exposes this field via Swagger, the internal mapper type and logic pass it through, and tests verify the mapping preserves the original data payload.

Changes

Employer Notification Data Payload

Layer / File(s) Summary
Data contract definition
src/modules/employer/dto/employer-notification.dto.ts
EmployerNotificationItemDto adds an optional, nullable data field of type Record<string, unknown> with @ApiPropertyOptional to expose it in the Swagger schema.
Mapper type and implementation
src/modules/employer/employer-notification.mapper.ts, src/modules/employer/employer.service.spec.ts
EmployerNotificationItem interface extends to include the data field; toEmployerNotificationItem mapper function passes through item.data into the mapped result; the mapping test expects the new data field with the original candidateUserId payload.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • oduwoleeyinojuoluwa44
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a data field to employer notifications for frontend link building, matching the changeset modifications across DTO, mapper, and tests.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/notification-data-field

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

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

@DammyCodes-all DammyCodes-all force-pushed the feat/notification-data-field branch from 61639a8 to ba68fec Compare June 12, 2026 11:29
@oduwoleeyinojuoluwa44 oduwoleeyinojuoluwa44 merged commit d22be5b into dev Jun 13, 2026
6 checks passed
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