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 Sep 25, 2024
1 parent 2b8ccfc commit c9db377
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 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):
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):
Expand All @@ -38,9 +38,9 @@ def __init__(self, request, flow: models.EnrollmentFlow, status, error=None):
self.update_event_properties(status=status, error=error)


def selected_verifier(request, flow: models.EnrollmentFlow):
"""Send the "selected eligibility verifier" analytics event."""
core.send_event(SelectedVerifierEvent(request, flow))
def selected_flow(request, flow: models.EnrollmentFlow):
"""Send the "selected enrollment flow" analytics event."""
core.send_event(SelectedFlowEvent(request, flow))


def started_eligibility(request, flow: models.EnrollmentFlow):
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 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 c9db377

Please sign in to comment.