Skip to content

bug - missing incentive display

CATS-647

background

Earlier ‘fix’ for CATS-634 deleted duplicated timesheetentry records, which were created in error (see 634 for more info). In addition to a preventive step, a command to delete duplicated entries was created and run.

However, the query builder in AdminShiftRepository::getAssignedShiftsForUser() call was not explicitly filtering out deleted timesheetentries records.
The query count()s related incentives, and assumes 1 or 0. Because stray deleted timesheet entry records were still included, we saw numbers that were not 0 or 1.

Example shift record in JSON

"id": "a9d13e2c-ecd9-41b7-933b-408689dc74c6"
...
"employee_id": 1
"invoice_id": null
"timezone": "America/New_York"
"position_id": 1
...
"flex_hours": 4
"paid_travel": 4
"promoted": 4
"is_new_pending": false

Client side code was not showing incentives such as ‘flex_hours’ because the value was not 0 or 1.

Query patch in getAssignedShiftsForUser() stack was modified to exclude deleted timesheet entries.

Patched return value

"id": "a9d13e2c-ecd9-41b7-933b-408689dc74c6"
...
"employee_id": 1
"invoice_id": null
"timezone": "America/New_York"
"position_id": 1
...
"flex_hours": 1
"paid_travel": 1
"promoted": 1
"is_new_pending": false