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:
@@ -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`,
|
||||
|
||||
Reference in New Issue
Block a user