Skip to content

LG-13578: Backfill sponsor id for in_person_enrollments#10872

Merged
eileen-nava merged 5 commits intomainfrom
em/13578-backfill-sponsor-id
Jun 26, 2024
Merged

LG-13578: Backfill sponsor id for in_person_enrollments#10872
eileen-nava merged 5 commits intomainfrom
em/13578-backfill-sponsor-id

Conversation

@eileen-nava
Copy link
Copy Markdown
Contributor

🎫 Ticket

LG-13578: Set Sponsor ID on existing enrollments in the database

🛠 Summary of changes

  • Write a rake task that will set the sponsor id on existing in_person_enrollments in the database that have a nil sponsor_id
  • Use the sponsor id associated with IPP for all existing enrollments

📜 Testing Plan

  • Run automated tests
  • Run the task in your local env: bundle exec rake in_person_enrollments:backfill_sponsor_id Confirm it succeeds.

#
task backfill_sponsor_id: :environment do |_task, _args|
with_timeout do
ipp_sponsor_id = IdentityConfig.store.usps_ipp_sponsor_id.to_i
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.

Check out this PR. The sponsor_id on in_person_enrollments is a string. What do you think about deleting to_i?

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.

Thanks for catching that! I made the change in cbe22ae.

Copy link
Copy Markdown
Contributor

@matthinz matthinz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@jennyverdeyen jennyverdeyen left a comment

Choose a reason for hiding this comment

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

LGTM! - Edited to state: tested locally, verified that nil values for sponsor_id gets updated after running the rake task.

Copy link
Copy Markdown
Contributor

@gina-yamada gina-yamada left a comment

Choose a reason for hiding this comment

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

Tested locally. InPersonEnrollments with nil value updated.

@eileen-nava eileen-nava merged commit e779ba9 into main Jun 26, 2024
@eileen-nava eileen-nava deleted the em/13578-backfill-sponsor-id branch June 26, 2024 18:32
@gina-yamada
Copy link
Copy Markdown
Contributor

@lmgeorge Here is the PR for the rake task to backfil sponsor id on in person enrollments

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.

4 participants