From c35f6d4d6fe217af7bdaf20542ed60c2eb21594c Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 24 Sep 2024 22:41:20 +0000 Subject: [PATCH] chore(analytics): missed rename Verifier -> Flow --- benefits/eligibility/analytics.py | 8 ++++---- benefits/eligibility/views.py | 2 +- benefits/in_person/views.py | 2 +- docs/development/application-logic.md | 2 +- tests/pytest/eligibility/test_views.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/benefits/eligibility/analytics.py b/benefits/eligibility/analytics.py index 9cb62efad4..5011432073 100644 --- a/benefits/eligibility/analytics.py +++ b/benefits/eligibility/analytics.py @@ -14,7 +14,7 @@ def __init__(self, request, event_type, flow: models.EnrollmentFlow, enrollment_ self.update_enrollment_flows(flow) -class SelectedVerifierEvent(EligibilityEvent): +class SelectedFlowEvent(EligibilityEvent): """Analytics event representing the user selecting an enrollment flow.""" def __init__(self, request, flow: models.EnrollmentFlow, enrollment_method=models.EnrollmentMethods.DIGITAL): @@ -40,9 +40,9 @@ def __init__( self.update_event_properties(status=status, error=error) -def selected_verifier(request, flow: models.EnrollmentFlow, enrollment_method: str = models.EnrollmentMethods.DIGITAL): - """Send the "selected eligibility verifier" analytics event.""" - core.send_event(SelectedVerifierEvent(request, flow, enrollment_method=enrollment_method)) +def selected_flow(request, flow: models.EnrollmentFlow, enrollment_method: str = models.EnrollmentMethods.DIGITAL): + """Send the "selected enrollment flow" analytics event.""" + core.send_event(SelectedFlowEvent(request, flow, enrollment_method=enrollment_method)) def started_eligibility(request, flow: models.EnrollmentFlow, enrollment_method: str = models.EnrollmentMethods.DIGITAL): diff --git a/benefits/eligibility/views.py b/benefits/eligibility/views.py index 8bbb78271a..1b495fa43a 100644 --- a/benefits/eligibility/views.py +++ b/benefits/eligibility/views.py @@ -38,7 +38,7 @@ def index(request): flow = EnrollmentFlow.objects.get(id=flow_id) session.update(request, flow=flow) - analytics.selected_verifier(request, flow) + analytics.selected_flow(request, flow) eligibility_start = reverse(routes.ELIGIBILITY_START) response = redirect(eligibility_start) diff --git a/benefits/in_person/views.py b/benefits/in_person/views.py index a10389e711..57e092a8b9 100644 --- a/benefits/in_person/views.py +++ b/benefits/in_person/views.py @@ -36,7 +36,7 @@ def eligibility(request): flow_id = form.cleaned_data.get("flow") flow = models.EnrollmentFlow.objects.get(id=flow_id) session.update(request, flow=flow) - eligibility_analytics.selected_verifier(request, flow, enrollment_method=models.EnrollmentMethods.IN_PERSON) + eligibility_analytics.selected_flow(request, flow, enrollment_method=models.EnrollmentMethods.IN_PERSON) eligibility_analytics.started_eligibility(request, flow, enrollment_method=models.EnrollmentMethods.IN_PERSON) in_person_enrollment = reverse(routes.IN_PERSON_ENROLLMENT) diff --git a/docs/development/application-logic.md b/docs/development/application-logic.md index bad9010d86..b9bc441fdc 100644 --- a/docs/development/application-logic.md +++ b/docs/development/application-logic.md @@ -120,7 +120,7 @@ flowchart LR agency -. update -.-o session eligibility -. update -.-o session - eligibility -. selected eligibility verifier -.-o analytics + eligibility -. selected enrollment flow -.-o analytics ``` Depending upon the choice of enrollment pathway, the _Next phase_ above may be: diff --git a/tests/pytest/eligibility/test_views.py b/tests/pytest/eligibility/test_views.py index 8aab99a453..fd4329df8c 100644 --- a/tests/pytest/eligibility/test_views.py +++ b/tests/pytest/eligibility/test_views.py @@ -147,7 +147,7 @@ def test_index_post_valid_form(client, model_EnrollmentFlow, mocked_session_upda assert response.status_code == 302 assert response.url == reverse(routes.ELIGIBILITY_START) assert mocked_session_update.call_args.kwargs["flow"] == model_EnrollmentFlow - mocked_analytics_module.selected_verifier.assert_called_once() + mocked_analytics_module.selected_flow.assert_called_once() @pytest.mark.django_db