feat(core-flows, fulfillment): validate shipping options to stock locations (#8291)

what:

- validate shipping options to stock locations

RESOLVES CC-232
This commit is contained in:
Riqwan Thamir
2024-07-26 14:26:26 +02:00
committed by GitHub
parent 74d0d166b3
commit 91c17651f1
23 changed files with 607 additions and 18 deletions
@@ -130,6 +130,17 @@ export async function prepareDataFixtures({ container }) {
},
])
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
const shippingOptionData: FulfillmentWorkflow.CreateShippingOptionsWorkflowInput =
{
name: "Shipping option",
@@ -117,6 +117,17 @@ async function prepareDataFixtures({ container }) {
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
@@ -43,6 +43,7 @@ async function prepareDataFixtures({ container }) {
const pricingModule = container.resolve(ModuleRegistrationName.PRICING)
const inventoryModule = container.resolve(ModuleRegistrationName.INVENTORY)
const customerService = container.resolve(ModuleRegistrationName.CUSTOMER)
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
const customer = await customerService.createCustomers({
first_name: "joe",
@@ -98,6 +99,17 @@ async function prepareDataFixtures({ container }) {
},
})
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
const [product] = await productModule.createProducts([
{
title: "Test product",
@@ -150,8 +162,6 @@ async function prepareDataFixtures({ container }) {
},
])
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
@@ -115,6 +115,17 @@ async function prepareDataFixtures({ container }) {
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
@@ -42,6 +42,7 @@ async function prepareDataFixtures({ container }) {
const productModule = container.resolve(ModuleRegistrationName.PRODUCT)
const pricingModule = container.resolve(ModuleRegistrationName.PRICING)
const inventoryModule = container.resolve(ModuleRegistrationName.INVENTORY)
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
const shippingProfile = await fulfillmentService.createShippingProfiles({
name: "test",
@@ -92,6 +93,17 @@ async function prepareDataFixtures({ container }) {
},
})
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
const [product] = await productModule.createProducts([
{
title: "Test product",
@@ -117,8 +129,6 @@ async function prepareDataFixtures({ container }) {
},
])
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
@@ -124,6 +124,17 @@ async function prepareDataFixtures({ container }) {
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
@@ -118,6 +118,17 @@ async function prepareDataFixtures({ container }) {
const remoteLink = container.resolve(ContainerRegistrationKeys.REMOTE_LINK)
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
stock_location_id: location.id,
},
[Modules.FULFILLMENT]: {
fulfillment_provider_id: "manual_test-provider",
},
},
])
await remoteLink.create([
{
[Modules.STOCK_LOCATION]: {
@@ -29,7 +29,6 @@ medusaIntegrationTestRunner({
beforeEach(async () => {
fixtures = await prepareDataFixtures({ container })
order = await createOrderFixture({
container,
product: fixtures.product,