SuffolkLITLab / docassemble-EFSPIntegration

EFSP (Electronic Filing Service Provider) functionality, using ECF v4.0
https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/efiling/overview
MIT License
1 stars 1 forks source link

filter codes with map instead of options entries #172

Open BryceStevenWilley opened 1 year ago

BryceStevenWilley commented 1 year ago

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.