F24/julia/activity management endpoints I #54
+508
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notion ticket link
Activity Management Endpoints I
Implementation description
activity_id
column from activity modelcreated_at
andupdated_at
columns in activity modelactivityUpdateDtoValidator
with all fields optional so that any subset of fields can be updatedbackend/typescript/middlewares/validators/util.ts
Steps to test
GET /activities
- Retrieves all activities.a. Accessible by Volunteer/Staff/Admin/Behaviourist
GET /activities/<id>
- Retrieves a specific activity by its ID.a. Accessible by Volunteer/Staff/Admin/Behaviourist
b. Invalid id
c. id not in database
POST /activities
- Creates a new activity. It can be created without a user and scheduled times.a. Not accessible by Volunteer/Staff roles
b. Accessible by Admins and Behaviourists
c. Creating without user, scheduledSartTime, startTme, endTime, notes
d. Creating with required field missing (idk if this error message is misleading)
e. Creating with invalid date
f. Creating with invalid other fields
g. Creating with non-existent petId, activityTypeId, or userId
PATCH /activities/<id>
- Updates other details of an activity (generic endpoint).a. Not accessible by Volunteer/Staff roles
b. Accessible by Admins and Behaviourists. Able to update any subset of fields
c. Trying to set a required field to null
d. Invalid id
e. id not in database
DELETE /activities/<id>
- Deletes an activity.a. Not accessible by Volunteer/Staff roles
b. Accessible by Admins and Behaviourists
c. Invalid id, id not in database tests are similar
What should reviewers focus on?
Checklist