Repository navigation
feat(meghalaya): ANM self-registration API - #231
Merged
Merged
Conversation
New public route /public/v8/meghalayaUserCreation for the eagle-fusion form at /meghalaya/register/anm: - otp/sendOtp, otp/resendOtp, otp/validateOtp: MSG91, phone and OTP checked before calling it. - createUser: Joi-validated (same rules as the form; unknown fields and any designation other than ANM-Meghalaya are refused). New users are created in the Meghalaya org; existing aastrika / SPhere Team 1 users are migrated; users of any other org are refused. The profile stores DOB (DD/MM/YYYY), gender, qualification, district (postal address), block, facilityType, facilityName, facilityCode (HFR id), deployedFrom, serviceType, appointedBy, designation ANM-Meghalaya and profession Healthcare Worker. Org id and channel come from MEGHALAYA_ORG_ID / MEGHALAYA_ORG_NAME; until both are set createUser answers 503 rather than creating users in the wrong org. Logs keep only posting details and a masked phone.
Designation stored for Meghalaya ANMs is now ANM_MEGHALAYA. MEGHALAYA_ORG_ID / MEGHALAYA_ORG_NAME default to the prod org (0147136950185410561469, Department of Health and Family Welfare, Meghalaya); env vars still override per environment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backend for the Meghalaya ANM self-registration form (eagle-fusion
/meghalaya/register). Ships with the eagle-fusion PR on the same branch name; deploy both together.Changes
publicApi_v8/meghalayaUser.ts: OTP send/resend/validate via MSG91,/createUsercreates the user in the Meghalaya org (or moves an existing user there) and fills the profile. Joi-validated;facilityCodemust be an HFR id (IN+ 10 digits) or empty.ANM_MEGHALAYA, professionHealthcare Worker.MEGHALAYA_ORG_ID/MEGHALAYA_ORG_NAMEdefault to the prod org0147136950185410561469/Department of Health and Family Welfare, Meghalaya.Testing
meghalayaUser.test.ts(19).Deploy notes
MEGHALAYA_ORG_ID/MEGHALAYA_ORG_NAMEto that environment's org, next toBNRC_USER_ORGANISATION_ID, and restart ui-proxy.