changed notification method, added celery task to notify expiring task

This commit is contained in:
abutalib-kiwi
2023-08-24 12:10:18 +05:30
parent 5b9f7b1828
commit f541608656
12 changed files with 153 additions and 71 deletions

View File

@ -12,8 +12,9 @@ TASK_ASSIGNED = 8
TASK_ACTION = 9
TASK_REJECTED = 10
TASK_APPROVED = 11
REMOVE_JUNIOR = 13
PENDING_TASK_EXPIRING = 12
IN_PROGRESS_TASK_EXPIRING = 13
REMOVE_JUNIOR = 15
TEST_NOTIFICATION = 99
@ -22,16 +23,18 @@ 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
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
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
ASSOCIATE_APPROVED: {
"title": "Associate request approved!",
"body": "Your request to associate has been approved by {from_user}."
@ -54,7 +57,7 @@ NOTIFICATION_DICT = {
# Guardian will receive notification as soon as junior send task for approval
TASK_ACTION: {
"title": "Task completion approval!",
"body": "You have request from {from_user} for task completion."
"body": "{from_user} completed her task {task_name}."
},
# Juniors will receive notification as soon as their task is rejected by custodians
TASK_REJECTED: {
@ -68,11 +71,24 @@ NOTIFICATION_DICT = {
"body": "Your task completion request has been approved by {from_user}. "
"Also you earned 5 points for successful completion."
},
# Juniors will receive notification when their task end date about to end
PENDING_TASK_EXPIRING: {
"title": "Task expiring soon!",
"body": "Your task {task_name} is expiring soon. Please complete it."
},
# User will receive notification when their assigned task is about to end
# and juniors have not performed any action
IN_PROGRESS_TASK_EXPIRING: {
"title": "Task expiring soon!",
"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 as soon as their custodians remove them from account
REMOVE_JUNIOR: {
"title": "Disassociate by guardian!",
"body": "Your guardian has disassociated you."
},
# Test notification
TEST_NOTIFICATION: {
"title": "Test Notification",
"body": "This notification is for testing purpose from {from_user}."