Skip to content

Return one notification per user, giving priority based on notification types #348

@vingkan

Description

@vingkan

Given a list of notification data, return a new list of notification data that has only one notification per user.

If you encounter multiple notifications for the same user, keep the notification that has the higher priority in this list of notification types.

  1. Check Message
  2. Rate Match
  3. Edit Profile
  4. Check Match

If two notifications for the same user have the same type, keep the one that came first in the list order.

Input: List of NotificationInfo
Output: List of NotificationInfo

Create a new function in the existing file pipeline/utils/notifications.py for your implementation and add tests for it in the corresponding test file.

Metadata

Metadata

Assignees

Labels

pipelineRelated to the offline pipelinesutilitySmall functions that can help solve bigger problems

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions