feat(core-flows, dashboard, link-modules,medusa, types, utils): fulfillment shipping changes (#10902)

**What**
- product <> shipping profile link
- create and update product workflows/endpoints accepts shipping profile
- pass shipping option id when creating fulfillment to allow overriding customer selected SO
- validate shipping profile delete
- dashboard
  - set shipping profile on product create
  - manage shipping profile for a product
  - **update the create fulfillment form**
- other
  - fix create product form infinite rerenders
 
---

CLOSES CMRC-831 CMRC-834 CMRC-836 CMRC-837 CMRC-838 CMRC-857 TRI-761
This commit is contained in:
Frane Polić
2025-01-27 12:00:20 +00:00
committed by GitHub
parent 3e81962503
commit 864d772e34
78 changed files with 3529 additions and 794 deletions
@@ -1,6 +1,7 @@
import {
AdminInventoryItem,
AdminProduct,
AdminShippingProfile,
AdminStockLocation,
MedusaContainer,
} from "@medusajs/types"
@@ -18,6 +19,8 @@ export async function createOrderSeeder({
additionalProducts,
stockChannelOverride,
inventoryItemOverride,
shippingProfileOverride,
withoutShipping,
}: {
api: any
container: MedusaContainer
@@ -26,6 +29,8 @@ export async function createOrderSeeder({
stockChannelOverride?: AdminStockLocation
additionalProducts?: { variant_id: string; quantity: number }[]
inventoryItemOverride?: AdminInventoryItem
shippingProfileOverride?: AdminShippingProfile
withoutShipping?: boolean
}) {
const publishableKey = await generatePublishableKey(container)
@@ -86,13 +91,15 @@ export async function createOrderSeeder({
adminHeaders
)
const shippingProfile = (
await api.post(
`/admin/shipping-profiles`,
{ name: `test-${stockLocation.id}`, type: "default" },
adminHeaders
)
).data.shipping_profile
const shippingProfile =
shippingProfileOverride ??
(
await api.post(
`/admin/shipping-profiles`,
{ name: `test-${stockLocation.id}`, type: "default" },
adminHeaders
)
).data.shipping_profile
const product =
productOverride ??
@@ -101,6 +108,7 @@ export async function createOrderSeeder({
"/admin/products",
{
title: `Test fixture ${shippingProfile.id}`,
shipping_profile_id: shippingProfile.id,
options: [
{ title: "size", values: ["large", "small"] },
{ title: "color", values: ["green"] },
@@ -217,6 +225,14 @@ export async function createOrderSeeder({
)
).data.cart
if (!withoutShipping) {
await api.post(
`/store/carts/${cart.id}/shipping-methods`,
{ option_id: shippingOption.id },
storeHeaders
)
}
const paymentCollection = (
await api.post(
`/store/payment-collections`,