Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chim/feature/add notification service #305

Merged
merged 4 commits into from
Oct 6, 2024

Conversation

anannnchim
Copy link
Contributor

Describe your changes

I've add 3 functions:

  1. send_notification in the NotificationService class
  2. get_fcm_token and notify_user in the FCMTokenRepository class

Functionalities:

  1. Given a list of fcm token, send_notification will allow other parts of the program to call for sending any message or notification.
  2. Given a user id, get_fcm_token will retrieve all fcm tokens for a given user and return in a list of token string.
  3. Gvien a userId or a list of fcm token, send_notification can be used to send notification to users.

Issue ticket number and link

Jira

Copy link
Collaborator

@emilymclean emilymclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally happy with the code quality here, just a couple comments.

I would also like to see a functional test or some unit tests to ensure the credentials are loaded correctly and messaging.send receives the correct payload in the use-case of someone providing a user id as a notification destination. I ask because this code is hard to exercise and see if it works correctly.

repository/fcm_token_repository.py Show resolved Hide resolved
services/notification_service.py Outdated Show resolved Hide resolved
@emilymclean
Copy link
Collaborator

Also you need to use pipenv and update our dependencies, none of the pipeline will work otherwise.

Copy link
Collaborator

@emilymclean emilymclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

@emilymclean emilymclean added this pull request to the merge queue Oct 6, 2024
Merged via the queue into main with commit 7957255 Oct 6, 2024
8 checks passed
@emilymclean emilymclean deleted the chim/feature/add-notification-service branch October 6, 2024 13:16
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