From 2d0e50624fa37af5f74e46048a83ce3b39b210aa Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 22 Jan 2025 10:29:31 +0200 Subject: [PATCH] fix(core-flows): change some types to interfaces (#11061) --- .changeset/dry-mugs-bake.md | 5 +++++ .../fulfillment/workflows/batch-shipping-option-rules.ts | 6 +++--- .../src/inventory/workflows/batch-inventory-item-levels.ts | 2 +- .../src/product/workflows/batch-product-variants.ts | 6 +++--- .../core/core-flows/src/product/workflows/batch-products.ts | 4 ++-- .../src/promotion/workflows/batch-promotion-rules.ts | 6 +++--- 6 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 .changeset/dry-mugs-bake.md diff --git a/.changeset/dry-mugs-bake.md b/.changeset/dry-mugs-bake.md new file mode 100644 index 0000000000..22ba91d4cc --- /dev/null +++ b/.changeset/dry-mugs-bake.md @@ -0,0 +1,5 @@ +--- +"@medusajs/core-flows": patch +--- + +fix(core-flows): change some types to interfaces diff --git a/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts b/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts index 19052e6617..b9982b0c53 100644 --- a/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts +++ b/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts @@ -25,10 +25,10 @@ import { updateShippingOptionRulesStep } from "../steps/update-shipping-option-r * @property update - The shipping option rules to update. * @property delete - The IDs of the shipping option rules to delete. */ -export type BatchShippingOptionRulesInput = BatchWorkflowInput< +export interface BatchShippingOptionRulesInput extends BatchWorkflowInput< CreateShippingOptionRuleDTO, UpdateShippingOptionRuleDTO -> +> {} /** * The result of managing the shipping option rules in bulk. @@ -37,7 +37,7 @@ export type BatchShippingOptionRulesInput = BatchWorkflowInput< * @property updated - The shipping option rules that were updated. * @property deleted - The IDs of the shipping option rules that were deleted. */ -export type BatchShippingOptionRulesOutput = BatchWorkflowOutput +export interface BatchShippingOptionRulesOutput extends BatchWorkflowOutput {} export const batchShippingOptionRulesWorkflowId = "batch-shipping-option-rules" /** diff --git a/packages/core/core-flows/src/inventory/workflows/batch-inventory-item-levels.ts b/packages/core/core-flows/src/inventory/workflows/batch-inventory-item-levels.ts index 55e243c1d6..3ce9e0acc4 100644 --- a/packages/core/core-flows/src/inventory/workflows/batch-inventory-item-levels.ts +++ b/packages/core/core-flows/src/inventory/workflows/batch-inventory-item-levels.ts @@ -41,7 +41,7 @@ export interface BatchInventoryItemLevelsWorkflowInput * @property updated - The inventory levels that were updated. * @property deleted - The IDs of the inventory levels that were deleted. */ -export type BatchInventoryItemLevelsWorkflowOutput = BatchWorkflowOutput +export interface BatchInventoryItemLevelsWorkflowOutput extends BatchWorkflowOutput {} export const batchInventoryItemLevelsWorkflowId = "batch-inventory-item-levels-workflow" diff --git a/packages/core/core-flows/src/product/workflows/batch-product-variants.ts b/packages/core/core-flows/src/product/workflows/batch-product-variants.ts index cd5c648243..e967e6db61 100644 --- a/packages/core/core-flows/src/product/workflows/batch-product-variants.ts +++ b/packages/core/core-flows/src/product/workflows/batch-product-variants.ts @@ -19,15 +19,15 @@ import { deleteProductVariantsWorkflow } from "./delete-product-variants" /** * The product variants to manage. */ -export type BatchProductVariantsWorkflowInput = BatchWorkflowInput< +export interface BatchProductVariantsWorkflowInput extends BatchWorkflowInput< CreateProductVariantWorkflowInputDTO, UpdateProductVariantWorkflowInputDTO -> +> {} /** * The result of managing the product variants. */ -export type BatchProductVariantsWorkflowOutput = BatchWorkflowOutput +export interface BatchProductVariantsWorkflowOutput extends BatchWorkflowOutput {} export const batchProductVariantsWorkflowId = "batch-product-variants" /** diff --git a/packages/core/core-flows/src/product/workflows/batch-products.ts b/packages/core/core-flows/src/product/workflows/batch-products.ts index 66c1879377..9354c154ed 100644 --- a/packages/core/core-flows/src/product/workflows/batch-products.ts +++ b/packages/core/core-flows/src/product/workflows/batch-products.ts @@ -19,10 +19,10 @@ import { updateProductsWorkflow } from "./update-products" /** * The products to manage. */ -export type BatchProductWorkflowInput = BatchWorkflowInput< +export interface BatchProductWorkflowInput extends BatchWorkflowInput< CreateProductWorkflowInputDTO, UpdateProductWorkflowInputDTO -> +> {} export const batchProductsWorkflowId = "batch-products" /** diff --git a/packages/core/core-flows/src/promotion/workflows/batch-promotion-rules.ts b/packages/core/core-flows/src/promotion/workflows/batch-promotion-rules.ts index 51d492fdab..a3d5809e44 100644 --- a/packages/core/core-flows/src/promotion/workflows/batch-promotion-rules.ts +++ b/packages/core/core-flows/src/promotion/workflows/batch-promotion-rules.ts @@ -26,10 +26,10 @@ import { updatePromotionRulesWorkflow } from "./update-promotion-rules" * @property update - The rules to update. * @property delete - The IDs of the rules to delete. */ -export type BatchPromotionRulesWorkflowInput = BatchWorkflowInput< +export interface BatchPromotionRulesWorkflowInput extends BatchWorkflowInput< CreatePromotionRuleDTO, UpdatePromotionRuleDTO -> & { +> { id: string rule_type: RuleType } @@ -41,7 +41,7 @@ export type BatchPromotionRulesWorkflowInput = BatchWorkflowInput< * @property updated - The updated rules. * @property deleted - The deleted rule IDs. */ -export type BatchPromotionRulesWorkflowOutput = BatchWorkflowOutput +export interface BatchPromotionRulesWorkflowOutput extends BatchWorkflowOutput {} export const batchPromotionRulesWorkflowId = "batch-promotion-rules" /**