Skip to content
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

Upload User and Catchment data #1214

Open
Tracked by #1588
mahalakshme opened this issue May 7, 2024 · 2 comments
Open
Tracked by #1588

Upload User and Catchment data #1214

mahalakshme opened this issue May 7, 2024 · 2 comments
Assignees

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented May 7, 2024

Need:

  1. Currently we are not doing validations on data/presence of data. This leads to issues like below:
  1. We expect country code to be mentioned for phone numbers and we dont give user friendly message when it is missing. And neither it is expected when user creates users via webapp. And we have hardcoded to support only Indian mobile numbers.

https://avni.freshdesk.com/a/tickets/3413, https://avni.freshdesk.com/a/tickets/2863, https://avni.freshdesk.com/a/tickets/2494, https://avni.freshdesk.com/a/tickets/2663

  1. Sometimes error messages are not understandable for the users eventhough we provide readable error messages.
    https://avni.freshdesk.com/a/tickets/3493

  2. Validation on headers not done:
    https://avni.freshdesk.com/a/tickets/3568

  3. When a user belongs to multiple user groups, they need to be separated by |. But everywhere else generally the separator is ,
    https://avni.freshdesk.com/a/tickets/3902

  4. Other tickets related to error messages and location hierarchy spelling mistakes
    https://avni.freshdesk.com/a/tickets/2496
    https://avni.freshdesk.com/a/tickets/2863, https://avni.freshdesk.com/a/tickets/2494

AC: Phone number related

  • Currently we have this regex validation for mobile number "^\\+91[0-9]{10}". Remove it and handle it when receiving the response for AdminCreateUserRequest by catching the exception InvalidParameterException and checking for 'Invalid phone number format' error message. In this case, the error column in CSV need to display as 'Country code not present or incorrect'. This is because validity of mobile numbers are not checked on AWS side.

Image

  • Dont make it mandatory to enter + for phone number. If it is not entered, add + before sending the request to AWS cognito and inserting into db. If it is entered as well fine. This is because entering + on excel for a mobile number converts it into exponential format.
  • When the mobile numbers are prefixed with 91 or +91 make sure the number of digits that follows are ten in number.
  • When values for mandatory fields not present in the uploaded data then display the error in the error column of CSV as Value for 'Mobile number' column is missing in the respective row.

AC: Others

  • CSV upload to work with comma separator for user groups as well instead of bar symbol.
  • When location in the column 'Location with full hierarchy' is not present in Avni, then error message is 'Provided Location does not exist. Please check for spelling mistakes '%s''. Instead make the message to 'Provided Location does not exist in Avni. Please add it or check for spelling mistakes '%s''' . Reason: When we say doesn't exist, users dont realise we mean in Avni context.
  • Even if descriptor row present/not present as part of uploaded data, upload of data should work fine.
  • In the location with full hierarchy, the upload should have the same behaviour, independent of the case of the location. Say Kerala->Kasaragod is the location hierarchy, it should work even if the upload file contains, kerala->kasaragod

References:

https://countrycode.org/
https://www.quora.com/How-is-each-country-code-defined
Phone number format as per cognito user pool mentioned here: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html

@petmongrels petmongrels self-assigned this May 22, 2024
petmongrels added a commit to avniproject/avni-server that referenced this issue May 22, 2024
…phone number checking. picking country code from account. removed phone number regex properties/variables.
petmongrels added a commit to avniproject/avni-server that referenced this issue May 22, 2024
…ormatting logic with PhoneNumberUtil that uses google library.
@vinayvenu
Copy link
Member

Need QA scenarios for the phone number changes in behaviour

@petmongrels
Copy link
Contributor

petmongrels commented May 23, 2024

Phone numbers

  • https://avni.readme.io/docs/phone-number-formats
  • error message for phone numbers will be based on the library error messages
  • +91 1111 1111 is invalid phone number, but the error will come only when saving as the front end validator seems to allow it.

Testing

  • Glific contact addition
  • Create/update users with phone numbers
  • Phone numbers in forms

Location with hierarchy

  • The code already handles case insensitive matches. The tickets are quite old.

Descriptor row

  • not implemented, as the sample story is not done yet.
  • adding this AC to the sample card (avni-product/issues/1531)

petmongrels added a commit to avniproject/avni-server that referenced this issue May 23, 2024
petmongrels added a commit that referenced this issue May 23, 2024
…r phone number in multiple formats as used in real world - hence removed message to enter in 10 digits etc.
petmongrels added a commit to avniproject/avni-server that referenced this issue May 23, 2024
petmongrels added a commit to avniproject/avni-server that referenced this issue May 23, 2024
petmongrels added a commit to avniproject/avni-server that referenced this issue May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Review Ready
Development

No branches or pull requests

3 participants