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
104 changes: 104 additions & 0 deletions egov-persister/btr-persister.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
serviceMaps:
serviceName: btr-services
mappings:
- version: 1.0
description: Persists birth details in tables
fromTopic: save-bt-application
isTransaction: true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

YAML syntax error: tab character present.

YAML does not allow tabs. This line has a tab at the end, causing a parser error (see YAMLlint).

Apply this diff to remove the tab:

-      isTransaction: true	
+      isTransaction: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
isTransaction: true
isTransaction: true
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 7-7: syntax error: found character '\t' that cannot start any token

(syntax)

🤖 Prompt for AI Agents
In egov-persister/btr-persister.yml around line 7, the value line
"isTransaction: true" contains a trailing tab character which causes a YAML
syntax error; remove the tab and replace it with spaces (or delete the trailing
whitespace) so the line ends with standard spaces/newline, ensure the file uses
spaces instead of tabs throughout, and re-run the YAML linter to confirm the
file parses correctly.

queryMaps:

- query: INSERT INTO eg_bt_registration(id,tenantid,applicationnumber,babyfirstname,babylastname,fatherid,motherid,doctorname,hospitalname,placeofbirth,timeofbirth,createdby,lastmodifiedby,createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?);
basePath: BirthRegistrationApplications.*
jsonMaps:
- jsonPath: $.BirthRegistrationApplications.*.id

- jsonPath: $.BirthRegistrationApplications.*.tenantId

- jsonPath: $.BirthRegistrationApplications.*.applicationNumber

- jsonPath: $.BirthRegistrationApplications.*.babyFirstName

- jsonPath: $.BirthRegistrationApplications.*.babyLastName

- jsonPath: $.BirthRegistrationApplications.*.fatherOfApplicant.id

- jsonPath: $.BirthRegistrationApplications.*.motherOfApplicant.id

- jsonPath: $.BirthRegistrationApplications.*.doctorName

- jsonPath: $.BirthRegistrationApplications.*.hospitalName

- jsonPath: $.BirthRegistrationApplications.*.placeOfBirth

- jsonPath: $.BirthRegistrationApplications.*.timeOfBirth

- jsonPath: $.BirthRegistrationApplications.*.auditDetails.createdBy

- jsonPath: $.BirthRegistrationApplications.*.auditDetails.lastModifiedBy

- jsonPath: $.BirthRegistrationApplications.*.auditDetails.createdTime

- jsonPath: $.BirthRegistrationApplications.*.auditDetails.lastModifiedTime

- query: INSERT INTO eg_bt_address(id, tenantid, doorno, latitude, longitude, buildingname, addressid, addressnumber, type, addressline1, addressline2, landmark, street, city, locality, pincode, detail, registrationid, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
basePath: BirthRegistrationApplications.*
jsonMaps:
- jsonPath: $.BirthRegistrationApplications.*.address.id

- jsonPath: $.BirthRegistrationApplications.*.address.tenantId

- jsonPath: $.BirthRegistrationApplications.*.address.doorNo

- jsonPath: $.BirthRegistrationApplications.*.address.latitude

- jsonPath: $.BirthRegistrationApplications.*.address.longitude

- jsonPath: $.BirthRegistrationApplications.*.address.buildingName

- jsonPath: $.BirthRegistrationApplications.*.address.addressId

- jsonPath: $.BirthRegistrationApplications.*.address.addressNumber

- jsonPath: $.BirthRegistrationApplications.*.address.type

- jsonPath: $.BirthRegistrationApplications.*.address.addressLine1

- jsonPath: $.BirthRegistrationApplications.*.address.addressLine2

- jsonPath: $.BirthRegistrationApplications.*.address.landmark

- jsonPath: $.BirthRegistrationApplications.*.address.street

- jsonPath: $.BirthRegistrationApplications.*.address.city

- jsonPath: $.BirthRegistrationApplications.*.address.locality.name

- jsonPath: $.BirthRegistrationApplications.*.address.pincode

- jsonPath: $.BirthRegistrationApplications.*.address.detail

- jsonPath: $.BirthRegistrationApplications.*.id

- jsonPath: $.BirthRegistrationApplications.*.address.createdBy

- jsonPath: $.BirthRegistrationApplications.*.address.lastModifiedBy

- jsonPath: $.BirthRegistrationApplications.*.address.createdTime

- jsonPath: $.BirthRegistrationApplications.*.address.lastModifiedTime
Comment on lines +82 to +88
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Address audit fields mapped from address.*; likely should use application auditDetails.

Typical eGov payloads carry auditDetails at the root object, and child entities reuse those values. Using address.createdBy/lastModified* will insert NULLs if those fields don’t exist under address and may violate NOT NULL constraints.

Apply this diff to source the audit fields from the application’s auditDetails:

-            - jsonPath: $.BirthRegistrationApplications.*.address.createdBy
-            - jsonPath: $.BirthRegistrationApplications.*.address.lastModifiedBy
-            - jsonPath: $.BirthRegistrationApplications.*.address.createdTime
-            - jsonPath: $.BirthRegistrationApplications.*.address.lastModifiedTime
+            - jsonPath: $.BirthRegistrationApplications.*.auditDetails.createdBy
+            - jsonPath: $.BirthRegistrationApplications.*.auditDetails.lastModifiedBy
+            - jsonPath: $.BirthRegistrationApplications.*.auditDetails.createdTime
+            - jsonPath: $.BirthRegistrationApplications.*.auditDetails.lastModifiedTime


- version: 1.0
description: Update birth registration applications in table
fromTopic: update-bt-application
isTransaction: true
queryMaps:
- query: UPDATE eg_bt_registration SET tenantid = ?,babyFirstName = ?, timeOfBirth = ? WHERE id=?;
basePath: BirthRegistrationApplications.*
jsonMaps:
- jsonPath: $.BirthRegistrationApplications.*.tenantId

- jsonPath: $.BirthRegistrationApplications.*.babyFirstName

- jsonPath: $.BirthRegistrationApplications.*.timeOfBirth

- jsonPath: $.BirthRegistrationApplications.*.id