Skip to content

Add new fields to Pii::StateId#11543

Merged
jmhooper merged 5 commits intomainfrom
jmhooper-add-new-state-id-attributes
Nov 26, 2024
Merged

Add new fields to Pii::StateId#11543
jmhooper merged 5 commits intomainfrom
jmhooper-add-new-state-id-attributes

Conversation

@jmhooper
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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