From f528c893e04b3488b3329700f6277bd2403cabfe Mon Sep 17 00:00:00 2001 From: William Li <52115161+Trollermaner@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:10:11 -0500 Subject: [PATCH] ran prettier --- backend/emails/emails.js | 30 +++++++++++++++------ backend/service/sponsorshipfunds.service.js | 28 ++++++++++++------- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/backend/emails/emails.js b/backend/emails/emails.js index 8b12c7c..0308f65 100644 --- a/backend/emails/emails.js +++ b/backend/emails/emails.js @@ -94,8 +94,12 @@ const getSFTicketInfoHTML = async (sf) => { Sponsorship Fund: ${sf.name}
Allocated Funding: ${sf.funding_allocation}
Funding Spent: ${sf.funding_spent}
- ${sf.proposal_url? `Proposal URL: ${sf.proposal_url}
` : ``} - ${sf.presentation_url? `Presentation URL: ${sf.presentation_url}
` : ``} + ${sf.proposal_url ? `Proposal URL: ${sf.proposal_url}
` : ``} + ${ + sf.presentation_url + ? `Presentation URL: ${sf.presentation_url}
` + : `` + } Status: ${sf.status}
Reporter: ${reporter.displayName} <${reporter.email}>
Created: ${new Date(sf.createdAt).toDateString()}
@@ -275,8 +279,12 @@ const sendEmailPPRReimbursedToReporter = async (ppr) => { const sendEmailSFReimbursementRequestToCoordinator = async (sf) => { const Subject = `[Action Needed] Submit Reimbursement Request ${sf.codename}` - const HTMLPart = getMainMessageHTML(`Claim has been submitted for ${sf.codename}! Please review it and submit a reimbursement request. Visit the ticket link below to confirm you have submitted the reimbursement request.`) - + (await getSFTicketInfoHTML(sf)) + getTicketLinkHTML(sf.path) + const HTMLPart = + getMainMessageHTML( + `Claim has been submitted for ${sf.codename}! Please review it and submit a reimbursement request. Visit the ticket link below to confirm you have submitted the reimbursement request.` + ) + + (await getSFTicketInfoHTML(sf)) + + getTicketLinkHTML(sf.path) const To = await getEmailToSection(sf.reporter_id, [ EMAIL_RECIPIENTS.coordinator, ]) @@ -289,8 +297,12 @@ const sendEmailSFReimbursementRequestToCoordinator = async (sf) => { const sendEmailSFConfirmReimbursementSubmitToCoordinator = async (sf) => { const Subject = `[Action Needed] Confirm Reimbursement Received ${sf.codename}` - const HTMLPart = getMainMessageHTML(`Please visit the ticket link below to confirm you have received the reimbursement for ${sf.codename}.`) - + (await getSFTicketInfoHTML(sf)) + getTicketLinkHTML(sf.path) + const HTMLPart = + getMainMessageHTML( + `Please visit the ticket link below to confirm you have received the reimbursement for ${sf.codename}.` + ) + + (await getSFTicketInfoHTML(sf)) + + getTicketLinkHTML(sf.path) const To = await getEmailToSection(sf.reporter_id, [ EMAIL_RECIPIENTS.coordinator, ]) @@ -303,8 +315,10 @@ const sendEmailSFConfirmReimbursementSubmitToCoordinator = async (sf) => { const sendEmailSFReimbursementReceivedToTeam = async (sf) => { const Subject = `[Reimbursed] ${sf.codename}` - const HTMLPart = getMainMessageHTML(`${sf.codename} has been reimbursed.`) - + (await getSFTicketInfoHTML(sf)) + getTicketLinkHTML(sf.path) + const HTMLPart = + getMainMessageHTML(`${sf.codename} has been reimbursed.`) + + (await getSFTicketInfoHTML(sf)) + + getTicketLinkHTML(sf.path) const To = await getEmailToSection(sf.reporter_id, [ EMAIL_RECIPIENTS.finance, EMAIL_RECIPIENTS.coordinator, diff --git a/backend/service/sponsorshipfunds.service.js b/backend/service/sponsorshipfunds.service.js index e07f079..9db03ca 100644 --- a/backend/service/sponsorshipfunds.service.js +++ b/backend/service/sponsorshipfunds.service.js @@ -6,7 +6,11 @@ const { getAnnotatedUWFinancePurchasesByIdList, getAnnotatedSponsorshipFundsByIdList, } = require('./annotatedGetters') -const { sendEmailSFReimbursementRequestToCoordinator, sendEmailSFConfirmReimbursementSubmitToCoordinator, sendEmailSFReimbursementReceivedToTeam } = require('../emails/emails') +const { + sendEmailSFReimbursementRequestToCoordinator, + sendEmailSFConfirmReimbursementSubmitToCoordinator, + sendEmailSFReimbursementReceivedToTeam, +} = require('../emails/emails') const getAllSponsorshipFunds = () => { return getAnnotatedSponsorshipFundsByIdList() @@ -51,22 +55,28 @@ const createSponsorshipFund = (body) => { } const updateSponsorshipFund = async (id, body) => { - const newSponsorshipFund = await SponsorshipFund.findByIdAndUpdate(id, body, { - new: true, - }) + const newSponsorshipFund = await SponsorshipFund.findByIdAndUpdate( + id, + body, + { + new: true, + } + ) const annotatedSponsorshipFund = await getSponsorshipFund(id) const status = annotatedSponsorshipFund.status - if (status === "CLAIM_SUBMITTED") { + if (status === 'CLAIM_SUBMITTED') { sendEmailSFReimbursementRequestToCoordinator(annotatedSponsorshipFund) } - - if (status === "SUBMITTED_TO_SF") { - sendEmailSFConfirmReimbursementSubmitToCoordinator(annotatedSponsorshipFund) + + if (status === 'SUBMITTED_TO_SF') { + sendEmailSFConfirmReimbursementSubmitToCoordinator( + annotatedSponsorshipFund + ) } - if (status === "REIMBURSED") { + if (status === 'REIMBURSED') { sendEmailSFReimbursementReceivedToTeam(annotatedSponsorshipFund) }