Skip to content

Commit 3b29b65

Browse files
PR feedback - comments
1 parent de01d28 commit 3b29b65

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

backend/compact-connect/lambdas/python/common/cc_common/data_model/data_client.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,6 @@ def encumber_privilege(self, adverse_action: AdverseActionData) -> None:
10131013
logger.info(message)
10141014
raise CCNotFoundException(f'Privilege not found for jurisdiction {adverse_action.jurisdiction}') from e
10151015

1016-
# Find the main privilege record (not history records)
10171016
privilege_data = PrivilegeData.from_database_record(privilege_record)
10181017

10191018
need_to_set_privilege_to_inactive = True
@@ -1078,21 +1077,21 @@ def encumber_privilege(self, adverse_action: AdverseActionData) -> None:
10781077

10791078
def encumber_license(self, adverse_action: AdverseActionData) -> None:
10801079
"""
1081-
Adds an adverse action record for a privilege for a provider in a jurisdiction.
1080+
Adds an adverse action record for a license for a provider in a jurisdiction.
10821081
10831082
This will update the license record to have a compactEligibility of 'ineligible', and add a license update
10841083
record to show the encumbrance event.
10851084
10861085
:param AdverseActionData adverse_action: The details of the adverse action to be added to the records
1087-
:raises CCNotFoundException: If the privilege record is not found
1086+
:raises CCNotFoundException: If the license record is not found
10881087
"""
10891088
with logger.append_context_keys(
10901089
compact=adverse_action.compact,
10911090
provider_id=adverse_action.provider_id,
10921091
jurisdiction=adverse_action.jurisdiction,
10931092
license_type_abbreviation=adverse_action.license_type_abbreviation,
10941093
):
1095-
# Get the privilege record
1094+
# Get the license record
10961095
try:
10971096
license_record = self.config.provider_table.get_item(
10981097
Key={
@@ -1104,13 +1103,12 @@ def encumber_license(self, adverse_action: AdverseActionData) -> None:
11041103
except KeyError as e:
11051104
message = 'License not found for jurisdiction'
11061105
logger.info(message)
1107-
raise CCNotFoundException(f'License not found for jurisdiction {adverse_action.jurisdiction}') from e
1106+
raise CCNotFoundException(f'{message} {adverse_action.jurisdiction}') from e
11081107

1109-
# Find the main privilege record (not history records)
11101108
license_data = LicenseData.from_database_record(license_record)
11111109

11121110
need_to_set_license_to_ineligible = True
1113-
# If already inactive, do nothing
1111+
# If already ineligible, do nothing
11141112
if license_data.compact_eligibility == CompactEligibilityStatus.INELIGIBLE:
11151113
logger.info('License already ineligible. Not updating license compact eligibility status')
11161114
need_to_set_license_to_ineligible = False
@@ -1142,8 +1140,8 @@ def encumber_license(self, adverse_action: AdverseActionData) -> None:
11421140
)
11431141
# Update the privilege record and create history record
11441142
logger.info('Encumbering license')
1145-
# we add the adverse action record for the privilege,
1146-
# the privilege update record, and update the privilege record to inactive if it is not already inactive
1143+
# we add the adverse action record for the license,
1144+
# the license update record, and update the license record to ineligible if it is not already ineligible
11471145
transact_items = [
11481146
# Create a history record, reflecting this change
11491147
self._generate_put_item_transaction(license_update_record),

backend/compact-connect/lambdas/python/common/cc_common/data_model/schema/privilege/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def privilege_id(self, value: str) -> None:
107107
self._data['privilegeId'] = value
108108

109109
@property
110-
def administrator_set_status(self) -> str:
110+
def administrator_set_status(self) -> ActiveInactiveStatus:
111111
return self._data['administratorSetStatus']
112112

113113
@administrator_set_status.setter
@@ -125,9 +125,6 @@ def status(self) -> str:
125125
class PrivilegeUpdateData(CCDataClass):
126126
"""
127127
Class representing a Privilege Update with getters and setters for all properties.
128-
129-
Note: This class requires valid data when created - it cannot be instantiated empty
130-
and populated later.
131128
"""
132129

133130
# Define the record schema at the class level

0 commit comments

Comments
 (0)