Skip to content

feat(meghalaya): ANM self-registration API - #231

Merged
likhithThammegowda merged 2 commits into
masterfrom
feature/meghalaya-anm-registration
Dec 1, 2026
Merged

likhithThammegowda merged 2 commits into
masterfrom
feature/meghalaya-anm-registration

Conversation

@likhithThammegowda

Copy link
Copy Markdown

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

  • feat(meghalaya): ANM self-registration API (92b55bf) – publicApi_v8/meghalayaUser.ts: OTP send/resend/validate via MSG91, /createUser creates the user in the Meghalaya org (or moves an existing user there) and fills the profile. Joi-validated; facilityCode must be an HFR id (IN + 10 digits) or empty.
  • feat(meghalaya): ANM_MEGHALAYA designation and prod org defaults (43a7144) – designation ANM_MEGHALAYA, profession Healthcare Worker. MEGHALAYA_ORG_ID / MEGHALAYA_ORG_NAME default to the prod org 0147136950185410561469 / Department of Health and Family Welfare, Meghalaya.

Testing

  • Jest: meghalayaUser.test.ts (19).
  • Pre-push build passed.

Deploy notes

  • Prod: no env change needed (defaults are the prod org).
  • Any other environment (stage): set MEGHALAYA_ORG_ID / MEGHALAYA_ORG_NAME to that environment's org, next to BNRC_USER_ORGANISATION_ID, and restart ui-proxy.

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.
@likhithThammegowda
likhithThammegowda merged commit 0c1076a into master Dec 1, 2026
1 check failed
@likhithThammegowda
likhithThammegowda deleted the feature/meghalaya-anm-registration branch December 1, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant