fix: Stop TB bulk user upload district validation and qualification c… - #140
Conversation
…rash Stop TB bulk user uploads were failing 100% of the time: District validation ran against AMRIT's stale m_District table (missing post-2022 AP districts), and an unmatched Qualification silently resolved to ID 0, crashing the insert on FK_User_UserQualification instead of failing cleanly. The insert gate also only checked for missing fields, not invalid ones, so rows with invalid data still reached the DB. - Route District resolution through Nikshay's own district master (m_nikshay_district) for Stop TB service-line uploads only, via a new serviceProviderID -> ServiceID=12 check; every other service line keeps using m_District unchanged. - Add the missing "Qualification is invalid" validation check. - Fix the insert gate to check validationErrors.isEmpty() instead of a redundant chain that ignored "invalid" (non-empty but unmatched) values.
|
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 ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|



…rash
Stop TB bulk user uploads were failing 100% of the time: District validation ran against AMRIT's stale m_District table (missing post-2022 AP districts), and an unmatched Qualification silently resolved to ID 0, crashing the insert on FK_User_UserQualification instead of failing cleanly. The insert gate also only checked for missing fields, not invalid ones, so rows with invalid data still reached the DB.
📋 Description
JIRA ID:
Please provide a summary of the change and the motivation behind it. Include relevant context and details.
✅ 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.