Skip to content

Commit

Permalink
User mapping campaign (#1292)
Browse files Browse the repository at this point in the history
* feat: Add parentId and isActive columns to eg_cm_campaign_details, remove unique constraint on campaignName

* Fix : user mapping
  • Loading branch information
ashish-egov committed Aug 16, 2024
1 parent 80312f8 commit 91068a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
5 changes: 2 additions & 3 deletions utilities/project-factory/src/server/kafka/Listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ export function listener() {
try {
const messageObject = JSON.parse(message.value?.toString() || '{}');

logger.info(`KAFKA :: LISTENER :: Received a message from topic ${message.topic}`);
logger.debug(`KAFKA :: LISTENER :: Message: ${getFormattedStringForDebug(messageObject)}`);
switch (message.topic) {
case config.kafka.KAFKA_START_CAMPAIGN_MAPPING_TOPIC:
await handleCampaignMapping(messageObject);
break;
default:
logger.warn(`Unhandled topic: ${message.topic}`);
}

logger.info(`KAFKA :: LISTENER :: Received a message from topic ${message.topic}`);
logger.debug(`KAFKA :: LISTENER :: Message: ${getFormattedStringForDebug(messageObject)}`);
} catch (error) {
logger.error(`KAFKA :: LISTENER :: Error processing message: ${error}`);
console.error(error);
Expand Down
18 changes: 9 additions & 9 deletions utilities/project-factory/src/server/utils/campaignUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,32 +190,32 @@ function deterMineLastColumnAndEnrichUserDetails(worksheet: any, errorDetailsCol
}

if (userNameAndPassword) {
worksheet.getCell("I1").value = "UserName";
worksheet.getCell("J1").value = "Password";
worksheet.getCell("J1").value = "UserName";
worksheet.getCell("K1").value = "Password";

// Set the fill color to green for cell I1
worksheet.getCell("I1").fill = {
worksheet.getCell("J1").fill = {
type: 'pattern',
pattern: 'solid',
fgColor: { argb: 'ff9248' } // Green color
};
worksheet.getCell("I1").font = { bold: true };
worksheet.getCell("J1").font = { bold: true };

// Set the fill color to green for cell J1
worksheet.getCell("J1").fill = {
worksheet.getCell("K1").fill = {
type: 'pattern',
pattern: 'solid',
fgColor: { argb: 'ff9248' } // Green color
};
worksheet.getCell("J1").font = { bold: true };
worksheet.getCell("K1").font = { bold: true };

userNameAndPassword.forEach((data: any) => {
const rowIndex = data.rowNumber;
worksheet.getCell(`I${rowIndex}`).value = data?.userName;
worksheet.getCell(`J${rowIndex}`).value = data?.password;
worksheet.getCell(`J${rowIndex}`).value = data?.userName;
worksheet.getCell(`K${rowIndex}`).value = data?.password;
});

lastColumn = "J";
lastColumn = "K";
request.body.userNameAndPassword = undefined;
}

Expand Down

0 comments on commit 91068a7

Please sign in to comment.