Skip to content

Instantly share code, notes, and snippets.

@blacksheep557
Created July 22, 2021 09:39
Show Gist options
  • Select an option

  • Save blacksheep557/7aec6cd27d62c924dfc9f6aa742daa8e to your computer and use it in GitHub Desktop.

Select an option

Save blacksheep557/7aec6cd27d62c924dfc9f6aa742daa8e to your computer and use it in GitHub Desktop.
async moveToInterview(application, interview) {
const user = await userApi.getUser(application.userId);
const teacherName = user.name.split(' ')[0];
const interviewDateStr = moment(interview.startTime).tz("Asia/Jakarta").format("DD-MMM @ HH:mm z");
const demoClassGroupChat = await skypeApi.createInterviewChannel(`Online class with teacher ${teacherName}`, []);
application.demoChatUrl = demoClassGroupChat.joinUrl;
deskApi.mailOnTicket(application.ticketNumber, user.email, "Teacher application - invitation to interview", interviewMailTemplate(user, application, interview));
await slackApi.notifyTeacherInterviewsChannel(`*Interview appointed*: _${teacherName}_ on ${interviewDateStr}. Find a student!`);
await deskApi.commentOnTicket(application.ticketId, `Remind teacher about their interview on ${interviewDateStr}. Do we have a student? Did they join skype?`);
deskApi.updateTicket(application.ticketId, {
status: "TU - results sent - interview requested",
dueDate: moment(interview.startTime).subtract(1, 'day').toISOString()
});
},
async moveToPrepCall(application, prepCall) {
const user = await userApi.getUser(application.userId);
const teacherName = user.name.split(' ')[0];
const prepCallDateStr = moment(prepCall.startTime).tz("Asia/Jakarta").format("DD-MMM @ HH:mm z");
const interviewGroupChat = await skypeApi.createInterviewChannel(`Prepcall ${teacherName} with Cerah - ${prepCallDateStr}`, []);
application.interviewChatUrl = interviewGroupChat.joinUrl;
await slackApi.notifyTeacherInterviewsChannel(`*Prepcall appointed*: _${teacherName}_ on ${prepCallDateStr}. Find a student!`);
await deskApi.commentOnTicket(application.ticketId, `Remind teacher about their prepcall on ${prepCallDateStr}.`);
deskApi.updateTicket(application.ticketId, {
status: "TU - results sent - prepcall requested",
dueDate: moment(prepCall.startTime).subtract(1, 'day').toISOString()
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment