position migration ¶
March 2021, we needed to migrate/convert positions from one type to another, and update related shifts accordingly.
It was decided to do this for past as well as future shifts for consistency. CATS-48 links to more detail.
This is an effort to reduce shifts like
“surgery” “surgery: promoted” “surgery: weekend promoted”
to just “surgery”.
The ‘promoted’ name is now (CATS-36) an incentive type, and the migration process tool allows a user to add the ‘promoted’ incentive on to the converted shifts.
The original shift position is logged in legacy_shift_position table, and a ‘revert’ button will allow shifts in that table to update the corresponding shift to the earlier position. Any ‘promoted’ incentive will be removed and the data will be removed from legacy_shift_position table.
At core, ConvertShiftPositions.php artisan command is invoked, which calls ConvertShiftPosition action. The UI/controller are front-end wrappers around calls to ConvertShiftPositions command.
There is a feature flag around this, to allow for disabling access to this once the migration is complete.
April 2021 ¶
Earlier, a ‘convert positions’ button was added to associate positions directly with hospitals. There’s no direct need for this now, so the button on ‘tools’ page was removed. Associated route, command and class were removed as well. CATS-152 was done to associate positions directly with seeded hospitals.