diff --git a/src/modules/host/handlers/Activity_Hub/OnBoarding/getPQQScore.ts b/src/modules/host/handlers/Activity_Hub/OnBoarding/getPQQScore.ts index 154f15b..5853417 100644 --- a/src/modules/host/handlers/Activity_Hub/OnBoarding/getPQQScore.ts +++ b/src/modules/host/handlers/Activity_Hub/OnBoarding/getPQQScore.ts @@ -8,6 +8,7 @@ import { verifyHostToken } from '../../../../../common/middlewares/jwt/authForHo import { safeHandler } from '../../../../../common/utils/handlers/safeHandler'; import ApiError from '../../../../../common/utils/helper/ApiError'; import { HostService } from '../../../services/host.service'; +import { sendPQPEmailToAM } from '../../../services/sendHostResubmitEmailToAM.service'; const hostService = new HostService(prismaClient); @@ -177,6 +178,15 @@ export const handler = safeHandler(async (event: APIGatewayProxyEvent): Promise< const getAllUpdatedQuestionResponse = await hostService.getAllPQUpdatedResponse(activityXid) + const details = await hostService.getSuggestionDetails(user.id); + + await sendPQPEmailToAM( + details.hostDetails.accountManager.emailAddress, + details.hostDetails.accountManager.firstName, + details.hostDetails.companyName, + details.hostDetails.user.userRefNumber, + ) + // CASE 2 — NO deletion & NO new files => DO NOTHING to existing files return { diff --git a/src/modules/host/handlers/Activity_Hub/OnBoarding/submitPQAnswer.ts b/src/modules/host/handlers/Activity_Hub/OnBoarding/submitPQAnswer.ts index 72d584c..33350e1 100644 --- a/src/modules/host/handlers/Activity_Hub/OnBoarding/submitPQAnswer.ts +++ b/src/modules/host/handlers/Activity_Hub/OnBoarding/submitPQAnswer.ts @@ -8,7 +8,6 @@ import { safeHandler } from '../../../../../common/utils/handlers/safeHandler'; import ApiError from '../../../../../common/utils/helper/ApiError'; import { HostService } from '../../../services/host.service'; import { prismaClient } from '../../../../../common/database/prisma.lambda.service'; -import { sendPQPEmailToAM } from '../../../services/sendHostResubmitEmailToAM.service'; const hostService = new HostService(prismaClient); @@ -273,15 +272,6 @@ export const handler = safeHandler(async (event: APIGatewayProxyEvent): Promise< const allPQPQuestionAnswerResponse = await hostService.getAllPQUpdatedResponse(activityXid) - const details = await hostService.getSuggestionDetails(user.id); - - await sendPQPEmailToAM( - details.hostDetails.accountManager.emailAddress, - details.hostDetails.accountManager.firstName, - details.hostDetails.companyName, - details.hostDetails.user.userRefNumber, - ) - // 11) Compose response const responseMessage = existingHeader ? "PQQ answer updated successfully" : "PQQ answer submitted successfully"; diff --git a/src/modules/host/services/host.service.ts b/src/modules/host/services/host.service.ts index d5224bd..44b566c 100644 --- a/src/modules/host/services/host.service.ts +++ b/src/modules/host/services/host.service.ts @@ -1395,7 +1395,7 @@ export class HostService { hostStatusDisplay = HOST_STATUS_DISPLAY.UNDER_REVIEW; minglarStatusInternal = MINGLAR_STATUS_INTERNAL.AM_TO_REVIEW; - minglarStatusDisplay = MINGLAR_STATUS_DISPLAY.TO_REVIEW; + minglarStatusDisplay = MINGLAR_STATUS_DISPLAY.RE_SUBMITTED; } // CASE 2: Admin has rejected but host can resubmit else if (