Skip to content

[SSF-129] add tracking link and shipping cost to order#95

Open
amywng wants to merge 10 commits intomainfrom
acw/SSF-129-orders-backend-updates
Open

[SSF-129] add tracking link and shipping cost to order#95
amywng wants to merge 10 commits intomainfrom
acw/SSF-129-orders-backend-updates

Conversation

@amywng
Copy link
Member

@amywng amywng commented Feb 2, 2026

ℹ️ Issue

Closes SSF-129

📝 Description

  • Added two fields to order entity: shippingCost and trackingLink and corresponding migration
  • Added endpoint to fill tracking link and shipping cost
  • Added controller test

✔️ Verification

Verified endpoint on Postman and data changes in pgAdmin

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

@dburkhart07 dburkhart07 self-requested a review February 4, 2026 01:54
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. Can you update the frontend type for Order too while you're at it?

@amywng amywng requested a review from dburkhart07 February 4, 2026 04:13
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.

Approving for now with a question for @Yurika-Kan and @sam-schu.

Perhaps, in the service function, do we want to make sure that we are not putting a tracking link and shipping cost on a pending order? I imagine the flow is that we would never want to call this endpoint on a pending order (if its going from pending to shipped, id imagine we would first call updateStatus and then this one, to which we could still implement this).

@Yurika-Kan Yurika-Kan self-requested a review February 6, 2026 09:21
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.

initial comments! side note github actions looking good >o<

.createQueryBuilder()
.update(Order)
.set({
trackingLink: dto.trackingLink,
Copy link
Collaborator

Choose a reason for hiding this comment

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

note (for future): missing service tests for updateTrackingAndCost - for later (or soon...) rewriting tests with new structure

@Yurika-Kan
Copy link
Collaborator

Yurika-Kan commented Feb 7, 2026

Approving for now with a question for @Yurika-Kan and @sam-schu.

Perhaps, in the service function, do we want to make sure that we are not putting a tracking link and shipping cost on a pending order? I imagine the flow is that we would never want to call this endpoint on a pending order (if its going from pending to shipped, id imagine we would first call updateStatus and then this one, to which we could still implement this).

this is a good catch - i agree. i'm thinking we could approach this in 2 design ways:
A: Update status to shipped (or delivered) --> then add tracking - add guarding so pending orders cannot have tracking link & shipping cost added

  • users can update shipping link & cost as long as status is shipped / delivered
    B: Update tracking link --> then call update status to "shipped" & set shippedAt - add guarding so delivered orders' tracking links cannot be updated

edit: A works with our UI design i believe because we are prompted to upload tracking link in the complete required actions modal when order status changes or some criteria

do we want tracking link & cost to be a one time entry that is set & cannot be changed? - if so then my comments will be in pending... buffering...

@sam-schu @amywng lmk your thoughts

@amywng
Copy link
Member Author

amywng commented Feb 8, 2026

Approving for now with a question for @Yurika-Kan and @sam-schu.
Perhaps, in the service function, do we want to make sure that we are not putting a tracking link and shipping cost on a pending order? I imagine the flow is that we would never want to call this endpoint on a pending order (if its going from pending to shipped, id imagine we would first call updateStatus and then this one, to which we could still implement this).

this is a good catch - i agree. i'm thinking we could approach this in 2 design ways: A: Update status to shipped (or delivered) --> then add tracking - add guarding so pending orders cannot have tracking link & shipping cost added

  • users can update shipping link & cost as long as status is shipped / delivered
    B: Update tracking link --> then call update status to "shipped" & set shippedAt - add guarding so delivered orders' tracking links cannot be updated

edit: A works with our UI design i believe because we are prompted to upload tracking link in the complete required actions modal when order status changes or some criteria

do we want tracking link & cost to be a one time entry that is set & cannot be changed? - if so then my comments will be in pending... buffering...

@sam-schu @amywng lmk your thoughts

I think option A is good, I just added a check to make sure the status is shipped before setting them

@amywng amywng requested a review from Yurika-Kan February 8, 2026 01:49
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.

4 participants