-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script to import and reassign CHAs with multiple CHP Areas #241
base: main
Are you sure you want to change the base?
Conversation
@freddieptf This was used to create CHA users in Nairobi this week. Would you kindly review at your convenience? |
* Unit tests passing for reassignment * Refactor to single "import-cha-users" script * Update place contacts * Round of testing
@freddieptf I've updated this scripts to also support CSV-based bulk reassignment of CHUs. It's quite rough. The script does the following:
I considered three approaches for this broadly, focusing on the question "how do you know the username of the CHA who is the recipient of the CHU"
Imlementation notes:
|
function groupByKey(place: Place) { | ||
const subcounty = place.resolvedHierarchy[1]?.name.formatted; | ||
const contactName = place.contact.name; | ||
return `${contactName}@${subcounty}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a higher chance of the CHA's phone number being more unique than their name
Is this necessary for re-assignments? if it's re-assigning then I'm assuming the CHA already exists in some CHU? Couldn't we just use the CHU which is unique and get the primary contact/user from there? |
I gave three options for how to approach this in the text above. Sounds like you are proposing a fourth option here? The inputs you are imagining are something like:
As mentioned above, I took the approach I did because it allows for the same template that exists today (supporting new CHAs, reassigning, replacing, etc all in one template). If you have opinions about the best approach, I am all ears. Or I am available to discuss. Personally, I feel if we are going to support a different template for replacement then we should prompt for the username directly rather than a 2nd CHU. |
CHA today had problems with their account because the contact_id on the user was deleted. Need to update this script to avoid that. |
Script used for Digital Payment task https://app.clickup.com/t/1278154/CHT-13271 to create one account per CHA in Nairobi and Migori.
Here is the input for Nairobi for once the instance is back up.
Progress toward #185
Progress toward #70
cc @eljhkrr as FYI