[SSF-212] Filter for approved pantry & FM Backend#182
Conversation
…y that is approved
…ons, fixes commit e537533
dburkhart07
left a comment
There was a problem hiding this comment.
some very small things, looks great though!
There was a problem hiding this comment.
Can we delete this since it's no longer used?
| ); | ||
| } | ||
|
|
||
| if (pantry.status !== ApplicationStatus.APPROVED) { |
There was a problem hiding this comment.
I don't think we need this one. Technically speaking, assuming we are doing proper checks for creating requests and orders, we should never have an unapproved pantry attached to request
| throw new NotFoundException(`Order ${orderId} not found`); | ||
| } | ||
|
|
||
| if (order.request.pantry.status !== ApplicationStatus.APPROVED) { |
| throw new NotFoundException(`Order ${orderId} not found`); | ||
| } | ||
|
|
||
| if (order.foodManufacturer.status !== ApplicationStatus.APPROVED) { |
|
I might wait until SSF-213 is approved/merged to resolve some of these conflicts since this is branched off of that ticket. |
dburkhart07
left a comment
There was a problem hiding this comment.
2 small things, but should be good after that! you should just be able to model the updateFoodManufacturerApplication tests off of the updatePantryApplication ones
| expect(pantryBefore?.volunteers).toEqual(pantryAfter?.volunteers); | ||
| }); | ||
|
|
||
| it(`throws ConflictException when updating volunteers for a pending pantry`, async () => { |
There was a problem hiding this comment.
Can we also specify the exact message for the exception?
| }); | ||
| }); | ||
|
|
||
| describe(`updateFoodManufacturerApplication`, () => { |
There was a problem hiding this comment.
I know this is kinda out of scope for your ticket, but would you mind writing the rest of the service tests for this function, just so we dont need to do it later?
ℹ️ Issue
Closes SSF-212
📝 Description
✔️ Verification
🏕️ (Optional) Future Work / Notes
updateFoodManufacturerApplicationinapps/backend/src/foodManufacturers/manufacturers.service.spec.tsBadRequestExceptionorConflictExceptionfor non-approved pantries/FMs based on neighboring code