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

Restrict duplicate phone numbers #841

Open
Tracked by #1686
mahalakshme opened this issue Dec 19, 2024 · 2 comments
Open
Tracked by #1686

Restrict duplicate phone numbers #841

mahalakshme opened this issue Dec 19, 2024 · 2 comments
Assignees

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Dec 19, 2024

Need:

  • Restrict duplicate phone numbers to 5. If two farmers have the same name, then don't count them as duplicates
  • This card includes some minor implementation work as well, to make sure end-to-end it works efficiently.

Suggested technical approach:

  • Add a custom query that returns the no of individuals with same phone number but different first name and last name than the ones in the request. For farmers with same name and same mobile numbers should not be counted as 2.
  • Make validation rule async(for both mobile app and DEA) - refer this . Suggest doing in form element or form element group rule unless we are sure it will cause performance issues.
  • From the mobile app validation rule, call /executeQuery api and show the error stating 'Number of times this mobile number can be used has exceeded than the allowed limit' if the number of duplicate mobile numbers with different names exceed 5. This error message should be translatable.
  • If API call doesn't go through, then show the error 'Switch on your internet connection.' This error message should be translatable.

AC:

Implement the above need by identifying a suitable technical approach.

@mahalakshme mahalakshme converted this from a draft issue Dec 19, 2024
@mahalakshme mahalakshme changed the title [Spike] Restrict duplicate phone numbers Restrict duplicate phone numbers Dec 19, 2024
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Dec 19, 2024
@mahalakshme mahalakshme moved this from In Analysis Review to Ready in Avni Product Dec 20, 2024
@petmongrels petmongrels self-assigned this Dec 25, 2024
@petmongrels petmongrels moved this from Ready to In Progress in Avni Product Dec 25, 2024
petmongrels added a commit that referenced this issue Dec 26, 2024
petmongrels added a commit to avniproject/avni-client that referenced this issue Dec 26, 2024
@petmongrels
Copy link
Contributor

For implementation team to use. tested with this.

https://gist.github.com/petmongrels/6bd7c4bae474a0b820063eab1b4fa7ea

@petmongrels
Copy link
Contributor

Validation rule is not supported in the data entry app currently.

@petmongrels petmongrels moved this from In Progress to Code Review Ready in Avni Product Dec 26, 2024
@mahalakshme mahalakshme moved this from Code Review Ready to In Code Review in Avni Product Dec 30, 2024
petmongrels added a commit that referenced this issue Jan 2, 2025
…ds causing rule failure telemetry to not work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Code Review
Development

No branches or pull requests

2 participants