Skip to content

LG-15437 Update PII validation#12027

Merged
theabrad merged 12 commits intomainfrom
abrad-lg0-15437-update-pii-validation
Mar 31, 2025
Merged

LG-15437 Update PII validation#12027
theabrad merged 12 commits intomainfrom
abrad-lg0-15437-update-pii-validation

Conversation

@theabrad
Copy link
Copy Markdown
Contributor

🎫 Ticket

Link to the relevant ticket:
LG-15437

🛠 Summary of changes

We are updating our PII validation to now include validation for Passport PII. Here we have separated State ID validations and Passport validations into their own sub classes.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Make sure validation specs pass

pii_like_keypaths: self.class.pii_like_keypaths,
pii_like_keypaths: self.class.pii_like_keypaths(document_type: state_id_type),
attention_with_barcode: attention_with_barcode?,
id_issued_status: pii_from_doc[:state_id_issued].present? ? 'present' : 'missing',
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.

I'm thinking would we want something like "N/A" here if we are checking passports rather than state id?


PII_ERROR_KEYS = %i[name dob address1 state zipcode jurisdiction state_id_number
dob_min_age].freeze
STATE_ID_TYPES = ['drivers_license', 'state_id_card', 'identification_card'].freeze
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.

It was in a test suite causing this to fail. I see it may have been taken out on the latest branch so I will remove it.


validate :passport_expired?

attr_reader :birth_place, :passport_expiration, :passport_issued, :state_id_type,
Copy link
Copy Markdown
Contributor

@amirbey amirbey Mar 27, 2025

Choose a reason for hiding this comment

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

seems like we should move away from this state_id_type naming ... created a ticket LG-16007

end

def self.pii_like_keypaths
def self.pii_like_keypaths(document_type: nil)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like we're always passing a value, should we remove the optional?

Suggested change
def self.pii_like_keypaths(document_type: nil)
def self.pii_like_keypaths(document_type:)


PII_ERROR_KEYS = %i[name dob address1 state zipcode jurisdiction state_id_number
dob_min_age].freeze
STATE_ID_TYPES = ['drivers_license', 'state_id_card', 'identification_card'].freeze
Copy link
Copy Markdown
Contributor

@amirbey amirbey Mar 27, 2025

Choose a reason for hiding this comment

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

i see you had to add identificatIon_card because it looks like we're processing the id type differently across vendors 😬
👀 LG-16008


validates :birth_place,
:passport_issued,
:issuing_country_code,
Copy link
Copy Markdown
Contributor

@amirbey amirbey Mar 28, 2025

Choose a reason for hiding this comment

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

i think we should validate this issuing_country_code is a valid territory ieUSA

@theabrad theabrad merged commit caa4d03 into main Mar 31, 2025
1 check passed
@theabrad theabrad deleted the abrad-lg0-15437-update-pii-validation branch March 31, 2025 15:12
@theabrad theabrad restored the abrad-lg0-15437-update-pii-validation branch April 4, 2025 17:50
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.

2 participants