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

Tbolt/3257 state admin cert endpoint #3450

Merged
merged 48 commits into from
Sep 17, 2021

Conversation

tbolt
Copy link
Contributor

@tbolt tbolt commented Aug 30, 2021

Resolves #3257

Description-
Adds endpoint /auth/certifications to allow a Fed Admin to submit a state admin certification letter

This pull request was tested in the follow ways…

  • Using an HTTP Client, tested with no jwt, a not logged-in jwt, an un-authorized jwt, and a valid jwt
  • With a valid token, tested with a sample payload with both valid and invalid data

Steps to manually verify this change...

  1. Using an HTTP Client first attempt to POST to the endpoint auth/certifications with no valid jwt, verify a 401 is thrown
  2. Then attempt with a non-Federal admin role, and verify a 403
  3. Use the sample JSON below and verify a 200
  4. Attempt the above again and verify 400 as the email + state must be unique

Sample JSON Body

{
  "ffy": "2021"
  "name": "Roger Klotz",
  "email": "fake@email.com",
  "phone": "4105555555",
  "state": "md",
  "fileUrl": "/auth/certifications/files/12345"
}

This pull request is ready to review when...

  • Automated tests are updated (and all tests are passing)
  • The change has been documented
  • Associated OpenAPI documentation has been updated
  • Changelog is updated as appropriate
  • The experience passes a basic manual accessibility audit (keyboard nav, screenreader, text scaling) OR an exemption is documented

This pull request can be merged when…

  • Code has been reviewed by someone other than the original author
  • QA has verified the accessibility and functionality related to the change
  • Design has approved the experience
  • Product has approved the experience

@tbolt tbolt requested review from thetif and knollfear August 30, 2021 19:36
@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2021

Codecov Report

Merging #3450 (d82bd22) into development (bcea0d2) will increase coverage by 0.03%.
The diff coverage is 80.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #3450      +/-   ##
===============================================
+ Coverage        88.57%   88.60%   +0.03%     
===============================================
  Files              282      284       +2     
  Lines             5591     5615      +24     
  Branches          1073     1073              
===============================================
+ Hits              4952     4975      +23     
- Misses             586      587       +1     
  Partials            53       53              
Impacted Files Coverage Δ
api/db/certifications.js 60.00% <60.00%> (ø)
api/routes/auth/certifications/post.js 81.25% <81.25%> (ø)
api/routes/auth/certifications/index.js 100.00% <100.00%> (ø)
api/routes/auth/certifications/openAPI.js 100.00% <100.00%> (ø)
api/files/local.js 38.09% <0.00%> (+19.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcea0d2...d82bd22. Read the comment docs.

@cms-eapd-bot
Copy link

cms-eapd-bot commented Aug 30, 2021

This deploy was cleaned up.

api/seeds/shared/set-up-users.js Show resolved Hide resolved
api/package.json Show resolved Hide resolved
api/routes/auth/certifications/files.endpoint.js Outdated Show resolved Hide resolved
api/routes/auth/certifications/files.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@knollfear knollfear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

uploadedOn: new Date()
});
if (error) {
res.status(400).end();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this not trigger next to kick it over to the error handler?

@tbolt tbolt merged commit 6e6293f into development Sep 17, 2021
@tbolt tbolt deleted the tbolt/3257-state-admin-cert-endpoint branch September 17, 2021 14:10
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.

[Feature] Create endpoint to add authorization record to the State Admin Certification Table
5 participants