Release 2289
Trello card
Context
We need to reliably know whether a candidate is requesting and having an In school or Virtual experience when schools offer flexible dates.
We currently store the school experience type, but can be unclear, meaning either the school offers both types or the school experience type is shifted while there are pending requests and bookings.
Changes proposed in this pull request
- Add the experience type column in the PlacementRequest model
This allows to always know what experience type the candidate requested, but also to determine if the school experience type has shifted since a placement request was created.
- Add the experience type column in the Bookings model
This allows to know what experience type the candidate is actually going to have, so to display content relevant to In school or Virtual experiences. Also use to make more accurate reports.
- Migrate all current placement request and booking records
Update all placement requests and bookings to avoid creating data inconsistency issues in reports and in pending requests/bookings. The migration will be in batches of 100 to avoid running out of memory.
Finally, had to skip the placement requests validations due to data inconsistencies which are irrelevant to the experience type.
- Update PlacementRequest.create_from_registration_session to store the experience type based on the the school experience type
The experience type will be inherited from the school record when the request is created.
- Update the Booking.from_placement_request to try to store the booking experience type based on the the placement request experience type
The experience type will be inherited from the placement request record unless it's unclear, in which case user input will be required.
- Update the booking make changes page to ask schools to choose the experience type when it can't be determined by the system
Require user input when the placement request experience type is unclear
- Add #experience_type in the PlacementDate model
To simulate the experience type from the school, placement request and booking model.
- Refactor the preview_confirmation_email_controller to use the booking experience type to decide which email should preview and send
Guidance to review
Nothing should change visually regarding the fixed dates.
Flex dates:
-
When the experience type is clear, nothing should change visually. Both placement request and booking models should have the same experience type with the School's experience type. Also, the booking confirmation email should display the virtual content for 'Virtual' experiences and the in school content for 'In school' experiences. Finally, confirm the correct email has been received when creating the booking.
-
When the experience type is unclear, the experience type radio buttons should be displayed when accepting a request. The booking should then have the chosen experience type and based on that, it should display the equivalent content in the the preview email. Also confirm the correct email has been received when creating the booking.