fix(core-flows,types): general fixes to workflow types (#7392)

This commit is contained in:
Shahed Nasser
2024-05-22 11:27:12 +02:00
committed by GitHub
parent 5ede560f70
commit 2187b82d5d
5 changed files with 9 additions and 11 deletions
@@ -8,7 +8,7 @@ export const createShippingProfilesWorkflow = createWorkflow(
createShippingProfilesWorkflowId, createShippingProfilesWorkflowId,
( (
input: WorkflowData<FulfillmentWorkflow.CreateShippingProfilesWorkflowInput> input: WorkflowData<FulfillmentWorkflow.CreateShippingProfilesWorkflowInput>
): WorkflowData => { ): WorkflowData<FulfillmentWorkflow.CreateShippingProfilesWorkflowOutput> => {
const shippingProfiles = createShippingProfilesStep(input.data) const shippingProfiles = createShippingProfilesStep(input.data)
return shippingProfiles return shippingProfiles
@@ -1,4 +1,4 @@
import { ProductTypes, PricingTypes } from "@medusajs/types" import { ProductTypes } from "@medusajs/types"
import { import {
WorkflowData, WorkflowData,
createWorkflow, createWorkflow,
@@ -8,7 +8,7 @@ import { createProductsStep } from "../steps/create-products"
import { createVariantPricingLinkStep } from "../steps/create-variant-pricing-link" import { createVariantPricingLinkStep } from "../steps/create-variant-pricing-link"
import { createPriceSetsStep } from "../../pricing" import { createPriceSetsStep } from "../../pricing"
import { associateProductsWithSalesChannelsStep } from "../../sales-channel" import { associateProductsWithSalesChannelsStep } from "../../sales-channel"
import { CreateProductWorkflowInputDTO } from "@medusajs/types/src" import { CreateProductWorkflowInputDTO } from "@medusajs/types"
type WorkflowInput = { type WorkflowInput = {
products: CreateProductWorkflowInputDTO[] products: CreateProductWorkflowInputDTO[]
@@ -1,4 +1,4 @@
import { ShippingOptionPriceType } from "../../fulfillment" import { ShippingOptionDTO, ShippingOptionPriceType } from "../../fulfillment"
import { RuleOperatorType } from "../../common" import { RuleOperatorType } from "../../common"
export interface CreateShippingOptionsWorkflowInput { export interface CreateShippingOptionsWorkflowInput {
@@ -30,6 +30,4 @@ export interface CreateShippingOptionsWorkflowInput {
}[] }[]
} }
export type CreateShippingOptionsWorkflowOutput = { export type CreateShippingOptionsWorkflowOutput = ShippingOptionDTO[]
id: string
}[]
@@ -1,4 +1,4 @@
import { FilterableShippingProfileProps } from "../../fulfillment" import { FilterableShippingProfileProps, ShippingProfileDTO } from "../../fulfillment"
interface CreateShippingProfile { interface CreateShippingProfile {
name: string name: string
@@ -9,6 +9,8 @@ export interface CreateShippingProfilesWorkflowInput {
data: CreateShippingProfile[] data: CreateShippingProfile[]
} }
export type CreateShippingProfilesWorkflowOutput = ShippingProfileDTO[]
interface UpdateShippingProfile { interface UpdateShippingProfile {
name?: string name?: string
type?: string type?: string
@@ -1,9 +1,7 @@
import { CreateRegionDTO, RegionDTO } from "../../region" import { CreateRegionDTO, RegionDTO } from "../../region"
export interface CreateRegionsWorkflowInput { export interface CreateRegionsWorkflowInput {
regions: (CreateRegionDTO & { regions: CreateRegionDTO[]
payment_providers?: string[]
})[]
} }
export type CreateRegionsWorkflowOutput = RegionDTO[] export type CreateRegionsWorkflowOutput = RegionDTO[]