Skip to content

Commit

Permalink
Facility dynamic generate for source microplan (#1046)
Browse files Browse the repository at this point in the history
* fixed target validate for different tabs not present

* resource activity persisting in db

* added timeout of 2 sec for boundary entity to persist

* added code for generating facility template if source is microplan

* updated name
  • Loading branch information
nitish-egov authored Jul 11, 2024
1 parent f00410f commit 5c9b617
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion utilities/project-factory/src/server/utils/genericUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,14 @@ function setDropdownFromSchema(request: any, schema: any, localizationMap?: { [k

async function createFacilitySheet(request: any, allFacilities: any[], localizationMap?: { [key: string]: string }) {
const tenantId = request?.query?.tenantId;
const schema = await callMdmsTypeSchema(request, tenantId, "facility");
const responseFromCampaignSearch = await getCampaignSearchResponse(request);
const isSourceMicroplan = checkIfSourceIsMicroplan(responseFromCampaignSearch?.CampaignDetails?.[0]);
let schema: any;
if (isSourceMicroplan) {
schema = await callMdmsTypeSchema(request, tenantId, "facility", "microplan");
} else {
schema = await callMdmsTypeSchema(request, tenantId, "facility");
}
const keys = schema?.columns;
setDropdownFromSchema(request, schema, localizationMap);
const headers = ["HCM_ADMIN_CONSOLE_FACILITY_CODE", ...keys]
Expand Down

0 comments on commit 5c9b617

Please sign in to comment.