Skip to content
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

Merged

Conversation

dtgreiner
Copy link
Contributor

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

  • New feature (adds functionality)

Checklist before requesting review

  • I have performed a self-review of my code
  • I have run the code that is being changed under ideal conditions, and it doesn't fail
  • My code includes comments and/or descriptive variable names to help other engineers understand the intent (or not applicable)
  • My code follows the style guidelines of this project (rubocop)
  • I have updated the documentation (or not applicable)
  • If it's not obvious how to test this change, I have provided testing instructions in this PR or the related issue

@dtgreiner dtgreiner requested a review from eanders June 24, 2024 13:06

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

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:

Suggested change
# 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'
Copy link
Contributor

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?

Suggested change
'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.

Copy link
Contributor Author

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)
Copy link
Contributor

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.

end

def contact_label_for(contact_type)
case contact_type
Copy link
Contributor

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:

Suggested change
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.
Copy link
Contributor

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}
Copy link
Contributor

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}
Copy link
Contributor

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}
Copy link
Contributor

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}
Copy link
Contributor

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

Copy link
Contributor Author

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.

Comment on lines 1 to 28
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
Copy link
Contributor

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.)

Copy link
Contributor Author

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.

Copy link
Contributor

@eanders eanders left a 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.

@eanders eanders changed the base branch from release-59 to release-60 June 24, 2024 19:18
Copy link
Contributor

@eanders eanders left a 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!

@eanders eanders merged commit 4187930 into release-60 Jun 24, 2024
16 checks passed
@eanders eanders deleted the dg/housing_navigation_rework_route_create_route_eleven-6123 branch June 24, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants