Skip to content

Commit 66c10a4

Browse files
committed
PR feedback
1 parent 5fe6022 commit 66c10a4

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

backend/compact-connect/lambdas/python/data-events/handlers/encumbrance_events.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _get_license_type_name(compact: str, license_type_abbreviation: str) -> str:
2323
return LicenseUtility.get_license_type_by_abbreviation(compact, license_type_abbreviation).name
2424

2525

26-
def _get_provider_records_and_validate(compact: str, provider_id: str) -> tuple[ProviderUserRecords, ProviderData]:
26+
def _get_provider_records(compact: str, provider_id: str) -> tuple[ProviderUserRecords, ProviderData]:
2727
"""
2828
Retrieve and validate provider records for notification processing.
2929
@@ -326,7 +326,7 @@ def privilege_encumbrance_notification_listener(message: dict):
326326
license_type_name = _get_license_type_name(compact, license_type_abbreviation)
327327

328328
# Get provider records to gather notification targets and provider information
329-
provider_records, provider_record = _get_provider_records_and_validate(compact, provider_id)
329+
provider_records, provider_record = _get_provider_records(compact, provider_id)
330330

331331
# Provider Notification
332332
_send_provider_notification(
@@ -401,7 +401,7 @@ def privilege_encumbrance_lifting_notification_listener(message: dict):
401401
license_type_name = _get_license_type_name(compact, license_type_abbreviation)
402402

403403
# Get provider records to gather notification targets and provider information
404-
provider_records, provider_record = _get_provider_records_and_validate(compact, provider_id)
404+
provider_records, provider_record = _get_provider_records(compact, provider_id)
405405

406406
# Provider Notification
407407
_send_provider_notification(
@@ -476,7 +476,7 @@ def license_encumbrance_notification_listener(message: dict):
476476
license_type_name = _get_license_type_name(compact, license_type_abbreviation)
477477

478478
# Get provider records to gather notification targets and provider information
479-
provider_records, provider_record = _get_provider_records_and_validate(compact, provider_id)
479+
provider_records, provider_record = _get_provider_records(compact, provider_id)
480480

481481
# Provider Notification
482482
_send_provider_notification(
@@ -551,7 +551,7 @@ def license_encumbrance_lifting_notification_listener(message: dict):
551551
license_type_name = _get_license_type_name(compact, license_type_abbreviation)
552552

553553
# Get provider records to gather notification targets and provider information
554-
provider_records, provider_record = _get_provider_records_and_validate(compact, provider_id)
554+
provider_records, provider_record = _get_provider_records(compact, provider_id)
555555

556556
# Provider Notification
557557
_send_provider_notification(

backend/compact-connect/lambdas/python/data-events/tests/function/test_encumbrance_events.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,12 @@ def test_privilege_encumbrance_listener_processes_event_with_registered_provider
943943
def test_privilege_encumbrance_listener_processes_event_with_unregistered_provider(
944944
self, mock_provider_email, mock_state_email
945945
):
946-
"""Test that privilege encumbrance listener handles unregistered providers."""
946+
"""
947+
Test that privilege encumbrance listener handles unregistered providers.
948+
949+
Note: An unregistered provider holding a privilege should not be possible in our system.
950+
This test is just stressing the limits of our encumbrance logic, to make sure it handles it gracefully.
951+
"""
947952
from cc_common.email_service_client import EncumbranceNotificationTemplateVariables
948953
from handlers.encumbrance_events import privilege_encumbrance_notification_listener
949954

0 commit comments

Comments
 (0)