-
Notifications
You must be signed in to change notification settings - Fork 0
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
Commit to meal request mutation #105
Conversation
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.
Hey William, this looks great, thanks for working on it and also writing great tests!
I just went ahead and made a tiny change, replacing "donor_id" to requester in the graphql mutation, this is so its consistent with the other requests, since the plan is to later on put a check higher up that makes sure that the whatever user is put as the "requester" is indeed the user logged in for security reasons, and that'll be easier to do if the name of the field is consistent across all the mutations & queries.
Though I do see the value of calling it "donor_id", since in theory the admin could be the one calling the endpoint, but we don't have any plans to allow the admin to do this, so in this case I think having it as "requester" is fine.
Feel free to merge when you want!
Notion Ticket Link
https://www.notion.so/uwblueprintexecs/Create-commitToMealRequests-mutation-8c569bebbc1f4f54ad19bdc79efdaff5?pvs=4
Implementation Description
meal_description
field in theDonationInfo
model tofood_description
, to match the term used in the UI.commitToMealRequest
mutation that allows aDonor
to commit to one or multiple meal requests at a time.commitToMealRequest
mutation, both happy path and important error casesSteps To Test
commitToMealRequest
mutation. FordonorId
, use aUser
document that hasinfo.role
=Donor
(I used652d73501b41877577c18eb4
). FormealRequestIds
, use ameal_request
ID or IDs for documents withstatus
=Open
(I used64da70f493361369d40aab2d
). Example mutation provided below:Fulfilled
, and thedonationInfo
should be populated or updated.donation_info.commitment_date
should be changed to today's date.make betest
What Should Reviewers Focus On?
backend/app/services/implementations/meal_request_service.py
, since this is where the meal request document is updated and error handling is done.Checklist