Skip to content

LG-6708 Add additional columns to in_person_enrollments table#6556

Merged
tomas-nava merged 5 commits intomainfrom
shanice/lg-6708-add-new-columns-to-in-person-enrollments
Jul 14, 2022
Merged

LG-6708 Add additional columns to in_person_enrollments table#6556
tomas-nava merged 5 commits intomainfrom
shanice/lg-6708-add-new-columns-to-in-person-enrollments

Conversation

@x341x
Copy link
Contributor

@x341x x341x commented Jul 7, 2022

  • Adds the columns current_address_matches_id and selected_location_details to the in_person_enrollments table
  • The ticket specified using add_index and remove_index in the migration for the above changes but add_column was used instead for both tables migration
  • Class InPersonEnrollment statuses were modified to include "establishing: 0", and moved previous status down

@x341x x341x requested a review from tomas-nava July 7, 2022 17:23
Comment on lines +5 to +10
establishing: 0,
pending: 1,
passed: 2,
failed: 3,
expired: 4,
canceled: 5,
Copy link
Contributor

Choose a reason for hiding this comment

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

In general I think renumbering enums like this is dangerous.... since we haven't launched yet this is probably fine. I think it would preferable to do establishing: 7 in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to it not being in production we won't break anything also establishing is the phase that comes before pending so logically that order makes sense

class AddAddressAndLocationToInPersonEnrollment < ActiveRecord::Migration[6.1]
def change
add_column :in_person_enrollments, :current_address_matches_id, :boolean, comment: "True if the user indicates that their current address matches the address on the ID they're bringing to the Post Office."
add_column :in_person_enrollments, :selected_location_details, :jsonb, comment: "The location details of the Post Office the user selected (including title, address, hours of operation)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does USPS give us any location identifier we could use instead of storing a blob of the full details? A concern I'd have is that we'd be storing a lot of duplicate data with this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unforunately there's no API to look up locations by ID at this point

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to be able to do a look-up with this field data? I'd wonder if we could at least create our own identifier as e.g. a fingerprint/hash of the location data blob.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, we won't need to do a look-up with this field data, for now.

Copy link
Contributor

@tomas-nava tomas-nava left a comment

Choose a reason for hiding this comment

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

This looks good to me; let's pair to resolve conflicts and merge.

Tomas Apodaca added 2 commits July 13, 2022 22:12
@tomas-nava tomas-nava changed the title LG-6708 Adds additional columns to in_person_enrollments table LG-6708 Add additional columns to in_person_enrollments table Jul 14, 2022
@tomas-nava tomas-nava merged commit 8584f8f into main Jul 14, 2022
@tomas-nava tomas-nava deleted the shanice/lg-6708-add-new-columns-to-in-person-enrollments branch July 14, 2022 17:32
failed: 2,
expired: 3,
canceled: 4,
establishing: 0,
Copy link
Contributor

@aduth aduth Jul 15, 2022

Choose a reason for hiding this comment

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

Reading the associated ticket, if the new establishing status is meant to allow us to create an enrollment record before we've called out to the USPS API, would it also be expected that the Enrollment's profile could now also be optional? I guess I'm imagining a scenario where we create the enrollment early enough in the process that the profile hasn't been created yet, we'd need to save it without a profile, and update it later to assign the profile (when the profile is created at the password submission step).

Am I understanding correctly, @x341x @tomas-nava ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Following up on this; at the moment the enrollment is only in establishing for a few moments before it's set to pending, and this all happens when the profile definitely exists. If we end up needing to create the enrollment earlier, we will think about whether the profile should be optional.

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