added notification for top leaderboard junior, added related celery task, created method to send notification to multiple users

This commit is contained in:
abutalib-kiwi
2023-08-25 12:26:38 +05:30
parent 2e0ceb8c92
commit 464899f7d3
6 changed files with 91 additions and 13 deletions

View File

@ -14,6 +14,9 @@ TASK_REJECTED = 10
TASK_APPROVED = 11
PENDING_TASK_EXPIRING = 12
IN_PROGRESS_TASK_EXPIRING = 13
TOP_JUNIOR = 14
REMOVE_JUNIOR = 15
TEST_NOTIFICATION = 99
@ -23,38 +26,44 @@ NOTIFICATION_DICT = {
"title": "Successfully registered!",
"body": "You have registered successfully. Now login and complete your profile."
},
# user will receive notification as soon junior sign up application using their guardian code
# for association
# user will receive notification as soon junior
# sign up application using their guardian code for association
ASSOCIATE_REQUEST: {
"title": "Associate request!",
"body": "You have request from {from_user} to associate with you."
},
# Juniors will receive notification when custodians reject their request for associate
# Juniors will receive notification when
# custodians reject their request for associate
ASSOCIATE_REJECTED: {
"title": "Associate request rejected!",
"body": "Your request to associate has been rejected by {from_user}."
},
# Juniors will receive notification when custodians approve their request for associate
# Juniors will receive notification when
# custodians approve their request for associate
ASSOCIATE_APPROVED: {
"title": "Associate request approved!",
"body": "Your request to associate has been approved by {from_user}."
},
# Juniors will receive Notifications for every Points earned by referrals
# Juniors will receive Notifications
# for every Points earned by referrals
REFERRAL_POINTS: {
"title": "Earn Referral points!",
"body": "You earn 5 points for referral."
},
# Juniors will receive notification once any custodians add them in their account
# Juniors will receive notification
# once any custodians add them in their account
JUNIOR_ADDED: {
"title": "Profile already setup!",
"body": "Your guardian has already setup your profile."
},
# Juniors will receive Notification for every Task Assign by Custodians
# Juniors will receive Notification
# for every Task Assign by Custodians
TASK_ASSIGNED: {
"title": "New task assigned!",
"body": "{from_user} has assigned you a new task."
},
# Guardian will receive notification as soon as junior send task for approval
# Guardian will receive notification as soon
# as junior send task for approval
TASK_ACTION: {
"title": "Task completion approval!",
"body": "{from_user} completed her task {task_name}."
@ -83,6 +92,11 @@ NOTIFICATION_DICT = {
"body": "{from_user} didn't take any action on assigned task {task_name} and it's expiring soon. "
"Please assist to complete it."
},
# Juniors will receive Notification related to Leaderboard progress
TOP_JUNIOR: {
"title": "Leaderboard topper!",
"body": "{from_user} is on top in leaderboard with {points} points."
},
# Juniors will receive notification as soon as their custodians remove them from account
REMOVE_JUNIOR: {
"title": "Disassociate by guardian!",