Skip to content

migration for faa applicant immigration information into top level model#6114

Open
satish2025-crew wants to merge 5 commits intotrunkfrom
868hw0mvb
Open

migration for faa applicant immigration information into top level model#6114
satish2025-crew wants to merge 5 commits intotrunkfrom
868hw0mvb

Conversation

@satish2025-crew
Copy link
Copy Markdown
Contributor

@satish2025-crew satish2025-crew commented Mar 24, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

  • The title follows our guidelines
  • Tests for the changes have been added (for bug fixes/features), and they use let helpers and before blocks.
  • For all UI changes, there is Cucumber coverage.
  • Any endpoint touched in the PR has an appropriate Pundit policy. For open endpoints, the reasoning is documented in the PR and code.
  • Any endpoint modified in the PR only responds to the expected MIME types.
  • For all scripts or rake tasks, how to run them is documented in both the PR and the code.
  • There are no inline styles added.
  • There is no inline JavaScript added.
  • There is no hard-coded text added/updated in helpers/views/JavaScript. New/updated translation strings do not include markup/styles unless there is supporting documentation.
  • Code does not use .html_safe.
  • All images added/updated have alt text.
  • Does not bypass RuboCop rules in any way.

PR Type

What kind of change does this PR introduce?:

  • Bugfix
  • Feature (requires Feature flag)
  • Data fix, Migration, or Report (inert code, no impact until run)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • CI related changes
  • Dependency updates (e.g., add a new gem or update to a version)
  • Release (Prepares code for a release, e.g., version bumps, changelog updates, tagging, deployment scripts)

What is the ticket # detailing the issue?

Ticket: https://app.clickup.com/t/868hw0mvb

A brief description of the changes:

Current behavior: Immigration information present in FAA applicant

New behavior:

Adds new immigration_information model as part of the VLP upgrade to V37.1.2 project for separating immigration related information into a separate model for both Financial Assistance and Individual Market Applications.

Script 1: Migrate FAA flat fields → ImmigrationInformation

Copies vlp_subject, alien_number, i94_number, etc. from FAA applicants into the embedded top level ImmigrationInformation document.

bundle exec rails runner script/migrations/migrate_fa_applicant_immigration_information.rb 500 2025
Arg 1: batch_size (default 3000)
Arg 2: assistance_year (optional)

Script 2: Populate ImmigrationEvidence from VLP responses

Parses VLP JSON from request_results.raw_payload and writes response_code, lawful_presence_verified_code, five_year_bar_apply_code, etc. into ImmigrationEvidence fields.

For FAA applications

bundle exec rails runner script/migrations/populate_immigration_evidence_from_vlp_response.rb faa 500 2025

For QHP applications

bundle exec rails runner script/migrations/populate_immigration_evidence_from_vlp_response.rb qhp 500 2025
Arg 1: app_type — faa or qhp (default faa)
Arg 2: batch_size (default 3000)
Arg 3: assistance_year (optional)

Feature Flag

For all new feature development, a feature flag is required to control the exposure of the feature to our end users. A feature flag needs a corresponding environment variable to initialize the state of the flag. Please share the name of the environment variable below that would enable/disable the feature and indicate which client(s) it applies to.

Variable name:

  • DC
  • ME

Additional Context

Include any additional context that may be relevant to the peer review process.

@satish2025-crew satish2025-crew added enhancement New feature or request cr-152 VLP upgrade, Hub retry and HR1 labels Mar 24, 2026

applicant.build_immigration_information(attrs)
end

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.

can you compare migrated values here and push the status to CSV for reporting purposes? That way we can log or track what changed for each applicant (e.g., old_value -> new_value) rather than just that a change occurred — would make debugging and auditing easier.

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.

but here immigration information old value will be always nil as it is new model. Do we really need it?


def publish(row)
csv_headers = [
"Application HBX ID",
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.

can you also add application assistance year and application type, compared status

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.

updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cr-152 VLP upgrade, Hub retry and HR1 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants