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

Add program and enrollments concept #726

Merged
merged 33 commits into from
Nov 15, 2024
Merged

Add program and enrollments concept #726

merged 33 commits into from
Nov 15, 2024

Conversation

DeeTheDev
Copy link
Collaborator

We implemented the concept of 'Programs' for members based on the Portland Water Bureau RAMP program pilot. In figuring out what a program is and reviewing the current backend components, we noticed that programs would remove a lot of complexity around member eligibility constraints, and the way we represent goods in member dashboards.

Eligibility constraints are technically duplicates of organization memberships, and both are used to verify a member. Instead, we replace eligibility constraints with programs. Members or organizations can be in program enrollments. Resources like food offerings and vendor services can be in programs. Changes include:

  • Vendible::Grouping dashboard list is replaced by Program detail list that a member is enrolled in.
  • offerings/vendor configs/vendor services/triggers Eligibility::Constraint associations are replaced with Programs
  • members Eligibility::Constraint associations are replaced with Program::Enrollment, and organizations can be associated with program enrollments too
  • Remove backend eligibility constraint models and references

Then the backend logic of member resource eligibility is replaced with, 'a user can access an offering/service if the user has an approved program enrollment (or the user is a verified member of an organization with an approved program enrollment) in an active program that is associated with the offering/service'.


Sets a 'now' key and API method helper in the env which we can use across the API and model layer of requests. This avoids many different definitions of 'now' within an endpoint/entity.


Admin pages replace eligibility constraints with programs and program enrollments. Also removes 'vendible groups', not necessary anymore.


Members with a positive ledger cash balance, will see their available amount on the top of the dashboard page


Dashboard program list

Details, image and link to the program promotion page.
Screenshot 2024-11-07 at 1 07 16 PM

rgalanakis and others added 27 commits October 29, 2024 10:48
tweak flaky spec

Add 'current_time' helper to remove some time drift
Also had to update the CRUD endpoints to expose
the correct items and test.
Also, allow enrollments to be approved and unenrolled
in the detail page.
And make programs searchable. Test.
* Add missing tests for program search endpoint
* Remove all Eligiblity pages
* Refactor the EligiblityConstraints component into Programs
* Update program/enrollment navlink icons
* Change 'eligiblity constraint' references/contexts into 'programs'
Also add program :app_link_text for the dashboard
'call to action' program link.
need to update org page with enrollments in related list
This reverts commit 7bb6494.
Fix bug with members not looking at their org associations
And use the RelatedList 'addNew' syntax in
detail pages that create resources.
Some misc. cleanup
@DeeTheDev DeeTheDev added the backend Involves changes to the backend API label Nov 7, 2024
@DeeTheDev DeeTheDev added admin Admin site changes webapp Public frontend changes labels Nov 7, 2024
DeeTheDev and others added 6 commits November 7, 2024 16:37
Also, only expose the combined program enrollments
in the Dashboard entity, rather than the member
entity, not nessesary right now.
Require both app link and require
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 99.47368% with 4 lines in your changes missing coverage. Please review.

Project coverage is 98.72%. Comparing base (2392b76) to head (feff42b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/suma/fixtures/programs.rb 92.85% 1 Missing ⚠️
lib/suma/image.rb 80.00% 1 Missing ⚠️
lib/suma/program.rb 96.77% 1 Missing ⚠️
lib/suma/program/enrollment.rb 96.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #726   +/-   ##
=======================================
  Coverage   98.72%   98.72%           
=======================================
  Files         464      463    -1     
  Lines       20959    21039   +80     
=======================================
+ Hits        20691    20770   +79     
- Misses        268      269    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DeeTheDev DeeTheDev merged commit 2c46b3c into main Nov 15, 2024
5 checks passed
@DeeTheDev DeeTheDev deleted the pwb-program branch November 15, 2024 09:53
@rgalanakis rgalanakis changed the title Pwb program Add program and enrollments concept Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin Admin site changes backend Involves changes to the backend API webapp Public frontend changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants