From f2876b8d4fa8d22311be10b0e4bf5cf12458651e Mon Sep 17 00:00:00 2001 From: Suhani Kshatriya Date: Tue, 18 Feb 2025 09:59:02 +0530 Subject: [PATCH 1/5] queryMap egov ss fixed --- .../egov-survey-service-persister.yml | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/configs/egov-persister/egov-survey-service-persister.yml b/configs/egov-persister/egov-survey-service-persister.yml index 3deb3f68d..90dc64e57 100644 --- a/configs/egov-persister/egov-survey-service-persister.yml +++ b/configs/egov-persister/egov-survey-service-persister.yml @@ -188,29 +188,29 @@ serviceMaps: fromTopic: insert-scorecard-survey-entity isTransaction: true queryMaps: - - query: INSERT INTO eg_survey_entity (uuid,tenantid, title, category, description, startdate, enddate, postedby, active, answerscount, hasresponded) VALUES (?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL); - basePath: SurveyEntity - jsonMaps: - - jsonPath: $.SurveyEntity.uuid - - jsonPath: $.SurveyEntity.tenantId - - jsonPath: $.SurveyEntity.surveyTitle - - jsonPath: $.SurveyEntity.surveyCategory - - jsonPath: $.SurveyEntity.surveyDescription - - - query: INSERT INTO eg_survey_section(uuid, surveyuuid, title, weightage) VALUES (?, ?, ?, ?); - basePath: SurveyEntity - jsonMaps: - - jsonPath: $.SurveyEntity.sections.*.uuid - - jsonPath: $.SurveyEntity.uuid - - jsonPath: $.SurveyEntity.sections.*.title - - jsonPath: $.SurveyEntity.sections.*.weightage - - - query: INSERT INTO eg_question_weightage(weightage, qorder) VALUES (?, ?); - basePath: SurveyEntity - jsonMaps: - - jsonPath: $.SurveyEntity.sections.*.questions.*.questionUuid - - jsonPath: $.SurveyEntity.sections.*.uuid - - jsonPath: $.SurveyEntity.sections.*.questions.*.weightage - - jsonPath: $.SurveyEntity.sections.*.questions.*.qorder + - query: INSERT INTO eg_survey_entity (uuid,tenantid, title, category, description, startdate, enddate, postedby, active, answerscount, hasresponded) VALUES (?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL); + basePath: SurveyEntity + jsonMaps: + - jsonPath: $.SurveyEntity.uuid + - jsonPath: $.SurveyEntity.tenantId + - jsonPath: $.SurveyEntity.surveyTitle + - jsonPath: $.SurveyEntity.surveyCategory + - jsonPath: $.SurveyEntity.surveyDescription + + - query: INSERT INTO eg_survey_section(uuid, surveyuuid, title, weightage) VALUES (?, ?, ?, ?); + basePath: SurveyEntity.sections.* + jsonMaps: + - jsonPath: $.SurveyEntity.sections.*.uuid + - jsonPath: $.SurveyEntity.uuid + - jsonPath: $.SurveyEntity.sections.*.title + - jsonPath: $.SurveyEntity.sections.*.weightage + + - query: INSERT INTO eg_question_weightage(questionuuid,sectionuuid,weightage, qorder) VALUES (?, ?, ?, ?); + basePath: SurveyEntity.sections.*.questions.* + jsonMaps: + - jsonPath: $.SurveyEntity.sections.*.questions.*.questionUuid + - jsonPath: $.SurveyEntity.sections.*.questions.*.sectionUuid + - jsonPath: $.SurveyEntity.sections.*.questions.*.weightage + - jsonPath: $.SurveyEntity.sections.*.questions.*.qorder \ No newline at end of file From a8b797469a29106bcb0efc12cc795f995dba6997 Mon Sep 17 00:00:00 2001 From: Suhani Kshatriya Date: Tue, 18 Feb 2025 10:29:01 +0530 Subject: [PATCH 2/5] renamed tables updated --- configs/egov-persister/egov-survey-service-persister.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/egov-persister/egov-survey-service-persister.yml b/configs/egov-persister/egov-survey-service-persister.yml index 90dc64e57..d2e7ebea1 100644 --- a/configs/egov-persister/egov-survey-service-persister.yml +++ b/configs/egov-persister/egov-survey-service-persister.yml @@ -188,7 +188,7 @@ serviceMaps: fromTopic: insert-scorecard-survey-entity isTransaction: true queryMaps: - - query: INSERT INTO eg_survey_entity (uuid,tenantid, title, category, description, startdate, enddate, postedby, active, answerscount, hasresponded) VALUES (?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL); + - query: INSERT INTO eg_ss_survey_entity (uuid,tenantid, title, category, description, startdate, enddate, postedby, active, answerscount, hasresponded) VALUES (?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL); basePath: SurveyEntity jsonMaps: - jsonPath: $.SurveyEntity.uuid @@ -197,7 +197,7 @@ serviceMaps: - jsonPath: $.SurveyEntity.surveyCategory - jsonPath: $.SurveyEntity.surveyDescription - - query: INSERT INTO eg_survey_section(uuid, surveyuuid, title, weightage) VALUES (?, ?, ?, ?); + - query: INSERT INTO eg_ss_survey_section(uuid, surveyuuid, title, weightage) VALUES (?, ?, ?, ?); basePath: SurveyEntity.sections.* jsonMaps: - jsonPath: $.SurveyEntity.sections.*.uuid @@ -205,7 +205,7 @@ serviceMaps: - jsonPath: $.SurveyEntity.sections.*.title - jsonPath: $.SurveyEntity.sections.*.weightage - - query: INSERT INTO eg_question_weightage(questionuuid,sectionuuid,weightage, qorder) VALUES (?, ?, ?, ?); + - query: INSERT INTO eg_ss_question_weightage(questionuuid,sectionuuid,weightage, qorder) VALUES (?, ?, ?, ?); basePath: SurveyEntity.sections.*.questions.* jsonMaps: - jsonPath: $.SurveyEntity.sections.*.questions.*.questionUuid From 1317d410fcc3358f3b58a08726edb5467d368059 Mon Sep 17 00:00:00 2001 From: Suhani Kshatriya Date: Tue, 18 Feb 2025 14:16:05 +0530 Subject: [PATCH 3/5] updated --- .../egov-survey-service-persister.yml | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/configs/egov-persister/egov-survey-service-persister.yml b/configs/egov-persister/egov-survey-service-persister.yml index d2e7ebea1..66d4d3918 100644 --- a/configs/egov-persister/egov-survey-service-persister.yml +++ b/configs/egov-persister/egov-survey-service-persister.yml @@ -182,7 +182,38 @@ serviceMaps: - jsonPath: $.SurveyEntity.active - jsonPath: $.SurveyEntity.uuid - + + - version: 1.0 + description: Persists categories in eg_ss_category table + fromTopic: save-ss-category + isTransaction: true + queryMaps: + - query: INSERT INTO eg_ss_category( id,label,tenantid,isactive,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?); + basePath: Categories.* + jsonMaps: + - jsonPath: $.Categories.*.id + - jsonPath: $.Categories.*.label + - jsonPath: $.Categories.*.tenantId + - jsonPath: $.Categories.*.isActive + - jsonPath: $.Categories.*.auditDetails.createdBy + - jsonPath: $.Categories.*.auditDetails.lastModifiedBy + - jsonPath: $.Categories.*.auditDetails.createdTime + - jsonPath: $.Categories.*.auditDetails.lastModifiedTime + + - version: 1.0 + description: Update categories in eg_ss_category table + fromTopic: update-ss-category + isTransaction: true + queryMaps: + - query: UPDATE eg_ss_category SET label = COALESCE(?, label), isactive = COALESCE(?, isactive), lastmodifiedby = ?,lastmodifiedtime = ? WHERE id = ?; + basePath: Categories.* + jsonMaps: + - jsonPath: $.Categories.*.label + - jsonPath: $.Categories.*.isActive + - jsonPath: $.Categories.*.auditDetails.lastModifiedBy + - jsonPath: $.Categories.*.auditDetails.lastModifiedTime + - jsonPath: $.Categories.*.id + - version: 1.0 description: Insert into scorecard survey related tables fromTopic: insert-scorecard-survey-entity From 53ad4b9a51ca742bd8d530d97ff50d74d62a94d2 Mon Sep 17 00:00:00 2001 From: Suhani Kshatriya Date: Tue, 18 Feb 2025 14:33:23 +0530 Subject: [PATCH 4/5] updated --- .../egov-survey-service-persister.yml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/configs/egov-persister/egov-survey-service-persister.yml b/configs/egov-persister/egov-survey-service-persister.yml index 66d4d3918..210febe4f 100644 --- a/configs/egov-persister/egov-survey-service-persister.yml +++ b/configs/egov-persister/egov-survey-service-persister.yml @@ -214,6 +214,75 @@ serviceMaps: - jsonPath: $.Categories.*.auditDetails.lastModifiedTime - jsonPath: $.Categories.*.id + - version: 1.0 + description: Persists categories in eg_ss_category table + fromTopic: save-ss-category + isTransaction: true + queryMaps: + - query: INSERT INTO eg_ss_category( id,label,tenantid,isactive,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?); + basePath: Categories.* + jsonMaps: + - jsonPath: $.Categories.*.id + - jsonPath: $.Categories.*.label + - jsonPath: $.Categories.*.tenantId + - jsonPath: $.Categories.*.isActive + - jsonPath: $.Categories.*.auditDetails.createdBy + - jsonPath: $.Categories.*.auditDetails.lastModifiedBy + - jsonPath: $.Categories.*.auditDetails.createdTime + - jsonPath: $.Categories.*.auditDetails.lastModifiedTime + + - version: 1.0 + description: Update categories in eg_ss_category table + fromTopic: update-ss-category + isTransaction: true + queryMaps: + - query: UPDATE eg_ss_category SET label = COALESCE(?, label), isactive = COALESCE(?, isactive), lastmodifiedby = ?,lastmodifiedtime = ? WHERE id = ?; + basePath: Categories.* + jsonMaps: + - jsonPath: $.Categories.*.label + - jsonPath: $.Categories.*.isActive + - jsonPath: $.Categories.*.auditDetails.lastModifiedBy + - jsonPath: $.Categories.*.auditDetails.lastModifiedTime + - jsonPath: $.Categories.*.id + + - version: 1.0 + description: Persists questions in eg_ss_question table + fromTopic: save-ss-question + isTransaction: true + queryMaps: + - query: INSERT INTO eg_ss_question( uuid,tenantid,surveyid,questionstatement,options,status,type,required,createdby,lastmodifiedby,createdtime,lastmodifiedtime,qorder,categoryid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?); + basePath: Questions.* + jsonMaps: + - jsonPath: $.Questions.*.uuid + - jsonPath: $.Questions.*.tenantId + - jsonPath: $.Questions.*.surveyId + - jsonPath: $.Questions.*.questionStatement + - jsonPath: $.Questions.*.options + type: ARRAY + dbType: STRING + - jsonPath: $.Questions.*.status + - jsonPath: $.Questions.*.type + - jsonPath: $.Questions.*.required + - jsonPath: $.Questions.*.auditDetails.createdBy + - jsonPath: $.Questions.*.auditDetails.lastModifiedBy + - jsonPath: $.Questions.*.auditDetails.createdTime + - jsonPath: $.Questions.*.auditDetails.lastModifiedTime + - jsonPath: $.Questions.*.qorder + - jsonPath: $.Questions.*.categoryId + + - version: 1.0 + description: Update questions in eg_ss_question table + fromTopic: update-ss-question + isTransaction: true + queryMaps: + - query: UPDATE eg_ss_question SET status = COALESCE(?, status), lastmodifiedby = ?,lastmodifiedtime = ? WHERE uuid = ?; + basePath: Questions.* + jsonMaps: + - jsonPath: $.Questions.*.status + - jsonPath: $.Questions.*.auditDetails.lastModifiedBy + - jsonPath: $.Questions.*.auditDetails.lastModifiedTime + - jsonPath: $.Questions.*.uuid + - version: 1.0 description: Insert into scorecard survey related tables fromTopic: insert-scorecard-survey-entity From 722ed8c39c7b5a5357c5e42f55453903888d438c Mon Sep 17 00:00:00 2001 From: Suhani Kshatriya Date: Wed, 19 Feb 2025 10:33:05 +0530 Subject: [PATCH 5/5] updated --- configs/egov-persister/egov-survey-service-persister.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configs/egov-persister/egov-survey-service-persister.yml b/configs/egov-persister/egov-survey-service-persister.yml index 210febe4f..6e3965fe9 100644 --- a/configs/egov-persister/egov-survey-service-persister.yml +++ b/configs/egov-persister/egov-survey-service-persister.yml @@ -288,7 +288,7 @@ serviceMaps: fromTopic: insert-scorecard-survey-entity isTransaction: true queryMaps: - - query: INSERT INTO eg_ss_survey_entity (uuid,tenantid, title, category, description, startdate, enddate, postedby, active, answerscount, hasresponded) VALUES (?, ?, ?, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL); + - query: INSERT INTO eg_ss_survey_entity (uuid,tenantid, title, category, description, startdate, enddate, postedby, active, answerscount, hasresponded) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); basePath: SurveyEntity jsonMaps: - jsonPath: $.SurveyEntity.uuid @@ -296,6 +296,12 @@ serviceMaps: - jsonPath: $.SurveyEntity.surveyTitle - jsonPath: $.SurveyEntity.surveyCategory - jsonPath: $.SurveyEntity.surveyDescription + - jsonPath: $.SurveyEntity.startDate + - jsonPath: $.SurveyEntity.endDate + - jsonPath: $.SurveyEntity.postedBy + - jsonPath: $.SurveyEntity.active + - jsonPath: $.SurveyEntity.answersCount + - jsonPath: $.SurveyEntity.hasResponded - query: INSERT INTO eg_ss_survey_section(uuid, surveyuuid, title, weightage) VALUES (?, ?, ?, ?); basePath: SurveyEntity.sections.*