Closed rrabinovitch closed 1 year ago
Questions to discuss:
11/29 progress update: pseudocoded to plan code changes. will catch up on latest discussion in C4 channel tomorrow in order to further flesh out pseudocode and start translating it into code changes.
11/30 progress update: built out the getter function. tomorrow will continue with adding in necessary checks/error handling and following up with setter function
associated service function should only allow activities of type: assignment to have this attribute updated
per 12/1 discussion w @daveytech and @phoebehala, this check should only be taken care of on the webapp side (see #428)
12/1 progress update:
res.status(201).json(itemEnvelope(updatedCompletionStatus);
==> "Argument of type 'void' is not assignable to parameter of type 'object'". Reading about this type of error, I think this can be traced to the setter function in the service file not having a return statement. Started a conversation about this in the C4 channel to get it sorted out.12/2 progress update:
completed
value the right wayHi there! I've merged in the latest changes from main to bring this branch up to date, and I tried to answer as many questions as I could. I love the communication and coordination with the other tickets, and you've got a strong start so far!
I've also added a stub for the route to get a list of all program activities and their completed statuses, which should help with the feature y'all were proposing at the end of last week.
Sorry about any confusion in the miscommunication about which functions would be throwing errors versus returning differently-shaped values.
As per our discussion this morning, I've removed the stubs I added before to restrict scope for the backend tickets. Valuable feedback, thanks!
12/6 progress update:
!activityCompletionStatus
- because the variable's value is a hash, not a boolean, so we do indeed want to be checking for an empty or null value12/7 progress update:
Expected behaviour
There should be two programs router functions that return a participant activity's
completed
status and allow for the value of that attribute to be modified.Details and resources
This ticket is associated with #454 and #457 in order to fulfill the product spec requirement for a user to be able to mark an activity as complete.
The two
programsRouter
functions should be something along the lines of:programsRouter.get('/activityStatus/:programId/:activityId')
- returns thecompleted
status of a givenparticipantActivity
. this function will allow a user to get their own status (admin access to be addressed later on)programsRouter.post('/activityStatus/:programId/:activityId')
- modifies thecompleted
value of an existingparticipantActivity
(POST
instead ofPUT
since we're creating new records instead of updating them)completed
value is being changed to (eg,{"completed": true}
)associated service function should only allow activities oftype: assignment
to have this attribute updatedThe functions should take the following parameters:
principal_id
(corresponding to the user whose activity status is being tracked),program_id
, andactivity_id
__tests__/programsRouter.ts
should also be updated to test these new router functions.Checklist