Conversation
dburkhart07
left a comment
There was a problem hiding this comment.
Some initial comments. Good first pass though! 🥇
apps/backend/src/migrations/1770571145350-MoveRequestFieldsToOrders.ts
Outdated
Show resolved
Hide resolved
dburkhart07
left a comment
There was a problem hiding this comment.
few more small things. looks great so far!!
| @@ -0,0 +1,5 @@ | |||
| export class ConfirmDeliveryDto { | |||
| dateReceived: string; | |||
| feedback: string; | |||
There was a problem hiding this comment.
i think the feedback is still optional when we send this over. correct me if im wrong.
|
|
||
| it('should upload photos and confirm delivery with all fields', async () => { | ||
| const orderId = 1; | ||
| const body = { |
| dateReceived: new Date().toISOString(), | ||
| feedback: 'Great delivery!', | ||
| }; | ||
| const mockFiles = [ |
| }); | ||
|
|
||
| // Check if all orders for this request are delivered | ||
| const allDelivered = updatedRequest.orders.every( |
There was a problem hiding this comment.
since we are using a testing database, we should know the outcome of this. we should not have a conditional, but rather simulate a test where this order is marked as delivered. maybe we have 2 tests, one where the order is delivered, but the request isnt fulfilled (status is active still), and another where it does get closed by this last order being fulfilled. the second test described here is already below, so lets just remove the conitionals and go with the first option.
| ) | ||
| async confirmDelivery( | ||
| @Param('orderId', ParseIntPipe) orderId: number, | ||
| @Body() body: ConfirmDeliveryDto, |
There was a problem hiding this comment.
Can we not parse the body in the controller, and instead parse it in the service fucntion, for consistency?
| .execute(); | ||
| } | ||
|
|
||
| async confirmDelivery( |
There was a problem hiding this comment.
take in the dto, validate each field, and then do this assigning
ℹ️ Issue
Closes SSF-125
📝 Description
Moved delivery confirmation fields from Food Requests to Orders and implemented request status logic. This change reflects where delivery details are specific to individual orders instead of the entire request.
Backend Changes:
✔️ Verification