Skip to content
Open
Changes from all commits
Commits
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
156 changes: 131 additions & 25 deletions configs/egov-persister/egov-survey-service-persister.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,35 +182,141 @@ 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: 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
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_ss_survey_entity (uuid,tenantid, title, category, description, startdate, enddate, postedby, active, answerscount, hasresponded) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
basePath: SurveyEntity
jsonMaps:
- jsonPath: $.SurveyEntity.uuid
- jsonPath: $.SurveyEntity.tenantId
- 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.*
jsonMaps:
- jsonPath: $.SurveyEntity.sections.*.uuid
- jsonPath: $.SurveyEntity.uuid
- jsonPath: $.SurveyEntity.sections.*.title
- jsonPath: $.SurveyEntity.sections.*.weightage

- query: INSERT INTO eg_ss_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