Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/services/doc_auth/lexis_nexis/doc_pii_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module DocPiiReader
# @return [Pii::StateId, nil]
def read_pii(true_id_product)
id_auth_field_data = true_id_product&.dig(:IDAUTH_FIELD_DATA)
authentication_result_field_data = true_id_product&.dig(:AUTHENTICATION_RESULT)
return nil unless id_auth_field_data.present?

state_id_type_slug = id_auth_field_data['Fields_DocumentClassName']
Expand All @@ -42,7 +43,7 @@ def read_pii(true_id_product)
month: id_auth_field_data['Fields_DOB_Month'],
day: id_auth_field_data['Fields_DOB_Day'],
),
sex: parse_sex_value(id_auth_field_data['Fields_Sex']),
sex: parse_sex_value(authentication_result_field_data&.[]('Sex')),
height: parse_height_value(id_auth_field_data['Fields_Height']),
weight: nil,
eye_color: nil,
Expand Down Expand Up @@ -87,10 +88,10 @@ def parse_sex_value(sex_attribute)
# This code will return `nil` for those cases with the intent that they will not be verified
# against the DLDV where they will not be recognized
#
case sex_attribute&.upcase
when 'M'
case sex_attribute
when 'Male'
'male'
when 'F'
when 'Female'
'female'
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,6 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "12345"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Height",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,11 +714,6 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "12345"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Height",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,7 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "12345"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_ControlNumber",
"Values": [{"Value": "6820051160"}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,6 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "02809-2366"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_ControlNumber",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,6 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "02809-2366"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_ControlNumber",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,6 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "02809-2366"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_ControlNumber",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,6 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "02809-2366"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_ControlNumber",
Expand Down Expand Up @@ -737,4 +732,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,6 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "02809-2366"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_ControlNumber",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,6 @@
"Name": "Fields_PostalCode",
"Values": [{"Value": "02809-2366"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [{"Value": "M"}]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_ControlNumber",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,15 +697,6 @@
}
]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_Sex",
"Values": [
{
"Value": "M"
}
]
},
{
"Group": "IDAUTH_FIELD_DATA",
"Name": "Fields_ControlNumber",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
city: 'ANYTOWN',
state: 'MD',
dob: '1986-07-01',
sex: nil,
sex: 'male',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This changed because this test is using the true_id_response_success_with_liveness.json fixture. This fixture was recorded recently so it did not include a Fields_Sex attribute. It does, however, contain a sex attribute in the AUTHENTICATION_RESULT group. The changes in this PR result in male being read from the response for the sex value.

height: 69,
weight: nil,
eye_color: nil,
Expand Down