diff --git a/src/common/utils/constants/host.constant.ts b/src/common/utils/constants/host.constant.ts index d5ac757..3c21f1a 100644 --- a/src/common/utils/constants/host.constant.ts +++ b/src/common/utils/constants/host.constant.ts @@ -28,6 +28,7 @@ export const LAST_QUESTION_ID = { } export const ACTIVITY_INTERNAL_STATUS = { + DRAFT_PQ: 'Draft - PQ', APPROVED: 'Approved', REJECTED: 'Rejected', DRAFT: 'Draft', @@ -36,6 +37,25 @@ export const ACTIVITY_INTERNAL_STATUS = { } export const ACTIVITY_DISPLAY_STATUS = { + DRAFT_PQ: 'Draft - PQ', + APPROVED: 'Approved', + REJECTED: 'Rejected', + DRAFT: 'Draft', + UNDER_REVIEW: 'Under-Review', + PQQ_FAILED: 'PQQ Failed' +} + +export const ACTIVITY_AM_INTERNAL_STATUS = { + DRAFT_PQ: 'Draft - PQ', + APPROVED: 'Approved', + REJECTED: 'Rejected', + DRAFT: 'Draft', + UNDER_REVIEW: 'Under-Review', + PQQ_FAILED: 'PQQ Failed' +} + +export const ACTIVITY_AM_DISPLAY_STATUS = { + DRAFT_PQ: 'Draft - PQ', APPROVED: 'Approved', REJECTED: 'Rejected', DRAFT: 'Draft', diff --git a/src/modules/host/handlers/Host_Admin/onboarding/signUp.ts b/src/modules/host/handlers/Host_Admin/onboarding/signUp.ts index 178a893..7bd2d08 100644 --- a/src/modules/host/handlers/Host_Admin/onboarding/signUp.ts +++ b/src/modules/host/handlers/Host_Admin/onboarding/signUp.ts @@ -85,7 +85,7 @@ export const handler = safeHandler(async ( } // Send OTP email outside the DB transaction - // await sendOtpEmailForHost(transactionResult.newUser.emailAddress, transactionResult.otp); + await sendOtpEmailForHost(transactionResult.newUser.emailAddress, transactionResult.otp); return { statusCode: 200, diff --git a/src/modules/host/services/host.service.ts b/src/modules/host/services/host.service.ts index be0d416..01c7103 100644 --- a/src/modules/host/services/host.service.ts +++ b/src/modules/host/services/host.service.ts @@ -12,6 +12,8 @@ import { User } from '@prisma/client'; import { z } from 'zod'; import { hostCompanyDetailsSchema } from '@/common/utils/validation/host/hostCompanyDetails.validation'; import { + ACTIVITY_AM_DISPLAY_STATUS, + ACTIVITY_AM_INTERNAL_STATUS, ACTIVITY_DISPLAY_STATUS, ACTIVITY_INTERNAL_STATUS, HOST_STATUS_DISPLAY, HOST_STATUS_INTERNAL, STEPPER, @@ -791,28 +793,6 @@ export class HostService { const overallPercentage = totalMaxPoints > 0 ? (totalUserPoints / totalMaxPoints) * 100 : 0; - if (overallPercentage > 50) { - await this.prisma.activities.update({ - where: { - id: activityXid - }, - data: { - activityInternalStatus: ACTIVITY_INTERNAL_STATUS.UNDER_REVIEW, - activityDisplayStatus: ACTIVITY_DISPLAY_STATUS.UNDER_REVIEW - } - }) - } else { - await this.prisma.activities.update({ - where: { - id: activityXid - }, - data: { - activityInternalStatus: ACTIVITY_INTERNAL_STATUS.PQQ_FAILED, - activityDisplayStatus: ACTIVITY_DISPLAY_STATUS.PQQ_FAILED - } - }) - } - // ---------- 🔥 ONLY FIRST 2 CATEGORIES ---------- const categoryArray = Object.values(categories); @@ -1072,7 +1052,10 @@ export class HostService { hostXid: host.id, activityTypeXid: activityTypeXid, frequenciesXid: frequenciesXid || null, - isActive: true, + activityInternalStatus: ACTIVITY_INTERNAL_STATUS.DRAFT_PQ, + activityDisplayStatus: ACTIVITY_DISPLAY_STATUS.DRAFT_PQ, + amInternalStatus: ACTIVITY_AM_INTERNAL_STATUS.DRAFT_PQ, + amDisplayStatus: ACTIVITY_AM_DISPLAY_STATUS.DRAFT_PQ, }, });