Uh oh!
There was an error while loading. Please reload this page.
Httpheader content disposition changed - #100
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File ( |
ravishanigarapu
commented
Sep 2, 2025
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java (1)
62-63: Add consumes to POST mapping and reconsider header-based mapping.
- Specify consumes to avoid 415s and be explicit.
- Using headers="Authorization" can break CORS preflight and is redundant if Spring Security enforces auth; verify necessity.
Suggested change:
- @PostMapping(value = "/upload", headers = "Authorization", produces = {- "application/json" })+ @PostMapping(+ value = "/upload",+ headers = "Authorization",+ consumes = MediaType.APPLICATION_JSON_VALUE,+ produces = MediaType.APPLICATION_JSON_VALUE+ )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java(4 hunks)
🔇 Additional comments (2)
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java (2)
35-37: LGTM on switching to composed mapping annotations.Clearer and more idiomatic than generic RequestMapping.
86-87: Confirm intentional behavior change: inline → attachment.This forces download for all file types. If any consumers relied on inline preview (PDF/images), this is a breaking change—confirm client readiness or consider a query flag (e.g., ?disposition=inline).
| import java.net.URLEncoder; | ||
| import java.nio.charset.StandardCharsets; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Don't use URLEncoder for Content-Disposition; use Spring's ContentDisposition (RFC 5987-compliant).
URLEncoder is for form bodies and turns spaces into '+', producing incorrect download filenames. Prefer ContentDisposition and drop the extra non-standard "filename" header.
Apply imports change:
-import java.net.URLEncoder;+import org.springframework.http.ContentDisposition;+import org.springframework.http.InvalidMediaTypeException;📝 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.
| importjava.net.URLEncoder; | |
| importjava.nio.charset.StandardCharsets; | |
| importorg.springframework.http.ContentDisposition; | |
| importorg.springframework.http.InvalidMediaTypeException; | |
| importjava.nio.charset.StandardCharsets; |
🤖 Prompt for AI Agents
In
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java
around lines 24-25, replace the URLEncoder import with Spring's
RFC5987-compliant ContentDisposition import and remove the
StandardCharsets/URLEncoder usage; construct the Content-Disposition header
using org.springframework.http.ContentDisposition (e.g.
ContentDisposition.attachment().filename(filename,
StandardCharsets.UTF_8).build().toString()) and set that single header on the
response, and drop the extra non-standard "filename" header so filenames with
spaces and non-ASCII characters are encoded correctly.
| String fileName = URLEncoder.encode(userSignID.getFileName(), StandardCharsets.UTF_8); | ||
| responseHeaders.set(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\""); | ||
| responseHeaders.set("filename", fileName); | ||
| return ResponseEntity.ok() | ||
| .contentType(MediaType.parseMediaType(userSignID.getFileType())) // or MediaType.APPLICATION_PDF | ||
| .headers(responseHeaders) | ||
| .body(userSignID.getSignature()); |
There was a problem hiding this comment.
Bug: URLEncoder in Content-Disposition breaks filenames; also add safe media-type fallback and length.
Spaces become '+', non-ASCII mis-encoded, and an extra custom "filename" header is unnecessary. Use ContentDisposition with UTF-8, default media type to octet-stream on parse failure, and set Content-Length.
Apply this diff:
- String fileName = URLEncoder.encode(userSignID.getFileName(), StandardCharsets.UTF_8);- responseHeaders.set(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\"");- responseHeaders.set("filename", fileName);-- return ResponseEntity.ok()- .contentType(MediaType.parseMediaType(userSignID.getFileType())) // or MediaType.APPLICATION_PDF- .headers(responseHeaders)- .body(userSignID.getSignature());+ ContentDisposition contentDisposition = ContentDisposition.attachment()+ .filename(userSignID.getFileName(), StandardCharsets.UTF_8)+ .build();+ responseHeaders.setContentDisposition(contentDisposition);++ MediaType mediaType;+ try {+ mediaType = MediaType.parseMediaType(userSignID.getFileType());+ } catch (InvalidMediaTypeException | NullPointerException ex) {+ mediaType = MediaType.APPLICATION_OCTET_STREAM;+ }++ return ResponseEntity.ok()+ .contentType(mediaType)+ .headers(responseHeaders)+ .contentLength(userSignID.getSignature().length)+ .body(userSignID.getSignature());📝 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.
| StringfileName = URLEncoder.encode(userSignID.getFileName(), StandardCharsets.UTF_8); | |
| responseHeaders.set(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\""); | |
| responseHeaders.set("filename", fileName); | |
| returnResponseEntity.ok() | |
| .contentType(MediaType.parseMediaType(userSignID.getFileType())) // or MediaType.APPLICATION_PDF | |
| .headers(responseHeaders) | |
| .body(userSignID.getSignature()); | |
| ContentDispositioncontentDisposition = ContentDisposition.attachment() | |
| .filename(userSignID.getFileName(), StandardCharsets.UTF_8) | |
| .build(); | |
| responseHeaders.setContentDisposition(contentDisposition); | |
| MediaTypemediaType; | |
| try { | |
| mediaType = MediaType.parseMediaType(userSignID.getFileType()); | |
| } catch (InvalidMediaTypeException | NullPointerExceptionex) { | |
| mediaType = MediaType.APPLICATION_OCTET_STREAM; | |
| } | |
| returnResponseEntity.ok() | |
| .contentType(mediaType) | |
| .headers(responseHeaders) | |
| .contentLength(userSignID.getSignature().length) | |
| .body(userSignID.getSignature()); |
🤖 Prompt for AI Agents
In
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java
around lines 94-101, replace the URLEncoder usage and custom "filename" header
with Spring's ContentDisposition builder to correctly encode filenames
(including UTF-8 and non-ASCII) in the Content-Disposition header, remove the
extra "filename" header, parse the media type but fall back to
MediaType.APPLICATION_OCTET_STREAM if parsing fails, and set the Content-Length
header from userSignID.getSignature().length; construct ResponseEntity with
these corrected headers and body.
Uh oh!
There was an error while loading. Please reload this page.
* Bulk registration * Bulk registration * Bulk registration * add userName and password in Bulk registration * add userName and password in Bulk registration * remove unwanted line * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * Httpheader content disposition changed * Coderabbitai comments adrressed * Httpheader content disposition changed (#100) * Httpheader content disposition changed * Coderabbitai comments adrressed * Compile error resolved * fix code * Main branch changes missed (#102) * Feature/signaturerelease (#103) * Main branch changes missed * Signature file changed * Feature/signaturerelease (#104) * Main branch changes missed * Signature file changed * Created new endpoint for Active and DeActive Employee Signature * coderabbit comments addressed * fix:casesheet signature * fix:pom file change * API changes in Signature enhancement for Casesheet (#107) * fix:casesheet signature * fix:pom file change * fix: pom version * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix: amm-1927 send headers only if the request is from the allowed origin * fix: amm-1927 coderabbit fixes * Update regex handling for localhost URLs * Enhance regex pattern for URL matching * Cherry-pick health and version API enhancements to release-3.6.1 (#124) * feat(health,version): add health and version endponts * fix(health): add constant and remove duplicates * fix(health): avoid permanent DEGRADED from historical deadlocks * fix(health): Removed the unnecessary boolean literal * fix(health): Fixed the broken lock-wait detection * fix(health): avoid blocking DB I/O under write lock and restore interrupt flag * fix(health): add cancelFutures in healthservice * fix(health): close basic DB connection before advanced checks and remove shared-map race * fix: merge 3.6.1 to main --------- Co-authored-by: Saurav Mishra <saurav.mishra@bizbrolly.com> Co-authored-by: Sushant <77480199+sushant-bizbrolly@users.noreply.github.com> Co-authored-by: Saurav Mishra <80103738+SauravBizbRolly@users.noreply.github.com> Co-authored-by: Mithun James <drtechie@users.noreply.github.com> Co-authored-by: Ravi Shanigarapu <ravi.shanigarapu@wipro.com> Co-authored-by: ravishanigarapu <133210792+ravishanigarapu@users.noreply.github.com> Co-authored-by: vishwab1 <vishwanath@navadhiti.com> Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com> Co-authored-by: SnehaRH <77656297+snehar-nd@users.noreply.github.com> Co-authored-by: Amoghavarsh <93114621+5Amogh@users.noreply.github.com> Co-authored-by: 5Amogh <amoghavarsh@navadhiti.com> Co-authored-by: KOPPIREDDY DURGA PRASAD <144464542+DurgaPrasad-54@users.noreply.github.com>
* Bulk registration * Bulk registration * Bulk registration * add userName and password in Bulk registration * add userName and password in Bulk registration * remove unwanted line * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * Httpheader content disposition changed * Coderabbitai comments adrressed * Httpheader content disposition changed (#100) * Httpheader content disposition changed * Coderabbitai comments adrressed * Compile error resolved * fix code * Main branch changes missed (#102) * Feature/signaturerelease (#103) * Main branch changes missed * Signature file changed * Feature/signaturerelease (#104) * Main branch changes missed * Signature file changed * Created new endpoint for Active and DeActive Employee Signature * coderabbit comments addressed * Update pom.xml * Cherry-pick the commits related to 3.5.0 form 3.6.0 (#106) * Compile error resolved * fix: cherry pic the #101 pr * fix: cherry pic the #101 pr * Main branch changes missed * fix: cherry pic the #103 pr * fix: cherry pic the #104 pr * fix: cherry pic the #104 pr * fix: cherry pick the #104 pr * fix code rabbit comments --------- Co-authored-by: Ravi Shanigarapu <ravi.shanigarapu@wipro.com> * fix:casesheet signature * fix:pom file change * API changes in Signature enhancement for Casesheet (#107) * fix:casesheet signature * fix:pom file change * fix: pom version * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix: amm-1927 send headers only if the request is from the allowed origin * fix: amm-1927 coderabbit fixes * Update regex handling for localhost URLs * Enhance regex pattern for URL matching * fix code * fix code * fix vulnerabilitie code * fix security hotspots * fixed conflicts * Add facility hierarchy creation with village and parent-child mapping (#121) * fix:changed the pom xml * fix: added facilty type master change * feat: created facility creation * fix: rabiit review fix * fix: rabiit review fix * fix: rabiit review fix * fix: pom version * fix: facility hierarchy and facility type management (#125) * fix:changed the pom xml * fix: added facilty type master change * feat: created facility creation * feat:added work location * feat:added work location * fix: rabiit review fix * fix: rabiit review fix * fix: rabiit review fix * fix: ui chnges * fix: pom version * fix: corrections * fix: facilty hierachy * fix: facility heirachy * fix: remove logs folder from repository Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add logs/ to .gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Facility hierarchy inventory mapping and store field management (#128) * fix:changed the pom xml * fix: added facilty type master change * feat: created facility creation * feat:added work location * feat:added work location * fix: rabiit review fix * fix: rabiit review fix * fix: rabiit review fix * fix: ui chnges * fix: pom version * fix: corrections * fix: facilty hierachy * fix: facility heirachy * fix: item facility mapping and store updates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fixed inventory flow --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * merge 3.6.2 to release 3.8.1 (#132) * Cherry-pick health and version API enhancements to release-3.6.1 (#124) * feat(health,version): add health and version endponts * fix(health): add constant and remove duplicates * fix(health): avoid permanent DEGRADED from historical deadlocks * fix(health): Removed the unnecessary boolean literal * fix(health): Fixed the broken lock-wait detection * fix(health): avoid blocking DB I/O under write lock and restore interrupt flag * fix(health): add cancelFutures in healthservice * fix(health): close basic DB connection before advanced checks and remove shared-map race * feat: expose account lock state in SearchEmployee4 (#129) Co-authored-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com> * Fix the reset password issue (#131) * fix: reset password * fix: build issue * fix: update the url * fix: update config properties * fix: initialize constructor --------- Co-authored-by: KOPPIREDDY DURGA PRASAD <144464542+DurgaPrasad-54@users.noreply.github.com> Co-authored-by: Varun Deep Saini <deep.sa@rippling.com> Co-authored-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com> Co-authored-by: Vanitha S <116701245+vanitha1822@users.noreply.github.com> --------- Co-authored-by: Saurav Mishra <saurav.mishra@bizbrolly.com> Co-authored-by: Sushant <77480199+sushant-bizbrolly@users.noreply.github.com> Co-authored-by: Saurav Mishra <80103738+SauravBizbRolly@users.noreply.github.com> Co-authored-by: Mithun James <drtechie@users.noreply.github.com> Co-authored-by: Ravi Shanigarapu <ravi.shanigarapu@wipro.com> Co-authored-by: ravishanigarapu <133210792+ravishanigarapu@users.noreply.github.com> Co-authored-by: Amoghavarsh <93114621+5Amogh@users.noreply.github.com> Co-authored-by: SnehaRH <77656297+snehar-nd@users.noreply.github.com> Co-authored-by: vishwab1 <vishwanath@navadhiti.com> Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com> Co-authored-by: 5Amogh <amoghavarsh@navadhiti.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: KOPPIREDDY DURGA PRASAD <144464542+DurgaPrasad-54@users.noreply.github.com> Co-authored-by: Varun Deep Saini <deep.sa@rippling.com> Co-authored-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com>
* Bulk registration * Bulk registration * Bulk registration * add userName and password in Bulk registration * add userName and password in Bulk registration * remove unwanted line * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * Httpheader content disposition changed * Coderabbitai comments adrressed * Httpheader content disposition changed (#100) * Httpheader content disposition changed * Coderabbitai comments adrressed * Compile error resolved * fix code * Main branch changes missed (#102) * Feature/signaturerelease (#103) * Main branch changes missed * Signature file changed * Feature/signaturerelease (#104) * Main branch changes missed * Signature file changed * Created new endpoint for Active and DeActive Employee Signature * coderabbit comments addressed * Update pom.xml * Cherry-pick the commits related to 3.5.0 form 3.6.0 (#106) * Compile error resolved * fix: cherry pic the #101 pr * fix: cherry pic the #101 pr * Main branch changes missed * fix: cherry pic the #103 pr * fix: cherry pic the #104 pr * fix: cherry pic the #104 pr * fix: cherry pick the #104 pr * fix code rabbit comments --------- Co-authored-by: Ravi Shanigarapu <ravi.shanigarapu@wipro.com> * fix:casesheet signature * fix:pom file change * API changes in Signature enhancement for Casesheet (#107) * fix:casesheet signature * fix:pom file change * fix: pom version * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix code * fix: amm-1927 send headers only if the request is from the allowed origin * fix: amm-1927 coderabbit fixes * Update regex handling for localhost URLs * Enhance regex pattern for URL matching * fix code * fix code * fix vulnerabilitie code * fix security hotspots * fixed conflicts * Add facility hierarchy creation with village and parent-child mapping (#121) * fix:changed the pom xml * fix: added facilty type master change * feat: created facility creation * fix: rabiit review fix * fix: rabiit review fix * fix: rabiit review fix * fix: pom version * fix: facility hierarchy and facility type management (#125) * fix:changed the pom xml * fix: added facilty type master change * feat: created facility creation * feat:added work location * feat:added work location * fix: rabiit review fix * fix: rabiit review fix * fix: rabiit review fix * fix: ui chnges * fix: pom version * fix: corrections * fix: facilty hierachy * fix: facility heirachy * fix: remove logs folder from repository Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add logs/ to .gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Facility hierarchy inventory mapping and store field management (#128) * fix:changed the pom xml * fix: added facilty type master change * feat: created facility creation * feat:added work location * feat:added work location * fix: rabiit review fix * fix: rabiit review fix * fix: rabiit review fix * fix: ui chnges * fix: pom version * fix: corrections * fix: facilty hierachy * fix: facility heirachy * fix: item facility mapping and store updates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fixed inventory flow --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * merge 3.6.2 to release 3.8.1 (#132) * Cherry-pick health and version API enhancements to release-3.6.1 (#124) * feat(health,version): add health and version endponts * fix(health): add constant and remove duplicates * fix(health): avoid permanent DEGRADED from historical deadlocks * fix(health): Removed the unnecessary boolean literal * fix(health): Fixed the broken lock-wait detection * fix(health): avoid blocking DB I/O under write lock and restore interrupt flag * fix(health): add cancelFutures in healthservice * fix(health): close basic DB connection before advanced checks and remove shared-map race * feat: expose account lock state in SearchEmployee4 (#129) Co-authored-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com> * Fix the reset password issue (#131) * fix: reset password * fix: build issue * fix: update the url * fix: update config properties * fix: initialize constructor --------- Co-authored-by: KOPPIREDDY DURGA PRASAD <144464542+DurgaPrasad-54@users.noreply.github.com> Co-authored-by: Varun Deep Saini <deep.sa@rippling.com> Co-authored-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com> Co-authored-by: Vanitha S <116701245+vanitha1822@users.noreply.github.com> * fix: avoid ONLY_FULL_GROUP_BY violation in service lookup queries GROUP BY sm.serviceName selected non-aggregated, non-functionally-dependent columns (serviceID, isNational, statusID), which MySQL rejects under ONLY_FULL_GROUP_BY. Use SELECT DISTINCT instead since no aggregation is actually needed. * fix: bulk employee registration sets username from contact number instead of username field mUser.setUserName(employee.getContactNo()) was using the uploaded contact number as the login username, ignoring the actual UserName column in the bulk upload sheet. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add Nikshay location master for Stop TB (TU/Facility) and complete duplicate-mapping fix - New isolated tables/entities: NikshayTU, NikshayFacility, NikshayVillageFacilityMapping, with read-only cascading lookup endpoints (NikshayLocationController) — no existing master tables touched. - M_UserServiceRoleMapping2 gains NikshayTUID/NikshayFacilityID (nullable, additive), persisted on both create and update save paths. - Complete the pre-existing softDeleteOldMappings fix by adding the missing service interface/impl methods the controller already called. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * feat(nikshay): replace AMRIT-village-matching with independent Nikshay hierarchy Nikshay's TU/Facility/Village hierarchy was previously matched against AMRIT's existing state/district/block/village masters by name. That approach left ~44% of villages unmatched in practice — partly from incomplete migration runs, partly from real staleness in AMRIT's own district/block data (e.g. Andhra Pradesh's 2022 district reorganization never propagated to m_districtblock/m_DistrictBranchMapping). Replace it with a fully self-contained Nikshay hierarchy (NikshayState, NikshayDistrict, NikshayTU, NikshayFacility, NikshayVillage) sourced directly from Nikshay's own imported data, with no AMRIT matching involved. Verified: 100% village coverage (325,426/325,426) vs the previous approach's ~56%. NikshayLocationController's endpoints keep the same paths and query params, now backed by the new tables. * fix(nikshay): store NikshayTUID/NikshayFacilityID as comma-joined String Admin-UI now saves one row per user-role with a comma-joined list of TU/Facility IDs instead of one row per TU x Facility combination, so the DB columns became TEXT. Update the entity and the request-body DTO (Previleges1097_3) to match — both were still Integer, which would have failed to deserialize a value like "12,45,78". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * feat(nikshay): add endpoint to read back saved TU/Facility/District for Edit v_userservicerolemapping (and its entity, what the Admin-UI's mapped-list screen reads) never exposes DistrictID/NikshayTUID/NikshayFacilityID, only legacy AMRIT WorkingDistrictID/WorkingDistrictName - always null for Stop TB, which never populates WorkingLocationID. Edit had no way to read back what was saved, so the TU/Facility/Village pickers always loaded empty. Reads m_userservicerolemapping directly by USRMappingID (reusing the existing EmployeeMasterRepo.findByUSRMappingID), same pattern as the FLW-API worklist-scope query - additive only, the shared view and every other service line reading it stay untouched. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: add missing @transactional to softDeleteOldMappings InvalidDataAccessApiUsageException: "Executing an update/delete query" - a @Modifying UPDATE query with no surrounding transaction. Pre-existing bug in shared code (updateUserRoleMapping, used by every service line), dormant until now: Stop TB's Edit form was always invalid before today's fixes (Update button permanently disabled), so nothing ever reached this code path through Stop TB specifically. Same pattern the other @Modifying query in this file already follows correctly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(nikshay): stop patching District with AMRIT lookup for Stop TB getMappedRole()'s null-district patch (getDirectStateDistrictByMappingIDs) joins the raw DistrictID column against AMRIT's m_district - correct for HWC/FLW, where that column genuinely holds an AMRIT district ID. Stop TB's DistrictID holds a Nikshay district ID instead, so the same join resolves to whatever AMRIT district happens to share that numeric ID by coincidence (e.g. Nikshay's Angul, ID 292, resolving to AMRIT's Uttar Kannad, also ID 292) - showing a completely wrong, unrelated district name in the mapped-users list. Skip the District patch for Stop TB rows specifically; State/Block patching is untouched since those values are genuinely AMRIT-sourced even for Stop TB. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Add Nikshay location master for Stop TB (TU/Facility) and complete duplicate-mapping fix - New isolated tables/entities: NikshayTU, NikshayFacility, NikshayVillageFacilityMapping, with read-only cascading lookup endpoints (NikshayLocationController) — no existing master tables touched. - M_UserServiceRoleMapping2 gains NikshayTUID/NikshayFacilityID (nullable, additive), persisted on both create and update save paths. - Complete the pre-existing softDeleteOldMappings fix by adding the missing service interface/impl methods the controller already called. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Saurav Mishra <saurav.mishra@bizbrolly.com> Co-authored-by: Sushant <77480199+sushant-bizbrolly@users.noreply.github.com> Co-authored-by: Saurav Mishra <80103738+SauravBizbRolly@users.noreply.github.com> Co-authored-by: Mithun James <drtechie@users.noreply.github.com> Co-authored-by: Ravi Shanigarapu <ravi.shanigarapu@wipro.com> Co-authored-by: ravishanigarapu <133210792+ravishanigarapu@users.noreply.github.com> Co-authored-by: Amoghavarsh <93114621+5Amogh@users.noreply.github.com> Co-authored-by: SnehaRH <77656297+snehar-nd@users.noreply.github.com> Co-authored-by: 5Amogh <amoghavarsh@navadhiti.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: KOPPIREDDY DURGA PRASAD <144464542+DurgaPrasad-54@users.noreply.github.com> Co-authored-by: Varun Deep Saini <deep.sa@rippling.com> Co-authored-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com> Co-authored-by: Vanitha S <116701245+vanitha1822@users.noreply.github.com>



📋 Description
JIRA ID: AMM-1807
Active Signature per doctor
✅ Type of Change
ℹ️ Additional Information
Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.
Summary by CodeRabbit
Bug Fixes
Refactor