-
Notifications
You must be signed in to change notification settings - Fork 33
update the logic of Post Interview Action Reminder #518
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xxcxy the update looks good, though it seems that interview example within day doesn't work properly.
First I run the code as is and got only one notification about interview awaiting action which is expected:
{"topic":"notifications.action.create","originator":"taas-api","timestamp":"2021-08-20T12:44:02.061Z","mime-type":"application/json","payload":{"notifications":[{"serviceId":"email","type":"taas.notification.post-interview-action-required","details":{"recipients":[{"userId":22880988},{"userId":40152933},{"userId":40152856}],"cc":[],"data":{"teamName":"the thing three","numCandidates":1,"teamInterviews":[{"jobTitle":"Dummy title - at most 64 characters","guestFullName":"guest1","hostFullName":"hostName","candidateName":"pshah manager","handle":"pshah_manager","attendees":["guest1","guest2"],"startTime":"Aug 19, 2021, 08:13 EDT","duration":30,"interviewLink":"https://platform.topcoder-dev.com/taas/myteams/111/positions/a8adb1f8-a6ee-48b1-8661-33bd851b726e/candidates/interviews","jobUrl":"https://platform.topcoder-dev.com/taas/myteams/111/positions/a8adb1f8-a6ee-48b1-8661-33bd851b726e"}],"notificationType":{"postInterviewCandidateAction":true},"description":"Post Interview Candidate Action Reminder","subject":"Topcoder - Candidate Action Required in the thing three for 1 candidates","body":""},"sendgridTemplateId":"d-5b9941656e09401fb7e68119b60d8aa7","version":"v3"}},{"serviceId":"web","type":"taas.notification.post-interview-action-required","details":{"recipients":[{"userId":22880988},{"userId":40152933},{"userId":40152856}],"contents":{"jobTitle":"Dummy title - at most 64 characters","teamName":"the thing three","projectId":111,"jobId":"a8adb1f8-a6ee-48b1-8661-33bd851b726e","userHandle":"pshah_manager"},"version":1}}]}}
After that I've replaced completedStartTimestamp
for interviewWithinOneDay
to startTimestamp: moment().subtract(moment.duration(config.POST_INTERVIEW_ACTION_MATCH_WINDOW)).subtract(30, 'm').toDate()
same like for the first interview.
What is expected that after such change the second notification would be triggered for the interviewWithinOneDay
because with such a date it's not within day. But I still get only 1 notification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, @xxcxy I'm still getting only one taas.notification.post-interview-action-required
I update demo script like this:
I run npm run local:init
to make sure I have the same DB data.
But if I watch notifications.action.create
I still see only 1 taas.notification.post-interview-action-required
:
I get 2 records. https://monosnap.com/file/Zcj5Lb9i6P7t1GaLcj0ikJfE9lM5Bc |
@maxceem I've fixed the test data, please run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for quick updates @xxcxy works perfectly now.
Merging to pass for QA.
No description provided.