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

Add new fields to Pii::StateId #11543

Merged
merged 5 commits into from
Nov 26, 2024
Merged

Conversation

jmhooper
Copy link
Contributor

We are planning to validate additional data that appears on the state ID with the issuing source via DLDV. In order to facilitate this new feature this change adds fields for the new attributes to the StateId struct. This struct is used to represent the State ID data when it is in the IdV session.

@jmhooper
Copy link
Contributor Author

I'm marking this a WIP since it looks like Data does not support optional attrs. I'll need to work on this to make sure it doesn't introduce 50/50 state issues

@zachmargolis
Copy link
Contributor

I'm marking this a WIP since it looks like Data does not support optional attrs. I'll need to work on this to make sure it doesn't introduce 50/50 state issues

Or switch back to RedactedStruct?

@jmhooper
Copy link
Contributor Author

I ended up coming up with this:

def pii_from_doc
  return nil if session[:pii_from_doc].blank?
  state_id_data = Pii::StateId.members.index_with { |key| session[:pii_from_doc][key] }
  Pii::StateId.new(**state_id_data)
end

This should build out a hash with all of the required args even if they aren't present in the session.

The old implementation should be compatible since it will remove the unsupported args with Hash#slice.

@jmhooper jmhooper force-pushed the jmhooper-add-new-state-id-attributes branch from f8f3281 to e954f2c Compare November 25, 2024 15:20
We are planning to validate additional data that appears on the state ID with the issuing source via DLDV. In order to facilitate this new feature this change adds fields for the new attributes to the `StateId` struct. This struct is used to represent the State ID data when it is in the IdV session.

[skip changelog]
@jmhooper jmhooper force-pushed the jmhooper-add-new-state-id-attributes branch from e954f2c to 1f7013a Compare November 26, 2024 14:48
@jmhooper jmhooper merged commit de2bed1 into main Nov 26, 2024
2 checks passed
@jmhooper jmhooper deleted the jmhooper-add-new-state-id-attributes branch November 26, 2024 17: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.

3 participants