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

filter codes with map instead of options entries #172

Open
BryceStevenWilley opened this issue Nov 4, 2022 · 0 comments
Open

filter codes with map instead of options entries #172

BryceStevenWilley opened this issue Nov 4, 2022 · 0 comments
Labels
enhancement New feature or request Refactor

Comments

@BryceStevenWilley
Copy link
Contributor

I've so far built filter_codes to take a list of options, which are built for docassemble's choice tuples, each item in the list being a Tuple of the stored value if a choice is shown, and the next is the value shown to the user. This allows users to filter which codes they want to auto select for the user (i.e. the user has already chosen themselves by starting this specific interview, like filing type and case category, etc.) based on the either the Code or the code's human readable name.

It's slightly more powerful to instead filter on the full map object, which maps from the code to the full code object, with each of the specific attributes. This is slightly more powerful, but more difficult to design, since any code can have any attribute (which do you filter first, and which take priority?) Most importantly though, we can end up with exact duplicates, meaning the court has messed up their codes, and there's no practical difference between the different code except the number itself. In that case, filtering by map, we can just consistently choose the first option, and avoid showing the user a very confusing screen, asking them to select between two identical options.

@BryceStevenWilley BryceStevenWilley added enhancement New feature or request Refactor labels Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Refactor
Projects
None yet
Development

No branches or pull requests

1 participant