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

Model and capture local enrollment events #2267

Closed
29 tasks done
angela-tran opened this issue Aug 1, 2024 · 3 comments · Fixed by #2367
Closed
29 tasks done

Model and capture local enrollment events #2267

angela-tran opened this issue Aug 1, 2024 · 3 comments · Fixed by #2367
Assignees
Labels
analytics App event tracking, instrumentation, logging: Metabase, Amplitude back-end Django views, sessions, middleware, models, migrations etc.

Comments

@angela-tran
Copy link
Member

angela-tran commented Aug 1, 2024

As we roll out the in-person eligibility and enrollment feature, we'd like to implement a basic enrollment log to support reporting or auditing requests from agencies -- in a way that is not tied to an external service.

Since Django already provides a framework for modeling this data, we can start simply by:

  • Creating a new Django model like EnrollmentEvent
  • Creating and saving an instance of this model when enrollment succeeds (digital and in-person)

Acceptance Criteria

EnrollmentEvent

  • Django model defined in the usual benefits/core/models.py with migrations
  • Fields
    • id (pk): UUIDField with default configured
    • agency: ForeignKey to TransitAgency
    • flow: ForeignKey to EnrollmentFlow
    • method: TextField with choices=["digital", "in_person"]
    • verified_by: TextField
    • enrollment_datetime: DateTimeField with default to the current datetime when the model instance is created
    • expiration_datetime: DateTimeField
  • All fields are required, except for expiration_datetime
  • All fields are read-only for all users (in production)
  • Model instances can be created, viewed, and deleted by superuser (except in production, where they are read-only)
  • Model instances can be viewed by STAFF_GROUP_NAME members in all environments, and added/changed in non-production environments
  • No other permissions for this model for any user
  • Implement __str__ for default Admin display to output the enrollment_datetime

Implementation

  • When a user successfully enrolls via the Benefits app interface, code creates and saves an EnrollmentEvent:
    • agency: the agency from the user's session
    • flow: the flow from the user's session
    • method: "digital"
    • verified_by depends on the value of uses_claims_verification
      • True: flow.claims_provider.client_name
      • False: flow.eligibility_api_url
    • expiration_datetime: calculated enrollment expiry, if any
  • When a user successfully enrolls via the In-person interface, code creates and saves an EnrollmentEvent:
    • agency: the agency from the user's session
    • flow: the flow from the user's session
    • method: "in_person"
    • verified_by: f"{user.first_name} {user.last_name}" from the currently logged-in agency user
    • expiration_datetime: calculated enrollment expiry, if any

Additional context

@angela-tran angela-tran moved this from Todo to Needs shaping in Digital Services Aug 1, 2024
@angela-tran angela-tran moved this from Needs shaping to Paused in Digital Services Aug 8, 2024
@thekaveman
Copy link
Member

We're not going to work on this right now for the MVP of the in-person eligibility and enrollment feature.

@github-project-automation github-project-automation bot moved this from Paused to Done in Digital Services Aug 12, 2024
@thekaveman
Copy link
Member

thekaveman commented Aug 12, 2024

We'll come back to this feature later and specify it in more detail.

@thekaveman thekaveman closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2024
@thekaveman thekaveman changed the title Transit agency staff should be able to view past in-person enrollments Model and capture local enrollment events Sep 12, 2024
@thekaveman thekaveman moved this from Done to Needs shaping in Digital Services Sep 12, 2024
@thekaveman thekaveman added the back-end Django views, sessions, middleware, models, migrations etc. label Sep 12, 2024
@thekaveman thekaveman moved this from Needs shaping to Todo in Digital Services Sep 12, 2024
@thekaveman thekaveman reopened this Sep 12, 2024
@github-project-automation github-project-automation bot moved this from Todo to In progress in Digital Services Sep 12, 2024
@thekaveman thekaveman moved this from In progress to Todo in Digital Services Sep 12, 2024
@thekaveman
Copy link
Member

thekaveman commented Sep 12, 2024

Updated this ticket to describe just modeling and capturing the data for a local enrollment log.

We'll come back to visualizing and reporting on this data later.

@thekaveman thekaveman added the analytics App event tracking, instrumentation, logging: Metabase, Amplitude label Sep 12, 2024
@thekaveman thekaveman self-assigned this Sep 12, 2024
@thekaveman thekaveman moved this from Todo to In progress in Digital Services Sep 13, 2024
@thekaveman thekaveman moved this from In progress to In review in Digital Services Sep 17, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Digital Services Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analytics App event tracking, instrumentation, logging: Metabase, Amplitude back-end Django views, sessions, middleware, models, migrations etc.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants