-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRIMAPP-1597 store overall_result type rather than string #805
Conversation
1975aa8
to
6068377
Compare
6068377
to
0d43b60
Compare
0d43b60
to
f7503ef
Compare
'GRANTED' | ||
when /refused/ | ||
'FAILIOJ' | ||
decision.set_funding_decision(user_id:, funding_decision:) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ removes redundant code. The overall result is now calculated in the same way across all application types.
def initialize(decision) | ||
@decision = decision | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall result is now displayed to the user in the format funding_decision - qualification
, e.g., "Granted - with contribution" or "Refused - failed IoJ".
In the datastore, these values are stored as types, such as granted_with_contribution
and refused_failed_ioj
.
This class determines the OverallResult
type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 Just one small thing I've left a comment about.
@@ -14,17 +14,17 @@ | |||
|
|||
context 'when funding is "granted"' do | |||
let(:funding_decision) { 'granted' } | |||
let(:overall_result) { 'Granted - Passed Means Test' } | |||
let(:overall_result) { Types::OverallResult['granted_with_contribution'] } | |||
|
|||
it { is_expected.to have_text('Granted') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we expect the text to be "Granted - with contribution"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thank you! I have fixed string and added exact: true
option to the matcher.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Description of change
Store the overall result as a type.
Link to relevant ticket
CRIMAPP-1597
Notes for reviewer
The initial plan was to store MAAT strings directly in the datastore overall_result, as MAAT is the source of truth for decisions and its logic is complex. However, testing has shown that these strings do not fully meet providers' needs and may cause confusion.
Instead, we will store a constant representing the overall result, which clients can translate into text as needed. This result will combine the funding_decision with any relevant qualifications that help providers understand the next steps.
The overall result is now displayed to the user in the format funding_decision - qualification, e.g., "Granted - with contribution" or "Refused - failed IoJ". In the datastore, these values are stored as types, such as
granted_with_contribution
andrefused_failed_ioj
.Screenshots of changes (if applicable)
Before changes:
After changes:
How to manually test the feature