From 87a615d95fc005ba23eecf62148128998c7b59e7 Mon Sep 17 00:00:00 2001 From: Shreya-egov <144668573+Shreya-egov@users.noreply.github.com> Date: Thu, 30 May 2024 22:55:00 +0530 Subject: [PATCH 1/3] Create project-factory-persister.yml --- egov-persister/project-factory-persister.yml | 187 +++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 egov-persister/project-factory-persister.yml diff --git a/egov-persister/project-factory-persister.yml b/egov-persister/project-factory-persister.yml new file mode 100644 index 00000000..e797f30f --- /dev/null +++ b/egov-persister/project-factory-persister.yml @@ -0,0 +1,187 @@ +serviceMaps: + serviceName: API Resource Service + mappings: + - version: 1.0 + name: CreateResourceDetails + description: Create resource details in the eg_cm_resource_details table + fromTopic: create-resource-details + isTransaction: true + queryMaps: + - query: INSERT INTO health.eg_cm_resource_details(id, "status", tenantId, fileStoreId,processedFileStoreId,"action", campaignId,"type", createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails) VALUES (?, ?,?, ?,?,?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.ResourceDetails + jsonMaps: + - jsonPath: $.ResourceDetails.id + - jsonPath: $.ResourceDetails.status + - jsonPath: $.ResourceDetails.tenantId + - jsonPath: $.ResourceDetails.fileStoreId + - jsonPath: $.ResourceDetails.processedFileStoreId + - jsonPath: $.ResourceDetails.action + - jsonPath: $.ResourceDetails.campaignId + - jsonPath: $.ResourceDetails.type + - jsonPath: $.ResourceDetails.auditDetails.createdBy + - jsonPath: $.ResourceDetails.auditDetails.createdTime + - jsonPath: $.ResourceDetails.auditDetails.lastModifiedBy + - jsonPath: $.ResourceDetails.auditDetails.lastModifiedTime + - jsonPath: $.ResourceDetails.additionalDetails + type: JSON + dbType: JSONB + + + + - version: 1.0 + name: UpdateResourceDetails + description: Update resource details in the eg_cm_resource_details table + fromTopic: update-resource-details + isTransaction: true + queryMaps: + - query: UPDATE health.eg_cm_resource_details SET "status" = ?, processedFileStoreId = ?, lastModifiedBy = ?, lastModifiedTime = ?,additionalDetails = ? WHERE id = ?; + basePath: $.ResourceDetails + jsonMaps: + - jsonPath: $.ResourceDetails.status + - jsonPath: $.ResourceDetails.processedFileStoreId + - jsonPath: $.ResourceDetails.auditDetails.lastModifiedBy + - jsonPath: $.ResourceDetails.auditDetails.lastModifiedTime + - jsonPath: $.ResourceDetails.additionalDetails + type: JSON + dbType: JSONB + - jsonPath: $.ResourceDetails.id + + + - version: 1.0 + name: CreateResourceActivity + description: Create resource activity in the eg_cm_resource_activity table + fromTopic: create-resource-activity + isTransaction: true + queryMaps: + - query: INSERT INTO health.eg_cm_resource_activity (id, "status", retryCount,tenantId, type, url, requestPayload, responsePayload, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails, resourceDetailsId) VALUES (?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?); + basePath: $.Activities.* + jsonMaps: + - jsonPath: $.Activities.*.id + - jsonPath: $.Activities.*.status + - jsonPath: $.Activities.*.retryCount + - jsonPath: $.Activities.*.tenantId + - jsonPath: $.Activities.*.type + - jsonPath: $.Activities.*.url + - jsonPath: $.Activities.*.requestPayload + type: JSON + dbType: JSONB + - jsonPath: $.Activities.*.responsePayload + type: JSON + dbType: JSONB + - jsonPath: $.Activities.*.auditDetails.createdBy + - jsonPath: $.Activities.*.auditDetails.createdTime + - jsonPath: $.Activities.*.auditDetails.lastModifiedBy + - jsonPath: $.Activities.*.auditDetails.lastModifiedTime + - jsonPath: $.Activities.*.additionalDetails + type: JSON + dbType: JSONB + - jsonPath: $.Activities.*.resourceDetailsId + + + - version: 1.0 + name: CreateForGenerateApiResources + description: Create Api resource in the eg_cm_generated_resource_details table + fromTopic: create-generated-resource-details + isTransaction: true + queryMaps: + - query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails) VALUES (?,?,?,?,?,?,?,?,?,?,?,?); + basePath: generatedResource.* + jsonMaps: + - jsonPath: $.generatedResource.*.id + - jsonPath: $.generatedResource.*.fileStoreid + - jsonPath: $.generatedResource.*.type + - jsonPath: $.generatedResource.*.status + - jsonPath: $.generatedResource.*.count + - jsonPath: $.generatedResource.*.tenantId + - jsonPath: $.generatedResource.*.hierarchyType + - jsonPath: $.generatedResource.*.auditDetails.createdBy + - jsonPath: $.generatedResource.*.auditDetails.createdTime + - jsonPath: $.generatedResource.*.auditDetails.lastModifiedBy + - jsonPath: $.generatedResource.*.auditDetails.lastModifiedTime + - jsonPath: $.generatedResource.*.additionalDetails + type: JSON + dbType: JSONB + + + + + - version: 1.0 + name: UpdateForGenerateApiResources + description: Update Api resource in the eg_cm_generated_resource_details table + fromTopic: update-generated-resource-details + isTransaction: true + queryMaps: + - query: UPDATE health.eg_cm_generated_resource_details SET status = ?,count=?, lastModifiedby =? , lastModifiedtime = ? , fileStoreid= ?, additionalDetails= ? WHERE id= ?; + basePath: generatedResource.* + jsonMaps: + - jsonPath: $.generatedResource.*.status + - jsonPath: $.generatedResource.*.count + - jsonPath: $.generatedResource.*.auditDetails.lastModifiedBy + - jsonPath: $.generatedResource.*.auditDetails.lastModifiedTime + - jsonPath: $.generatedResource.*.fileStoreid + - jsonPath: $.generatedResource.*.additionalDetails + type: JSON + dbType: JSONB + - jsonPath: $.generatedResource.*.id + + + - version: 1.0 + name: CreateCampaignDetails + description: Create campaign details in the eg_cm_campaign_details table + fromTopic: save-project-campaign-details + isTransaction: true + queryMaps: + - query: INSERT INTO health.eg_cm_campaign_details(id, tenantId, "status","action",campaignName,projectType, campaignNumber,hierarchyType,boundaryCode, projectId,startDate,endDate, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails,campaignDetails) VALUES (?,?,?,?,?, ?,?, ?,?, ?, ?, ?, ?, ?, ?, ?,?,?); + basePath: $.CampaignDetails + jsonMaps: + - jsonPath: $.CampaignDetails.id + - jsonPath: $.CampaignDetails.tenantId + - jsonPath: $.CampaignDetails.status + - jsonPath: $.CampaignDetails.action + - jsonPath: $.CampaignDetails.campaignName + - jsonPath: $.CampaignDetails.projectType + - jsonPath: $.CampaignDetails.campaignNumber + - jsonPath: $.CampaignDetails.hierarchyType + - jsonPath: $.CampaignDetails.boundaryCode + - jsonPath: $.CampaignDetails.projectId + - jsonPath: $.CampaignDetails.startDate + - jsonPath: $.CampaignDetails.endDate + - jsonPath: $.CampaignDetails.auditDetails.createdBy + - jsonPath: $.CampaignDetails.auditDetails.createdTime + - jsonPath: $.CampaignDetails.auditDetails.lastModifiedBy + - jsonPath: $.CampaignDetails.auditDetails.lastModifiedTime + - jsonPath: $.CampaignDetails.additionalDetails + type: JSON + dbType: JSONB + - jsonPath: $.CampaignDetails.campaignDetails + type: JSON + dbType: JSONB + + + - version: 1.0 + name: UpdateCampaignDetails + description: Update campaign details in the eg_cm_campaign_details table + fromTopic: update-project-campaign-details + isTransaction: true + queryMaps: + - query: UPDATE health.eg_cm_campaign_details SET campaignName = ?, "status" = ?, action = ?, projectType = ?, hierarchyType = ?, boundaryCode = ?, projectId = ?,startDate=?,endDate=?, lastModifiedBy = ?, lastModifiedTime = ?, additionalDetails = ?, campaignDetails = ? WHERE id = ?; + basePath: $.CampaignDetails + jsonMaps: + - jsonPath: $.CampaignDetails.campaignName + - jsonPath: $.CampaignDetails.status + - jsonPath: $.CampaignDetails.action + - jsonPath: $.CampaignDetails.projectType + - jsonPath: $.CampaignDetails.hierarchyType + - jsonPath: $.CampaignDetails.boundaryCode + - jsonPath: $.CampaignDetails.projectId + - jsonPath: $.CampaignDetails.startDate + - jsonPath: $.CampaignDetails.endDate + - jsonPath: $.CampaignDetails.auditDetails.lastModifiedBy + - jsonPath: $.CampaignDetails.auditDetails.lastModifiedTime + - jsonPath: $.CampaignDetails.additionalDetails + type: JSON + dbType: JSONB + - jsonPath: $.CampaignDetails.campaignDetails + type: JSON + dbType: JSONB + - jsonPath: $.CampaignDetails.id From 887a19bf5a91f22bcde843d31f44951338370771 Mon Sep 17 00:00:00 2001 From: Shreya-egov <144668573+Shreya-egov@users.noreply.github.com> Date: Thu, 30 May 2024 22:56:06 +0530 Subject: [PATCH 2/3] Create boundary-persister.yml --- egov-persister/boundary-persister.yml | 122 ++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 egov-persister/boundary-persister.yml diff --git a/egov-persister/boundary-persister.yml b/egov-persister/boundary-persister.yml new file mode 100644 index 00000000..e7fe8f5a --- /dev/null +++ b/egov-persister/boundary-persister.yml @@ -0,0 +1,122 @@ +serviceMaps: + serviceName: boundary-Service + mappings: + - version: 1.0 + description: Persists the boundary entity data + fromTopic: create-boundary-entity + isTransaction: true + queryMaps: + - query: INSERT INTO boundary (id, tenantId, code, geometry, additionalDetails, createdBy, lastModifiedBy, createdTime, lastModifiedTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.Boundary.* + jsonMaps: + - jsonPath: $.Boundary.*.id + + - jsonPath: $.Boundary.*.tenantId + + - jsonPath: $.Boundary.*.code + + - jsonPath: $.Boundary.*.geometry + type: JSON + dbType: JSONB + + - jsonPath: $.Boundary.*.additionalDetails + type: JSON + dbType: JSONB + + - jsonPath: $.Boundary.*.auditDetails.createdBy + + - jsonPath: $.Boundary.*.auditDetails.lastModifiedBy + + - jsonPath: $.Boundary.*.auditDetails.createdTime + + - jsonPath: $.Boundary.*.auditDetails.lastModifiedTime + - version: 1.0 + description: Persists the boundary entity data + fromTopic: update-boundary-entity + isTransaction: true + queryMaps: + - query: UPDATE boundary SET geometry = ? , lastModifiedBy = ? , lastModifiedTime = ? WHERE code = ? AND tenantId = ?; + basePath: $.Boundary.* + jsonMaps: + - jsonPath: $.Boundary.*.geometry + type: JSON + dbType: JSONB + + - jsonPath: $.Boundary.*.auditDetails.lastModifiedBy + + - jsonPath: $.Boundary.*.auditDetails.lastModifiedTime + + - jsonPath: $.Boundary.*.code + + - jsonPath: $.Boundary.*.tenantId + - version: 1.0 + description: Persists the boundary hierarchy definition data + fromTopic: save-boundary-hierarchy-definition + isTransaction: true + queryMaps: + - query: INSERT INTO boundary_hierarchy (id, tenantId, hierarchyType, boundaryHierarchy, createdTime, createdBy, lastModifiedTime, lastModifiedBy) VALUES (?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.BoundaryHierarchy + jsonMaps: + - jsonPath: $.BoundaryHierarchy.id + + - jsonPath: $.BoundaryHierarchy.tenantId + + - jsonPath: $.BoundaryHierarchy.hierarchyType + + - jsonPath: $.BoundaryHierarchy.boundaryHierarchyJsonNode + type: JSON + dbType: JSONB + + - jsonPath: $.BoundaryHierarchy.auditDetails.createdTime + + - jsonPath: $.BoundaryHierarchy.auditDetails.createdBy + + - jsonPath: $.BoundaryHierarchy.auditDetails.lastModifiedTime + + - jsonPath: $.BoundaryHierarchy.auditDetails.lastModifiedBy + - version: 1.0 + description: Persists the boundary relationship data + fromTopic: save-boundary-relationship + isTransaction: true + queryMaps: + - query: INSERT INTO boundary_relationship (id, tenantId, code, hierarchyType, boundaryType, parent, ancestralMaterializedPath, createdTime, createdBy, lastModifiedTime, lastModifiedBy) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.BoundaryRelationship + jsonMaps: + - jsonPath: $.BoundaryRelationship.id + + - jsonPath: $.BoundaryRelationship.tenantId + + - jsonPath: $.BoundaryRelationship.code + + - jsonPath: $.BoundaryRelationship.hierarchyType + + - jsonPath: $.BoundaryRelationship.boundaryType + + - jsonPath: $.BoundaryRelationship.parent + + - jsonPath: $.BoundaryRelationship.ancestralMaterializedPath + + - jsonPath: $.BoundaryRelationship.auditDetails.createdTime + + - jsonPath: $.BoundaryRelationship.auditDetails.createdBy + + - jsonPath: $.BoundaryRelationship.auditDetails.lastModifiedTime + + - jsonPath: $.BoundaryRelationship.auditDetails.lastModifiedBy + - version: 1.0 + description: Updates boundary relationship data + fromTopic: update-boundary-relationship + isTransaction: true + queryMaps: + - query: UPDATE boundary_relationship SET parent = ?, ancestralmaterializedpath = ?, lastmodifiedtime = ?, lastmodifiedby = ? WHERE id = ?; + basePath: $.BoundaryRelationshipList.* + jsonMaps: + - jsonPath: $.BoundaryRelationshipList.*.parent + + - jsonPath: $.BoundaryRelationshipList.*.ancestralMaterializedPath + + - jsonPath: $.BoundaryRelationshipList.*.auditDetails.lastModifiedTime + + - jsonPath: $.BoundaryRelationshipList.*.auditDetails.lastModifiedBy + + - jsonPath: $.BoundaryRelationshipList.*.id From 6fb184102d9923e661ae2cb9c8b3b599504fadd1 Mon Sep 17 00:00:00 2001 From: Shreya-egov <144668573+Shreya-egov@users.noreply.github.com> Date: Thu, 30 May 2024 22:56:06 +0530 Subject: [PATCH 3/3] Create boundary-persister.yml --- egov-persister/boundary-persister.yml | 122 ++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 egov-persister/boundary-persister.yml diff --git a/egov-persister/boundary-persister.yml b/egov-persister/boundary-persister.yml new file mode 100644 index 00000000..e7fe8f5a --- /dev/null +++ b/egov-persister/boundary-persister.yml @@ -0,0 +1,122 @@ +serviceMaps: + serviceName: boundary-Service + mappings: + - version: 1.0 + description: Persists the boundary entity data + fromTopic: create-boundary-entity + isTransaction: true + queryMaps: + - query: INSERT INTO boundary (id, tenantId, code, geometry, additionalDetails, createdBy, lastModifiedBy, createdTime, lastModifiedTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.Boundary.* + jsonMaps: + - jsonPath: $.Boundary.*.id + + - jsonPath: $.Boundary.*.tenantId + + - jsonPath: $.Boundary.*.code + + - jsonPath: $.Boundary.*.geometry + type: JSON + dbType: JSONB + + - jsonPath: $.Boundary.*.additionalDetails + type: JSON + dbType: JSONB + + - jsonPath: $.Boundary.*.auditDetails.createdBy + + - jsonPath: $.Boundary.*.auditDetails.lastModifiedBy + + - jsonPath: $.Boundary.*.auditDetails.createdTime + + - jsonPath: $.Boundary.*.auditDetails.lastModifiedTime + - version: 1.0 + description: Persists the boundary entity data + fromTopic: update-boundary-entity + isTransaction: true + queryMaps: + - query: UPDATE boundary SET geometry = ? , lastModifiedBy = ? , lastModifiedTime = ? WHERE code = ? AND tenantId = ?; + basePath: $.Boundary.* + jsonMaps: + - jsonPath: $.Boundary.*.geometry + type: JSON + dbType: JSONB + + - jsonPath: $.Boundary.*.auditDetails.lastModifiedBy + + - jsonPath: $.Boundary.*.auditDetails.lastModifiedTime + + - jsonPath: $.Boundary.*.code + + - jsonPath: $.Boundary.*.tenantId + - version: 1.0 + description: Persists the boundary hierarchy definition data + fromTopic: save-boundary-hierarchy-definition + isTransaction: true + queryMaps: + - query: INSERT INTO boundary_hierarchy (id, tenantId, hierarchyType, boundaryHierarchy, createdTime, createdBy, lastModifiedTime, lastModifiedBy) VALUES (?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.BoundaryHierarchy + jsonMaps: + - jsonPath: $.BoundaryHierarchy.id + + - jsonPath: $.BoundaryHierarchy.tenantId + + - jsonPath: $.BoundaryHierarchy.hierarchyType + + - jsonPath: $.BoundaryHierarchy.boundaryHierarchyJsonNode + type: JSON + dbType: JSONB + + - jsonPath: $.BoundaryHierarchy.auditDetails.createdTime + + - jsonPath: $.BoundaryHierarchy.auditDetails.createdBy + + - jsonPath: $.BoundaryHierarchy.auditDetails.lastModifiedTime + + - jsonPath: $.BoundaryHierarchy.auditDetails.lastModifiedBy + - version: 1.0 + description: Persists the boundary relationship data + fromTopic: save-boundary-relationship + isTransaction: true + queryMaps: + - query: INSERT INTO boundary_relationship (id, tenantId, code, hierarchyType, boundaryType, parent, ancestralMaterializedPath, createdTime, createdBy, lastModifiedTime, lastModifiedBy) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.BoundaryRelationship + jsonMaps: + - jsonPath: $.BoundaryRelationship.id + + - jsonPath: $.BoundaryRelationship.tenantId + + - jsonPath: $.BoundaryRelationship.code + + - jsonPath: $.BoundaryRelationship.hierarchyType + + - jsonPath: $.BoundaryRelationship.boundaryType + + - jsonPath: $.BoundaryRelationship.parent + + - jsonPath: $.BoundaryRelationship.ancestralMaterializedPath + + - jsonPath: $.BoundaryRelationship.auditDetails.createdTime + + - jsonPath: $.BoundaryRelationship.auditDetails.createdBy + + - jsonPath: $.BoundaryRelationship.auditDetails.lastModifiedTime + + - jsonPath: $.BoundaryRelationship.auditDetails.lastModifiedBy + - version: 1.0 + description: Updates boundary relationship data + fromTopic: update-boundary-relationship + isTransaction: true + queryMaps: + - query: UPDATE boundary_relationship SET parent = ?, ancestralmaterializedpath = ?, lastmodifiedtime = ?, lastmodifiedby = ? WHERE id = ?; + basePath: $.BoundaryRelationshipList.* + jsonMaps: + - jsonPath: $.BoundaryRelationshipList.*.parent + + - jsonPath: $.BoundaryRelationshipList.*.ancestralMaterializedPath + + - jsonPath: $.BoundaryRelationshipList.*.auditDetails.lastModifiedTime + + - jsonPath: $.BoundaryRelationshipList.*.auditDetails.lastModifiedBy + + - jsonPath: $.BoundaryRelationshipList.*.id