DalgoT4D / DDP_backend

Django app for the DDP platform
GNU Affero General Public License v3.0
12 stars 40 forks source link

[442]-Backend for Notification System (Phase 1) #730

Closed huzaifmalik786 closed 3 months ago

huzaifmalik786 commented 3 months ago

This PR close #674 #675 #676 #677 #678 #679 #680 #681 #682 #683 #684 #685 #686 #688. New models have been added for handling notification related tasks, migrations have been made and functions have been added for managing notification and user preferences. A new celery worker has also been added to manage scheduling of notifications. APIs for managing user preferences have also been added.

fatchat commented 3 months ago

can you add to .gitignore

  1. celerybeat-schedule.bak
  2. celerybeat-schedule.dat
  3. celerybeat-schedule.dir

can you move the contents of ddpui/api/notifications_api.py to ddpui/core/notifications_service.py

can you put type hints on function parameters

can you rename "user preference" to "user preferences" where applicable e.g. user_preference_schema.py, user_preference_api

all OrgUser variables should be called orguser not user

schedule_notification_task takes a recipient and a UserPreferences as separate parameters, you should look up the preferences from the recipient

fatchat commented 3 months ago

i did some refactoring, please study the changes carefully

let's break up this PR; would you include only

.gitignore ddpui/api/user_preferences_api.py ddpui/migrations/0082_notification_userpreferences_notificationrecipient.py ddpui/models/notifications.py ddpui/models/userpreferences.py ddpui/urls.py but remove the commented route

thanks