diff --git a/egov-persister/mdms-persister.yml b/egov-persister/mdms-persister.yml new file mode 100644 index 000000000..69b9e2fcf --- /dev/null +++ b/egov-persister/mdms-persister.yml @@ -0,0 +1,83 @@ +serviceMaps: + serviceName: Mdms-Service + mappings: + - version: 1.0 + description: Persists the schema definition + fromTopic: save-mdms-schema-definition + isTransaction: true + queryMaps: + - query: INSERT INTO eg_mdms_schema_definition (id ,tenantid, code, description, definition, isactive, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.SchemaDefinition + jsonMaps: + - jsonPath: $.SchemaDefinition.id + + - jsonPath: $.SchemaDefinition.tenantId + + - jsonPath: $.SchemaDefinition.code + + - jsonPath: $.SchemaDefinition.description + + - jsonPath: $.SchemaDefinition.definition + type: JSON + dbType: JSONB + + - jsonPath: $.SchemaDefinition.isActive + + - jsonPath: $.SchemaDefinition.auditDetails.createdBy + + - jsonPath: $.SchemaDefinition.auditDetails.lastModifiedBy + + - jsonPath: $.SchemaDefinition.auditDetails.createdTime + + - jsonPath: $.SchemaDefinition.auditDetails.lastModifiedTime + + + - version: 1.0 + description: Persists the mdms data + fromTopic: save-mdms-data + isTransaction: true + queryMaps: + - query: INSERT INTO eg_mdms_data (id, tenantid, uniqueidentifier, schemacode, data, isactive, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.Mdms + jsonMaps: + - jsonPath: $.Mdms.id + + - jsonPath: $.Mdms.tenantId + + - jsonPath: $.Mdms.uniqueIdentifier + + - jsonPath: $.Mdms.schemaCode + + - jsonPath: $.Mdms.data + type: JSON + dbType: JSONB + + - jsonPath: $.Mdms.isActive + + - jsonPath: $.Mdms.auditDetails.createdBy + + - jsonPath: $.Mdms.auditDetails.lastModifiedBy + + - jsonPath: $.Mdms.auditDetails.createdTime + + - jsonPath: $.Mdms.auditDetails.lastModifiedTime + + - version: 1.0 + description: Updates the mdms data + fromTopic: update-mdms-data + isTransaction: true + queryMaps: + - query: UPDATE eg_mdms_data SET data = ?, isActive = ?, lastModifiedBy = ?, lastModifiedTime = ? WHERE id = ?; + basePath: $.Mdms + jsonMaps: + - jsonPath: $.Mdms.data + type: JSON + dbType: JSONB + + - jsonPath: $.Mdms.isActive + + - jsonPath: $.Mdms.auditDetails.lastModifiedBy + + - jsonPath: $.Mdms.auditDetails.lastModifiedTime + + - jsonPath: $.Mdms.id