-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
4175 add request type flag #4271
4175 add request type flag #4271
Conversation
…s export. Adds filter by request type to index.
…s export. Adds filter by request type to index.
@@ -19,6 +20,7 @@ def call | |||
return self unless valid? | |||
|
|||
request_create_svc = Partners::RequestCreateService.new( | |||
request_type: @request_type.to_i, |
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 service should already know the request type just by whether for_families
is true or false.
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 feel that defining request_type in this way is more transparent. Would you prefer to add logic in the controller to determine request_type rather than using the instance var?
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'd prefer putting the business logic as far back as possible. The controller is calling a service, which already has to know what kind of request it's creating. We can rely on the service to set the request 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.
Almost there!
@@ -13,7 +13,7 @@ | |||
<%= request_row.comments %> | |||
</td> | |||
<td> | |||
<%= request_row&.request_type&.titleize %> | |||
<%= request_row&.request_type&.first&.capitalize %> |
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.
Can we extract this into a method on request
? It's a bit obscure. If you call it something like request_type_label
with a comment it'd be more obvious.
db/schema.rb
Outdated
@@ -849,7 +849,8 @@ | |||
end | |||
|
|||
create_table "versions", force: :cascade do |t| | |||
t.string "item_type", null: false | |||
t.string "item_type" | |||
t.string "{:null=>false}" |
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 don't think this is supposed to be here?
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 was automatically changed when I ran the migrations last. I reverted it.
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.
Tried it on my local. Signed in as [email protected], entered a quantity request and got
Same effect for individual and child request. (Not at all surprised by that) |
Well that is embarrassing. I'll take a look at it this afternoon. |
Seems I either forgot to add or removed request_type from the initializers. I have replaced them and tested locally. Everything should work as expected now. |
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.
Alas, the quantity requests are showing up as "I" now. (Strange -- I think I confirmed them as working correctly before ...)
…man-essentials into 4175-add-request-type-flag
There's an issue with setup that's currently blocking me doing functional reviews -- just managing your expectations as to turnaround time. |
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.
LGTM now. @dorner?
@@ -8,7 +8,7 @@ class FamilyRequestCreateService | |||
|
|||
attr_reader :partner_user_id, :comments, :family_requests_attributes, :partner_request | |||
|
|||
def initialize(partner_user_id:, family_requests_attributes:, comments: nil, for_families: false) | |||
def initialize(request_type:, partner_user_id:, family_requests_attributes:, comments: nil, for_families: false) |
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.
Wait, why was this put back? We agreed that it wouldn't be needed because the service itself knows what type it is just by the current parameters being passed in.
Had a question... also, lint is failing now. |
@nathangthomas looks like this is almost ready to go - can you finish it up? |
@nathangthomas This PR looks almost done. Could I help carry it across the finish line for you? |
@coalest It hasn't been touched since May -- please go ahead. |
A few questions:
|
2/3. I expect we'll be able to get rid of those after a bit of investigation, and I've added it to our tech debt inbox. I think it's out of scope for this issue, though. |
Closing this as #4827 was just merged which was built off of this work. Thanks @nathangthomas for doing the heavy lifting 🎉 |
Resolves #4175
Description
Adds a request type flag to index and show pages as well as to the downloadable document so that banks can better see which type of request is being made.
Type of change
This can be manually tested by logging in as a bank user.
Screenshots
Requests-2024-04-02.csv