Skip to content

Commit

Permalink
Updates from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
dtgreiner committed Jun 24, 2024
1 parent 9d8cd98 commit 4cc7208
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module MatchDecisions::Eleven
class ElevenConfirmHsaAcceptsClientDeclineDndStaff < ::MatchDecisions::Base
def to_partial_path
'match_decisions/eleven_confirm_hsa_accepts_client_decline_dnd_staff'
'match_decisions/eleven/confirm_hsa_accepts_client_decline_dnd_staff'
end

def statuses
Expand Down Expand Up @@ -67,7 +67,8 @@ def notifications_for_this_step
end

def accessible_by? contact
contact.user_can_reject_matches? || contact.user_can_approve_matches?
contact.user_can_reject_matches? ||
contact.user_can_approve_matches?
end

def show_client_match_attributes?
Expand All @@ -90,7 +91,6 @@ def decline_overridden_returned

def decline_confirmed
match.rejected!
# TODO maybe rerun the matching engine for that vacancy and client
end

def canceled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module MatchDecisions::Eleven
class ElevenHsaAcceptsClient < ::MatchDecisions::Base
def to_partial_path
'match_decisions/eleven_hsa_accepts_client'
'match_decisions/eleven/hsa_accepts_client'
end
include MatchDecisions::AcceptsDeclineReason

Expand Down Expand Up @@ -88,7 +88,7 @@ def notify_contact_of_action_taken_on_behalf_of contact: # rubocop:disable Lint/

def accessible_by? contact
contact.user_can_act_on_behalf_of_match_contacts? ||
contact.in?(match.housing_subsidy_admin_contacts)
contact.in?(match.send(contact_actor_type))
end

def show_client_match_attributes?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module MatchDecisions::Eleven
class ElevenHsaAcknowledgesReceipt < ::MatchDecisions::Base
def to_partial_path
'match_decisions/eleven_hsa_acknowledges_receipt'
'match_decisions/eleven/hsa_acknowledges_receipt'
end

validate :cant_accept_if_match_closed
Expand Down Expand Up @@ -37,7 +37,7 @@ def actor_type
end

def contact_actor_type
nil
:housing_subsidy_admin_contacts
end

def statuses
Expand Down Expand Up @@ -66,8 +66,8 @@ def initialize_decision! send_notifications: true
end

def accessible_by? contact
contact.user_can_act_on_behalf_of_match_contacts? ||
contact.in?(match.housing_subsidy_admin_contacts)
contact.user_can_act_on_behalf_of_match_contacts?
contact.in?(match.send(contact_actor_type))
end

def notifications_for_this_step
Expand Down
2 changes: 1 addition & 1 deletion app/models/match_routes/eleven.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def status_declined?(match)
end

def contact_label_for(contact_type)
case contact_type
case contact_type&.to_sym
when :dnd_staff_contacts
Translation.translate('CoC Eleven')
when :housing_subsidy_admin_contacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Hello #{@contact.full_name},
\
The CAS has generated a new match recommendation.
\
Please acknowledge receipt of this match and review the associated HSA contacts.
Please acknowledge receipt of this match and review the associated #{Translation.translate('HSA Eleven')} contacts.
\
Please review details:
#{notification_match_url @notification, @match}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.eleven_hsa_accepts_client_decision.status_label}
Decision: #{@match.hsa_accepts_client_decision.status_label}
\
= render 'client_details'
\
Expand Down
2 changes: 1 addition & 1 deletion app/views/notifications_mailer/hsa_decision_hsp.text.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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.eleven_hsa_accepts_client_decision.status_label}
Decision: #{@match.hsa_accepts_client_decision.status_label}
\
View details here:
#{notification_match_url @notification, @match}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.eleven_hsa_accepts_client_decision.status_label}
Decision: #{@match.hsa_accepts_client_decision.status_label}
\
View details here:
#{notification_match_url @notification, @match}
Expand Down
2 changes: 1 addition & 1 deletion app/views/notifications_mailer/hsa_decision_ssp.text.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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.eleven_hsa_accepts_client_decision.status_label}
Decision: #{@match.hsa_accepts_client_decision.status_label}
\
View details here:
#{notification_match_url @notification, @match}
Expand Down

0 comments on commit 4cc7208

Please sign in to comment.