Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target mr dn #834

Merged
merged 25 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ea9731f
change in filter recursive
nitish-egov May 21, 2024
f761d21
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 21, 2024
cefa966
lowest level
nitish-egov May 21, 2024
577a6a0
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 21, 2024
99e8460
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 22, 2024
40e11f5
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 23, 2024
5a0b0cd
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 28, 2024
b9be47e
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 28, 2024
ca07874
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 28, 2024
0f9d7d5
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 29, 2024
5207560
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 29, 2024
63249b9
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 29, 2024
62aff8e
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 29, 2024
3903614
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 30, 2024
87cd5ee
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 30, 2024
b181c14
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 30, 2024
4df4263
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov May 31, 2024
d7ab75d
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov Jun 3, 2024
3e908cc
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov Jun 5, 2024
0009fb7
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov Jun 7, 2024
cf9a8f4
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov Jun 7, 2024
80cc2da
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov Jun 10, 2024
a7cad1c
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov Jun 11, 2024
0b86778
Merge branch 'campaign' of https://github.com/egovernments/DIGIT-Fron…
nitish-egov Jun 11, 2024
2e71f6e
Feat : skipped validation temporarily
nitish-egov Jun 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions utilities/project-factory/src/server/api/campaignApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { httpRequest } from "../utils/request";
import { getFormattedStringForDebug, logger } from "../utils/logger";
import createAndSearch from '../config/createAndSearch';
import { getDataFromSheet, generateActivityMessage, throwError, translateSchema, replicateRequest } from "../utils/genericUtils";
import { immediateValidationForTargetSheet, validateSheetData, validateTargetSheetData } from '../validators/campaignValidators';
import { validateSheetData, validateTargetSheetData } from '../validators/campaignValidators';
import { callMdmsTypeSchema, getCampaignNumber } from "./genericApis";
import { boundaryBulkUpload, convertToTypeData, generateHierarchy, generateProcessedFileAndPersist, getLocalizedName, reorderBoundariesOfDataAndValidate } from "../utils/campaignUtils";
const _ = require('lodash');
Expand Down Expand Up @@ -494,7 +494,7 @@ async function processValidate(request: any, localizationMap?: { [key: string]:
const dataFromSheet = await getDataFromSheet(request, request?.body?.ResourceDetails?.fileStoreId, request?.body?.ResourceDetails?.tenantId, createAndSearchConfig, null, localizationMap)
if (type == 'boundaryWithTarget') {
logger.info("target sheet format validation started");
immediateValidationForTargetSheet(dataFromSheet, localizationMap);
// immediateValidationForTargetSheet(dataFromSheet, localizationMap);
logger.info("target sheet format validation completed and starts with data validation");
validateTargetSheetData(dataFromSheet, request, createAndSearchConfig?.boundaryValidation, localizationMap);
logger.info("target sheet data validation completed");
Expand Down
32 changes: 16 additions & 16 deletions utilities/project-factory/src/server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { getErrorCodes } from "./constants";
// Defining the HOST variable
const HOST = process.env.EGOV_HOST ||
"https://unified-dev.digit.org/";
"https://unified-qa.digit.org/";
// Checking if HOST is set, if not, exiting the process
if (!HOST) {
console.log("You need to set the HOST variable");
Expand Down Expand Up @@ -48,8 +48,8 @@ const config = {
DB_CONFIG: {
DB_USER: process.env.DB_USER || "postgres",
DB_HOST: process.env.DB_HOST?.split(':')[0] || "localhost",
DB_NAME: process.env.DB_NAME || "postgres",
DB_PASSWORD: process.env.DB_PASSWORD || "postgres",
DB_NAME: process.env.DB_NAME || "postgres2",
DB_PASSWORD: process.env.DB_PASSWORD || "1234",
DB_PORT: process.env.DB_PORT || "5432",
},
// Application configuration
Expand All @@ -73,20 +73,20 @@ const config = {
host: {
serverHost: HOST,
// Kafka broker host
KAFKA_BROKER_HOST: process.env.KAFKA_BROKER_HOST || "kafka-v2.kafka-cluster:9092",
mdms: process.env.EGOV_MDMS_HOST || "https://unified-dev.digit.org/",
mdmsV2: process.env.EGOV_MDMS_V2_HOST || "https://unified-dev.digit.org/",
filestore: process.env.EGOV_FILESTORE_SERVICE_HOST || "https://unified-dev.digit.org/",
KAFKA_BROKER_HOST: process.env.KAFKA_BROKER_HOST || "localhost:9092",
mdms: process.env.EGOV_MDMS_HOST || "https://unified-qa.digit.org/",
mdmsV2: process.env.EGOV_MDMS_V2_HOST || "https://unified-qa.digit.org/",
filestore: process.env.EGOV_FILESTORE_SERVICE_HOST || "https://unified-qa.digit.org/",
projectFactoryBff: "http://localhost:8080/",
idGenHost: process.env.EGOV_IDGEN_HOST || "https://unified-dev.digit.org/",
facilityHost: process.env.EGOV_FACILITY_HOST || "https://unified-dev.digit.org/",
boundaryHost: process.env.EGOV_BOUNDARY_HOST || "https://unified-dev.digit.org/",
projectHost: process.env.EGOV_PROJECT_HOST || "https://unified-dev.digit.org/",
userHost: process.env.EGOV_USER_HOST || "https://unified-dev.digit.org/",
productHost: process.env.EGOV_PRODUCT_HOST || "https://unified-dev.digit.org/",
hrmsHost: process.env.EGOV_HRMS_HOST || "https://unified-dev.digit.org/",
localizationHost: process.env.EGOV_LOCALIZATION_HOST || "https://unified-dev.digit.org/",
healthIndividualHost: process.env.EGOV_HEALTH_INDIVIDUAL_HOST || "https://unified-dev.digit.org/",
idGenHost: process.env.EGOV_IDGEN_HOST || "https://unified-qa.digit.org/",
facilityHost: process.env.EGOV_FACILITY_HOST || "https://unified-qa.digit.org/",
boundaryHost: process.env.EGOV_BOUNDARY_HOST || "https://unified-qa.digit.org/",
projectHost: process.env.EGOV_PROJECT_HOST || "https://unified-qa.digit.org/",
userHost: process.env.EGOV_USER_HOST || "https://unified-qa.digit.org/",
productHost: process.env.EGOV_PRODUCT_HOST || "https://unified-qa.digit.org/",
hrmsHost: process.env.EGOV_HRMS_HOST || "https://unified-qa.digit.org/",
localizationHost: process.env.EGOV_LOCALIZATION_HOST || "https://unified-qa.digit.org/",
healthIndividualHost: process.env.EGOV_HEALTH_INDIVIDUAL_HOST || "https://unified-qa.digit.org/",
},
// Paths for different services
paths: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,6 @@ async function getDifferentTabGeneratedBasedOnConfig(request: any, boundaryDataG
const differentTabsBasedOnLevel = getLocalizedName(config?.boundary?.generateDifferentTabsOnBasisOf, localizationMap);
logger.info(`Boundaries are seperated based on hierarchy type ${differentTabsBasedOnLevel}`)
const isKeyOfThatTypePresent = boundaryData.some((data: any) => data.hasOwnProperty(differentTabsBasedOnLevel));
console.group(isKeyOfThatTypePresent, ";;;;;;;;;;;;;;;;;;")
const boundaryTypeOnWhichWeSplit = boundaryData.filter((data: any) => data[differentTabsBasedOnLevel]);
if (isKeyOfThatTypePresent && boundaryTypeOnWhichWeSplit.length >= parseInt(config?.boundary?.numberOfBoundaryDataOnWhichWeSplit)) {
logger.info(`sinces the conditions are matched boundaries are getting splitted into different tabs`)
Expand Down
3 changes: 0 additions & 3 deletions utilities/project-factory/src/server/utils/excelUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ function lockTargetFields(newSheet: any, columnsNotToBeFreezed: any, boundaryCod

// // Get headers in the first row and filter out empty items
const headers = newSheet.getRow(1).values.filter((header: any) => header);
console.log(headers, "Filtered Headers in the first row");

// Unlock cells in the target columns
if (Array.isArray(columnsNotToBeFreezed) && columnsNotToBeFreezed.length > 0) {
columnsNotToBeFreezed.forEach((header) => {
const targetColumnNumber = headers.indexOf(header) + 1; // Excel columns are 1-based
console.log(`Header: ${header}, Target Column Index: ${targetColumnNumber}`);
if (targetColumnNumber > -1) {
newSheet.eachRow((row: any, rowNumber: number) => {
changeFirstRowColumnColour(newSheet, 'B6D7A8', targetColumnNumber);
Expand All @@ -203,7 +201,6 @@ function lockTargetFields(newSheet: any, columnsNotToBeFreezed: any, boundaryCod
selectLockedCells: true,
selectUnlockedCells: true,
});
console.log('Sheet protection applied:', newSheet.sheetProtection);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ async function fullProcessFlowForNewEntry(newEntryResponse: any, generatedResour
// get boundary sheet data after being generated
logger.info("generating different tabs logic ")
const boundaryDataSheetGeneratedAfterDifferentTabSeparation = await getDifferentTabGeneratedBasedOnConfig(request, boundaryDataSheetGeneratedBeforeDifferentTabSeparation, localizationMap)
console.log(boundaryDataSheetGeneratedAfterDifferentTabSeparation,"afffffffffffff")
logger.info(`Different tabs based on level configured generated, ${JSON.stringify(boundaryDataSheetGeneratedAfterDifferentTabSeparation)}`)
const finalResponse = await getFinalUpdatedResponse(boundaryDataSheetGeneratedAfterDifferentTabSeparation, newEntryResponse, request);
const generatedResourceNew: any = { generatedResource: finalResponse }
Expand Down
Loading
Loading