-
Notifications
You must be signed in to change notification settings - Fork 166
Log acuant result code, if billable (LG-2495) #4001
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
022c7cc
Log acuant result code, if billable
zachmargolis 7adb960
rubocop
zachmargolis e81b13d
rename argument
zachmargolis 831e0da
add db column
zachmargolis 30d1edf
rubocop
zachmargolis 8e9547a
Update proofing cost spec
zachmargolis 558d514
Add billing to back image step
zachmargolis 770c1b7
Add some more specs
zachmargolis 77ce5ad
add some specific tests for resultcode, fix proofing cost spec
zachmargolis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| module Acuant | ||
| module ResultCodes | ||
| ResultCode = Struct.new(:code, :name, :billed) do | ||
| alias_method :billed?, :billed | ||
| end | ||
|
|
||
| # The authentication test results are unknown. We are not billed for these | ||
| UNKNOWN = ResultCode.new(0, 'Unknown', false).freeze | ||
| # The authentication test passed. | ||
| PASSED = ResultCode.new(1, 'Passed', true).freeze | ||
| # The authentication test failed. | ||
| FAILED = ResultCode.new(2, 'Failed', true).freeze | ||
| # The authentication test was skipped (was not run). | ||
| SKIPPED = ResultCode.new(3, 'Skipped', true).freeze | ||
| # The authentication test was inconclusive and further investigation is warranted. | ||
| CAUTION = ResultCode.new(4, 'Caution', true).freeze | ||
| # The authentication test results requires user attention. | ||
| ATTENTION = ResultCode.new(5, 'Attention', true).freeze | ||
|
|
||
| ALL = [ | ||
| UNKNOWN, | ||
| PASSED, | ||
| FAILED, | ||
| SKIPPED, | ||
| CAUTION, | ||
| ATTENTION, | ||
| ].freeze | ||
|
|
||
| BY_CODE = ALL.map { |r| [r.code, r] }.to_h.freeze | ||
|
|
||
| # @return [ResultCode] | ||
| def self.from_int(code) | ||
| BY_CODE[code] | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ def call | |
| success: success?, | ||
| errors: errors, | ||
| pii_from_doc: pii_from_doc, | ||
| billed: true, | ||
| ) | ||
| end | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
db/migrate/20200731213827_add_acuant_result_to_proofing_costs.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| class AddAcuantResultToProofingCosts < ActiveRecord::Migration[5.2] | ||
| def change | ||
| add_column :proofing_costs, :acuant_result_count, :integer, default: 0 | ||
mitchellhenke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| end | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| require 'rails_helper' | ||
|
|
||
| RSpec.describe Acuant::ResultCodes do | ||
| describe '.from_int' do | ||
| it 'is a result code for the int' do | ||
| result_code = Acuant::ResultCodes.from_int(1) | ||
| expect(result_code).to be_a(Acuant::ResultCodes::ResultCode) | ||
| expect(result_code.billed?).to eq(true) | ||
| end | ||
|
|
||
| it 'is nil when there is no matching code' do | ||
| result_code = Acuant::ResultCodes.from_int(999) | ||
| expect(result_code).to be_nil | ||
| end | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@stevegsa just wanted to check my understanding on this...the only time we call the
GetResultsAPI is inside of this API where we post all 3 ---- but that's the newer flow right? Do you know which endpoint in the older flow we want to be be checking for this result code in?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.
Unfortunately it looks like somebody removed the code to add_cost on the results call.
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.
Actually it looks good. Those results calls are in fetch_doc_auth_results_or_redirect_to_selfie
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.
OK so
back_image_stepneeds cost info added?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.
added in 558d514