-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDI-226: ♻️ Switch to new suspended activities endpoint #2187
Conversation
activity.bookingId === attendance.bookingId && | ||
moment(activity.startTime).format('YYYY-MM-DD') === attendance.eventDate && | ||
activity.eventId === attendance.eventId | ||
(attendance) => activity.eventId === attendance.eventId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eventId
is the primary key for an activity anyway, so no need to filter by extra criteria
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EVENT_ID
comes from the OFFENDER_COURSE_ATTENDANCES
table. I think the confusion arises since in order to join to that table one needs to:
JOIN OFFENDER_COURSE_ATTENDANCES OCA ON OCA.OFFENDER_BOOK_ID = OPP.OFFENDER_BOOK_ID AND
OCA.EVENT_DATE = CS.SCHEDULE_DATE AND
OCA.CRS_SCH_ID = CS.CRS_SCH_ID
so if we had a courseScheduleId
instead we would need to use all three fields.
I have confirmed this by calling the activities-by-date-range
endpoint for a period of a week and checking that each activity has a different event id.
firstName: 'Offender', | ||
lastName: 'Four', | ||
comment: 'Cleaner', | ||
suspended: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was previously being filtered in the typescript, but no need now as Prison API only returns the suspended ones
@@ -696,7 +684,7 @@ describe('Attendance reason statistics', () => { | |||
comments: 'Did not ask nicely', | |||
}, | |||
{ | |||
eventId: 4, | |||
eventId: 5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to change the eventId
here as the values are unique in the database
1bb58bf
to
f07e1dc
Compare
@@ -65,6 +65,7 @@ module.exports = (on) => { | |||
auth.stubUserMe(username, 12345, 'James Stuart', caseload), | |||
prisonApi.stubUserCaseloads(caseloads), | |||
tokenverification.stubVerifyToken(true), | |||
keyworker.stubKeyworkerMigrated(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was annoying me as was causing all signins to display the sorry page instead of the home page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
No description provided.