Repository navigation
Conversation
dburkhart07
left a comment
There was a problem hiding this comment.
upon talking with the client yesterday, i think the scope of this ticket may have changed slightly. volunteers will now likely change their animalUpdates preferences in the same space as the rest of their profile. because of this, rather having an entirely separate endpoint, i think we can just have it be an additional field within the update-volunteer.dto.ts file (this should be in the main branch, you just need to merge the changes in). do you think you could refactor it to this instead, and make sure the already established update volunteer endpoint works with the new boolean field?
| import { FosterType } from '../volunteers.types'; | ||
| import { Homebase } from '../../types'; | ||
|
|
||
| const validBody = { |
There was a problem hiding this comment.
we normally don't write test files for our dtos. this is because we are relying under the assumption that our validators work and will make sure we have valid inputs. our class-validators are coming from nestjs, which we assume already works.
because of this, do you think we could delete the two spec files here?
ℹ️ Issue
Closes MSPCA-24
Stacked on #8 (MSPCA-20). Merge #8 first, then retarget this to main
📝 Description
Lets foster volunteers opt in or out of hearing what happens to an animal after it returns to MSPCA, and changes
foster_typefrom a single value to a listChanges:
animal_updatesboolean column onfoster_volunteers(defaulttrue), with a migrationfoster_typeis now an array offoster_type_enum; the same migration converts existing values to single-item lists (USING ARRAY["foster_type"])PATCH /api/volunteers/:id/animal-updateswithUpdateAnimalUpdatesDtoCreateVolunteerDto.fosterTypeis nowFosterType[]; an empty list is rejectedfosterType✔️ Verification
Ran the full backend suite: 22 suites, 250 tests pass. Ran the migration against local Postgres and confirmed in pgAdmin that
animal_updatesis boolean with defaulttrueandfoster_typeisfoster_type_enum[]. The single-value-to-array conversion was not run on real data, since my local database had no volunteer rows🏕️ (Optional) Future Work / Notes
downkeeps only the first foster type per volunteer.config/migrations.tsmay conflict with the coordinator migration (MSPCA-19), keep both entries