-
Notifications
You must be signed in to change notification settings - Fork 66
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
Mobile: Create new Secure Messaging Threads endpoint #12851
Conversation
|
||
require 'rails_helper' | ||
require_relative '../support/iam_session_helper' | ||
require_relative '../support/mobile_sm_client_helper' |
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.
with my VCR PR just being merged, these should be pointing to the helpers folder.
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.
Ooo good catch, thanks. I just merged master so I'll make sure that passes
end | ||
end | ||
|
||
context 'Advanced User' do |
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 believe all mobile users are premium users (I forget where I heard this so we may want to verify that ) so I don't think basic and advanced user specs will apply.
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.
Nevermind. I just looked up the slack conversation that talked about this and it's not true. we can have MHV advanced and basic users.
modules/mobile/docs/openapi.yaml
Outdated
content: | ||
application/json: | ||
schema: | ||
$ref: ./schemas/SecureMessageList.yml |
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.
Should this be SecureMessageThreadList?
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.
Fixed
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 Andrew is probably right about renaming that schema file. Looks good and I don't consider any of my feedback to be blocking.
modules/mobile/docs/openapi.yaml
Outdated
- description: The field to sort the results by | ||
in: query | ||
name: sortField, | ||
required: true |
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.
Do we know if all of these are actually required? Will our front end even be using them? The client is written to always use them but it's not clear if omitting them causes any issues because they don't have any sample specs addressing it, nor do they require the params in the controller. I guess we'll find out in testing.
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 can always set a default in the controller so that it's not required
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.
None of the fields outside of folder id are required so I required from those
type: string | ||
enum: [ ASC, DESC ] | ||
- $ref: "#/components/parameters/InflectionHeader" | ||
responses: |
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 question has been coming up recently of "should these docs define all possible responses?" That would mean that every single entry in this file should have a section for 500, 502, 503, etc. I don't think you need to make any changes, but we do need to have that conversation sometime and this PR is reminding me. I'm going to file a ticket today for figuring that out.
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.
Ya I was going to wait until that discussion comes to a conclusion
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've created a ticket for it, so I'd say just skip it for now.
end | ||
|
||
expect(response).to be_successful | ||
expect(response).to match_camelized_response_schema('message_threads') |
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.
Would it would be worth having a "matches exactly this" test? It's not the most graceful, but I've been burned by schema tests too many times and don't trust them. Also, it can be helpful at times to have an example of the data in the specs.
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 remember you saying that before. I just updated it 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.
LGTM
schema: | ||
type: string | ||
enum: [ SENDER_NAME, RECIPIENT_NAME, SENT_DATE, DRAFT_DATE ] | ||
- description: The order to sort the results by |
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.
Do you know if this defaults to ASC or DESC? Could be worth capturing that and also the fact that page defaults to 1 (even though that's pretty obvious).
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.
DESC I believe. I just tried sender_name and the order was ISLAM, MOHAMMAD RAFIQ
then GOPARAJU, BHANU
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
* Create new endpoint * Rubocop * Update documentation and add new error response * Update parameter name to what front end uses * Update spec to new directory structure * Reference correct 200 schema * Update spec to check specific return * Remove required from parameters that aren't required * Update documentation description
Summary
Create a new endpoint that uses the new Secure Messaging Threads api
Related issue(s)
department-of-veterans-affairs/va.gov-team#5621
Testing done
Added tests to the module spec
Screenshots
Note: Optional
What areas of the site does it impact?
None (completely new endpoint)
Acceptance criteria
Requested Feedback
How to integrate pagination