Skip to content

Commit

Permalink
chore(analytics): missed rename Verifier -> Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Oct 1, 2024
1 parent ed779fa commit c35f6d4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions benefits/eligibility/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion benefits/eligibility/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion benefits/in_person/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/development/application-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/eligibility/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c35f6d4

Please sign in to comment.