-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add Match Route Eleven as Clone of Provider Only Route #820
Add Match Route Eleven as Clone of Provider Only Route #820
Conversation
|
||
def decline_confirmed | ||
match.rejected! | ||
# TODO maybe rerun the matching engine for that vacancy and client |
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.
I think we can remove this:
# TODO maybe rerun the matching engine for that vacancy and client |
module MatchDecisions::Eleven | ||
class ElevenConfirmHsaAcceptsClientDeclineDndStaff < ::MatchDecisions::Base | ||
def to_partial_path | ||
'match_decisions/eleven_confirm_hsa_accepts_client_decline_dnd_staff' |
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.
How much would it break things if we started putting the decisions into a folder?
'match_decisions/eleven_confirm_hsa_accepts_client_decline_dnd_staff' | |
'match_decisions/eleven/confirm_hsa_accepts_client_decline_dnd_staff' |
Seems like that would help tracking these down in the future for duplication etc.
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.
From an initial test, it doen't look like it is breaking anything, but I'll do a bit more to get some more thorough results before including in in the next commit.
|
||
def accessible_by? contact | ||
contact.user_can_act_on_behalf_of_match_contacts? || | ||
contact.in?(match.housing_subsidy_admin_contacts) |
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.
We seem to have cleaned up contact_actor_type
in some decisions. Can you take a look at how we're using it in app/models/match_decisions/approve_match_housing_subsidy_admin.rb
? I think we want this to be:
contact.in?(match.send(contact_actor_type))
and
def contact_actor_type
nil
end
to be:
def contact_actor_type
:housing_subsidy_admin_contacts
end
Looks like most (all?) of these decisions could be cleaned up that way.
app/models/match_routes/eleven.rb
Outdated
end | ||
|
||
def contact_label_for(contact_type) | ||
case contact_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.
I wonder if this should:
case contact_type | |
case contact_type&.to_sym |
\ | ||
The CAS has generated a new match recommendation. | ||
\ | ||
Please acknowledge receipt of this match and review the associated HSA contacts. |
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.
This should have a translation for HSA
@@ -2,7 +2,7 @@ Hello #{@contact.full_name}, | |||
\ | |||
= "A #{Translation.translate('Housing Subsidy Administrator')} has made a decision on a housing opportunity for which the client below applied." | |||
\ | |||
Decision: #{@match.hsa_accepts_client_decision.status_label} | |||
Decision: #{@match.eleven_hsa_accepts_client_decision.status_label} |
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.
This looks like a mistake, since this is probably the original file for the provider only route
@@ -2,7 +2,7 @@ Hello #{@contact.full_name}, | |||
\ | |||
= "A #{Translation.translate('Housing Subsidy Administrator')} has made a decision on a housing opportunity for which the client below applied." | |||
\ | |||
Decision: #{@match.hsa_accepts_client_decision.status_label} | |||
Decision: #{@match.eleven_hsa_accepts_client_decision.status_label} |
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.
This looks like a mistake, since this is probably the original file for the provider only route
@@ -2,7 +2,7 @@ Hello #{@contact.full_name}, | |||
\ | |||
= "A #{Translation.translate('Housing Subsidy Administrator')} has made a decision on a housing opportunity for which the client below applied." | |||
\ | |||
Decision: #{@match.hsa_accepts_client_decision.status_label} | |||
Decision: #{@match.eleven_hsa_accepts_client_decision.status_label} |
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.
This looks like a mistake, since this is probably the original file for the provider only route
@@ -2,7 +2,7 @@ Hello #{@contact.full_name}, | |||
\ | |||
= "A #{Translation.translate('Housing Subsidy Administrator')} has made a decision on a housing opportunity for which the client below applied." | |||
\ | |||
Decision: #{@match.hsa_accepts_client_decision.status_label} | |||
Decision: #{@match.eleven_hsa_accepts_client_decision.status_label} |
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.
This looks like a mistake, since this is probably the original file for the provider only route
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.
you are correct, this and the others you've noted should not be here. I'm flagging them to be revereted in the next commit.
class MatchRouteElevenTranslations < ActiveRecord::Migration[7.0] | ||
def up | ||
translations_eleven.each do |k, v| | ||
Translation.create!( | ||
key: k, | ||
text: v, | ||
) | ||
end | ||
end | ||
|
||
def down | ||
Translation.where(key: translations_eleven.keys).destroy_all | ||
end | ||
|
||
private | ||
|
||
def translations_eleven = { | ||
'Match Route Eleven' => 'Match Route Eleven', | ||
'SSP Eleven' => 'SSP', | ||
'Shelter Agency Eleven' => 'Shelter Agency', | ||
'HSA Eleven' => 'HSA', | ||
'Housing Search Provider Eleven' => 'Housing Search Provider', | ||
'Housing Subsidy Administrator Eleven' => 'Housing Subsidy Administrator', | ||
'Stabilization Service Provider Eleven' => 'Stabilization Services Provider', | ||
'Stabilization Services Provider Eleven' => 'Stabilization Services Provider', | ||
'CoC Eleven' => 'DND', | ||
} | ||
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.
Hmm, I could be wrong, and maybe we want some default translations in there, but I think you can leave this off and the app will add them via a cron job and/or if you visit something that needs it. (It would just add the untranslated value though, so maybe something like this is useful.)
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.
From my understanding the app will automatically add these transalations. I'll remove this file and we can add it back in if needed. I saw a previous match route setting the default translations via script so included it here based on that knowledge.
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.
Thanks @dtgreiner, it generally looks really good.
I added a couple thoughts on cleaning things up a bit, let me know if you have questions.
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.
Thanks @dtgreiner, looks great!
Please squash merge this PR
Description
Adds Match Route Eleven as a clone of the Provider Only route but with its own version of notifications, contacts, routes
Type of change
Checklist before requesting review