Skip to content
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

feat(dashboard): order fulfillment UI #7262

Merged
merged 25 commits into from
May 20, 2024
Merged

Conversation

fPolic
Copy link
Contributor

@fPolic fPolic commented May 7, 2024

WHAT

  • added "Unfulfilled items" and "Fulfilled items" sections to Order page
  • added Create Fulfillment flow
  • added Cancel Fulfillment flow
  • introduce Order<>Fulfillment link
    • to make this work I've (re)added order_id on Fulfillment but this might change

Screen.Recording.2024-05-07.at.18.20.00.mov

@fPolic fPolic added area: admin Created by Linear-GitHub Sync type: feature team: medusa labels May 7, 2024
Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 7:30am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) May 20, 2024 7:30am
docs-ui ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 7:30am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 7:30am

Copy link

changeset-bot bot commented May 7, 2024

🦋 Changeset detected

Latest commit: 78924e0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@medusajs/link-modules Patch
@medusajs/core-flows Patch
@medusajs/types Patch
@medusajs/utils Patch
@medusajs/medusa Patch
@medusajs/promotion Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@fPolic fPolic marked this pull request as ready for review May 7, 2024 16:23
@fPolic fPolic requested a review from a team as a code owner May 7, 2024 16:23
@fPolic fPolic changed the title feat(dashboard) order fulfillment UI feat(dashboard): order fulfillment UI May 7, 2024
@carlos-r-l-rodrigues
Copy link
Contributor

Does it make sense to have the link between Order and Fulfillment as a real link and not create order_id in the Fulfillment module?
I don't know when these are linked together, but either a workflow or an endpoint can simply call the remote link to join them together.

@fPolic
Copy link
Contributor Author

fPolic commented May 7, 2024

Does it make sense to have the link between Order and Fulfillment as a real link and not create order_id in the Fulfillment module?

Yes, agree! I wasn't sure what was originally planned regarding Fulfillement<>Order link so I added this as a temp solution to have E2E functionality but the flow should be revisited anyways and params need to be revisited as well. I can push the change tomorrow (or we can change this when we update the workflow).

EDIT: Opened a ticket in linear to revisit this relationship since there seems to be FulfillmentOrder entity planned?

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

Overall looks good – added a few comments and questions

@@ -23,13 +23,15 @@ export type AdminCancelFulfillmentType = z.infer<typeof AdminCancelFulfillment>
export const AdminCancelFulfillment = z.object({})

export type AdminCreateFulfillmentType = z.infer<typeof AdminCreateFulfillment>
// TODO: revisit the data shape this endpoint accepts
Copy link
Contributor

Choose a reason for hiding this comment

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

question: What do we need to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Accept either order or order_id
  2. We are missing notification flag
  3. Should the address be infered from the order instead of passing one?
  4. Same thing for provider_id, isn't shipping options/provider_id already set for the order?

sku: item.variant_sku || "",
}
}),
// TODO: should be optional in the enpoint?
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we should allow these to be manually passed. If you're using a provider, it will be responsible for the labels, but in some cases you would like to manually fulfill orders.

@@ -180,4 +180,7 @@ export type CreateFulfillmentWorkflowInput = {
* The associated fulfillment order.
*/
order: CreateFulfillmentOrderWorkflowDTO

// TODO: revisit - either remove `order_id` or `order`
order_id: string
Copy link
Contributor

Choose a reason for hiding this comment

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

thought(non-blocking): I think we should call order something different. It is really just additional context that you can pass upon creating a fulfillment. But not super important for this PR.

args: {
methodSuffix: "Fulfillments",
},
isList: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Shouldn't this be in the extends?

cc @carlos-r-l-rodrigues

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this was already changed. But the file looks ok.

# Conflicts:
#	packages/admin-next/dashboard/src/lib/client/client.ts

// TODO call the createReturn from the fulfillment provider

const link = transform(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

comment: removed from here since we link order <> fulfillment in the createFulfillmentWorkflow called aabove

@olivermrbl olivermrbl merged commit 521b4e7 into develop May 20, 2024
17 checks passed
@olivermrbl olivermrbl deleted the feat/order-fulfillment-ui branch May 20, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: admin Created by Linear-GitHub Sync team: medusa type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants