Skip to content

Commit

Permalink
config updates according to devops (#1197)
Browse files Browse the repository at this point in the history
* updated readmeconfig for sheet

* added cache for generating target template when only delivery conditions change

* added logic for having only 18 target columns  if exceed i will create one column with  header OTHER_TARGETS

* updated config to fetch from devops accordingly

* Update index.ts
  • Loading branch information
nitish-egov authored and Bhavya-egov committed Aug 12, 2024
1 parent f059085 commit 81fe187
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions utilities/project-factory/src/server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const getDBSchemaName = (dbSchema = "") => {
// Configuration object containing various environment variables
const config = {
cacheTime : 300,
enableDynamicTemplateFor: ["MR-DN"],
isCallGenerateWhenDeliveryConditionsDiffer: true,
enableDynamicTemplateFor: process.env.ENABLE_DYNAMIC_TEMPLATE_FOR || "MR-DN",
isCallGenerateWhenDeliveryConditionsDiffer: process.env.IS_CALL_GENERATE_WHEN_DELIVERY_CONDITIONS_DIFFER || false,
prefixForMicroplanCampaigns: "MP",
excludeHierarchyTypeFromBoundaryCodes: false,
excludeBoundaryNameAtLastFromBoundaryCodes: false,
excludeHierarchyTypeFromBoundaryCodes: process.env.EXCLUDE_HIERARCHY_TYPE_FROM_BOUNDARY_CODES || false,
excludeBoundaryNameAtLastFromBoundaryCodes: process.env.EXCLUDE_BOUNDARY_NAME_AT_LAST_FROM_BOUNDARY_CODES || false,
masterNameForSchemaOfColumnHeaders: "adminSchema",
masterNameForSplitBoundariesOn: "hierarchyConfig",
boundary: {
Expand Down
3 changes: 2 additions & 1 deletion utilities/project-factory/src/server/utils/targetUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ async function updateTargetColumnsIfDeliveryConditionsDifferForSMC(request: any)

function isDynamicTargetTemplateForProjectType(projectType: string) {
const projectTypesFromConfig = config?.enableDynamicTemplateFor;
return projectTypesFromConfig?.includes(projectType) ?? false;
const projectTypesArray = projectTypesFromConfig ? projectTypesFromConfig.split(',') : [];
return projectTypesArray.includes(projectType);
}


Expand Down

0 comments on commit 81fe187

Please sign in to comment.