Merge branch 'mayankSprint2' of http://git.wdipl.com/Mayank.Mishra/MinglarBackendNestJS into paritosh-main1
This commit is contained in:
@@ -78,6 +78,7 @@ export const ACTIVITY_AM_INTERNAL_STATUS = {
|
||||
ACTIVITY_REJECTED: 'Activity Rejected',
|
||||
ACTIVITY_APPROVED: 'Activity Approved',
|
||||
ACTIVITY_LISTED: 'Activity Listed',
|
||||
ACTIVITY_SUBMITED: 'Activity Submitted',
|
||||
};
|
||||
|
||||
export const ACTIVITY_AM_DISPLAY_STATUS = {
|
||||
@@ -93,9 +94,10 @@ export const ACTIVITY_AM_DISPLAY_STATUS = {
|
||||
REVISED: 'Revised',
|
||||
|
||||
ACTIVITY_DRAFT: 'Draft - Activity',
|
||||
ACTIVITY_NEW: 'To Review',
|
||||
ACTIVITY_NEW: 'New',
|
||||
ACTIVITY_TO_REVIEW: 'Activity To Review',
|
||||
ACTIVITY_ENHANCING: 'Enhancing',
|
||||
NOT_LISTED: 'Not Listed',
|
||||
ACTIVITY_LISTED: 'Listed',
|
||||
ACITIVITY_REVISED:'Activity Revised'
|
||||
ACTIVITY_REVISED:'Activity Revised'
|
||||
};
|
||||
|
||||
@@ -156,9 +156,9 @@ export const handler = safeHandler(async (event: APIGatewayProxyEvent): Promise<
|
||||
const pqqAnswerXid = Number(fields.pqqAnswerXid);
|
||||
const comments = fields.comments || null;
|
||||
|
||||
if (!activityXid || isNaN(activityXid)) throw new ApiError(400, "Valid activityXid is required");
|
||||
if (!pqqQuestionXid || isNaN(pqqQuestionXid)) throw new ApiError(400, "Valid pqqQuestionXid is required");
|
||||
if (!pqqAnswerXid || isNaN(pqqAnswerXid)) throw new ApiError(400, "Valid pqqAnswerXid is required");
|
||||
if (!activityXid || isNaN(activityXid)) throw new ApiError(400, "Please provide a valid activity");
|
||||
if (!pqqQuestionXid || isNaN(pqqQuestionXid)) throw new ApiError(400, "Please select a valid question");
|
||||
if (!pqqAnswerXid || isNaN(pqqAnswerXid)) throw new ApiError(400, "Please select a valid answer");
|
||||
|
||||
// 6) UPSERT header
|
||||
const existingHeader = await hostService.findHeaderByCompositeKey(
|
||||
|
||||
@@ -147,9 +147,9 @@ export const handler = safeHandler(async (event: APIGatewayProxyEvent): Promise<
|
||||
const pqqAnswerXid = Number(fields.pqqAnswerXid);
|
||||
const comments = fields.comments || null;
|
||||
|
||||
if (!activityXid || isNaN(activityXid)) throw new ApiError(400, "Valid activityXid is required");
|
||||
if (!pqqQuestionXid || isNaN(pqqQuestionXid)) throw new ApiError(400, "Valid pqqQuestionXid is required");
|
||||
if (!pqqAnswerXid || isNaN(pqqAnswerXid)) throw new ApiError(400, "Valid pqqAnswerXid is required");
|
||||
if (!activityXid || isNaN(activityXid)) throw new ApiError(400, "Please provide a valid activity");
|
||||
if (!pqqQuestionXid || isNaN(pqqQuestionXid)) throw new ApiError(400, "Please select a valid question");
|
||||
if (!pqqAnswerXid || isNaN(pqqAnswerXid)) throw new ApiError(400, "Please select a valid answer");
|
||||
|
||||
// 6) UPSERT header
|
||||
const existingHeader = await pqqService.findHeaderByCompositeKey(
|
||||
|
||||
@@ -2007,6 +2007,15 @@ export class HostService {
|
||||
},
|
||||
},
|
||||
},
|
||||
frequency: {
|
||||
where: {
|
||||
isActive: true
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
frequencyName: true
|
||||
}
|
||||
},
|
||||
ActivityAmenities: {
|
||||
where: {
|
||||
isActive: true,
|
||||
@@ -2598,18 +2607,18 @@ export class HostService {
|
||||
activityInternalStatus = ACTIVITY_INTERNAL_STATUS.ACTIVITY_SUBMITTED;
|
||||
activityDisplayStatus = ACTIVITY_DISPLAY_STATUS.ACTIVITY_IN_REVIEW;
|
||||
amInternalStatus = ACTIVITY_AM_INTERNAL_STATUS.ACTIVITY_TO_REVIEW;
|
||||
amDisplayStatus = ACTIVITY_AM_DISPLAY_STATUS.ACITIVITY_REVISED;
|
||||
amDisplayStatus = ACTIVITY_AM_DISPLAY_STATUS.ACTIVITY_REVISED;
|
||||
}
|
||||
} else {
|
||||
if (isDraft) {
|
||||
activityInternalStatus = ACTIVITY_INTERNAL_STATUS.ACTIVITY_DRAFT;
|
||||
activityDisplayStatus = ACTIVITY_DISPLAY_STATUS.ACTIVITY_DRAFT;
|
||||
amInternalStatus = ACTIVITY_AM_INTERNAL_STATUS.ACTIVITY_DRAFT;
|
||||
amDisplayStatus = ACTIVITY_AM_DISPLAY_STATUS.ACTIVITY_DRAFT;
|
||||
amInternalStatus = existingActivity.amInternalStatus;
|
||||
amDisplayStatus = existingActivity.amDisplayStatus;
|
||||
} else {
|
||||
activityInternalStatus = ACTIVITY_INTERNAL_STATUS.ACTIVITY_SUBMITTED;
|
||||
activityDisplayStatus = ACTIVITY_DISPLAY_STATUS.ACTIVITY_IN_REVIEW;
|
||||
amInternalStatus = ACTIVITY_AM_INTERNAL_STATUS.ACTIVITY_TO_REVIEW;
|
||||
amInternalStatus = ACTIVITY_AM_INTERNAL_STATUS.ACTIVITY_SUBMITED;
|
||||
amDisplayStatus = ACTIVITY_AM_DISPLAY_STATUS.ACTIVITY_NEW;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,6 +839,10 @@ export class MinglarService {
|
||||
internal: MINGLAR_STATUS_INTERNAL.AM_REJECTED,
|
||||
display: MINGLAR_STATUS_DISPLAY.ENHANCING,
|
||||
},
|
||||
Approved: {
|
||||
internal: MINGLAR_STATUS_INTERNAL.AM_APPROVED,
|
||||
display: MINGLAR_STATUS_DISPLAY.APPROVED,
|
||||
}
|
||||
};
|
||||
|
||||
if (applicationStatus?.trim()) {
|
||||
@@ -2051,6 +2055,19 @@ export class MinglarService {
|
||||
id: true,
|
||||
comments: true,
|
||||
pqqAnswerXid: true,
|
||||
activity: {
|
||||
select: {
|
||||
id: true,
|
||||
activityTitle: true,
|
||||
host: {
|
||||
select: {
|
||||
id: true,
|
||||
companyName: true,
|
||||
logoPath: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
pqqQuestions: {
|
||||
select: {
|
||||
id: true,
|
||||
@@ -2120,6 +2137,9 @@ export class MinglarService {
|
||||
id: cat.id,
|
||||
categoryName: cat.categoryName,
|
||||
displayOrder: cat.displayOrder,
|
||||
hostId: item.activity.host.id,
|
||||
hostCompanyName: item.activity.host.companyName,
|
||||
hostLogoPath: item.activity.host.logoPath,
|
||||
pqqsubCategories: [],
|
||||
};
|
||||
} else if (!grouped[cat.id].activityPqqHeaderId) {
|
||||
|
||||
Reference in New Issue
Block a user