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

Refactor enrollment check to lookup groups for funding source #2068

Open
2 tasks
Tracked by #1878
thekaveman opened this issue May 1, 2024 · 0 comments
Open
2 tasks
Tracked by #1878

Refactor enrollment check to lookup groups for funding source #2068

thekaveman opened this issue May 1, 2024 · 0 comments
Labels
back-end Django views, sessions, middleware, models, migrations etc.

Comments

@thekaveman
Copy link
Member

When we first implemented enrollment expiration logic in #1989, the only way to check if the user (funding source) was already linked to a group was to look up all funding sources linked to the group, and check if the user's funding source was in the that list. Over time with increasing enrollments, this won't scale as every single funding source will have to be checked each time.

Now Littlepay offers an endpoint to look up the groups linked to a given funding source, i.e. the inverse relationship. See cal-itp/littlepay#60.

This will be a much shorter list to check -- empty for new users (funding sources), and perhaps one or two and not many more for existing users.

Acceptance Criteria

During enrollment:

  • Instead of looking up funding sources for the group, look up groups for the funding source
  • The user is considered already enrolled if the current eligibility's group is in the list

Additional context

Depends on cal-itp/littlepay#60.

This will be a refactor of the the work that comes back (but may be modified) with #2062.

@thekaveman thekaveman added the back-end Django views, sessions, middleware, models, migrations etc. label May 1, 2024
@thekaveman thekaveman changed the title Refactor current enrollment check to check groups for funding source Refactor enrollment check to lookup groups for funding source May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Django views, sessions, middleware, models, migrations etc.
Projects
Status: Todo
Development

No branches or pull requests

1 participant