Skip to content

Conversation

@Juwang110
Copy link

ℹ️ Issue

Closes https://vidushimisra.atlassian.net/browse/SSF-108

📝 Description

  1. I refactored the frontend and backend request types/entities to now have a list of Orders a single request is associated with as opposed to just one. This accurately reflects the many to one relationship with multiple orders being able to fulfill a request
  2. I added a route to get all associated order details from a request. This will be necessary for the new request management page and viewing details of that request.

In terms of code changes it was mainly defining the new backend route and writing tests for that. The backend route I added is:
@get('/get-all-order-details/:requestId'). I also had to do some refactoring to transition from one associated order to a list of them.

Also, right now the request management page is outdated. For one, it is still associating one order with one request and for another, request management and order management is now being split into to pages. I had to refactor this outdated page for the updated request type and I chose to simply use the first order in the orders list (orders[0]) and have everything else be the same. Thus, this page does not work as intended but it can still be loaded. This change is just a placeholder for now, the new design pages will take over. The associated route is: request-form/:pantryId

✔️ Verification

I used swagger to verify my backend route worked as expected and I wrote some jest tests to ensure this. I added controller and service tests for the @get('/get-all-order-details/:requestId') route.

Screenshot 2026-01-14 221716

🏕️ (Optional) Future Work / Notes

The request form frontend is outdated and my refactoring of it to account for the orders list is just a placeholder. This will be overwritten in the future.

@dburkhart07 dburkhart07 self-requested a review January 19, 2026 20:59
Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few initial things, but looks pretty good so far

@Juwang110 Juwang110 requested a review from Yurika-Kan January 23, 2026 21:09
Copy link
Collaborator

@Yurika-Kan Yurika-Kan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a nit comment but approving! looks good awesome job:)

requestId: number,
): Promise<OrderDetails[]> {
return this.axiosInstance
.get(`api/requests/get-all-order-details/${requestId}`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit but let's make the routes uniform to have the leading "/" before api

Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small things, also see slack comments.

import { FoodRequest } from './request.entity';
import { validateId } from '../utils/validation.utils';
import { RequestSize } from './types';
import { OrderStatus } from '../orders/types';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we removed this, since its unused?

},
});

if (!orders.length) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should check to make sure orders exists first here, and then check the length. I think, if it also doesnt exist, perhaps we should throw an error instead that there are no orders associated with this request.

<Dialog.Content maxW={650}>
<Dialog.Header pb={0} mt={2}>
<Dialog.Title fontSize="lg" fontWeight={700} fontFamily="inter">
{readOnly

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need these readOnly attributes. Seems like every single use of this puts readOnly to false, so none of this info is actually being processed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants