Skip to content

Commit

Permalink
chore(core-flows): general fixes to core-flows TSDocs (medusajs#11046)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored and noubase committed Jan 22, 2025
1 parent 42b79e8 commit e978795
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export const linkSalesChannelsToApiKeyWorkflowId =
* remove: ["sc_321"]
* }
* })
*
* @summary
* Manage the sales channels of a publishable API key.
*/
export const linkSalesChannelsToApiKeyWorkflow = createWorkflow(
linkSalesChannelsToApiKeyWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export const createReturnFulfillmentWorkflowId =
* }
* }
* })
*
* @summary
*
* Create a fulfillment for a return.
*/
export const createReturnFulfillmentWorkflow = createWorkflow(
createReturnFulfillmentWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export const removeItemClaimActionWorkflowId = "remove-item-claim-action"
* action_id: "orchact_123",
* }
* })
*
* @summary
*
* Remove order items from a claim.
*/
export const removeItemClaimActionWorkflow = createWorkflow(
removeItemClaimActionWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const createOrUpdateOrderPaymentCollectionWorkflowId =
* amount: 20
* }
* })
*
* @summary
*
* Create or update payment collection for an order.
*/
export const createOrUpdateOrderPaymentCollectionWorkflow = createWorkflow(
createOrUpdateOrderPaymentCollectionWorkflowId,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/core-flows/src/order/workflows/create-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ export const createOrderWorkflow = createWorkflow(
)

/**
* @deprecated
* Instead use the singular name "createOrderWorkflow"
* @deprecated Instead use the singular name `createOrderWorkflow`.
*/
export const createOrdersWorkflow = createOrderWorkflow
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export const cancelReturnWorkflowId = "cancel-return"
* return_id: "return_123",
* }
* })
*
* @summary
*
* Cancel a return.
*/
export const cancelReturnWorkflow = createWorkflow(
cancelReturnWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,25 @@ export type RefundPaymentsWorkflowInput = {

export const refundPaymentsWorkflowId = "refund-payments-workflow"
/**
* This workflow refunds a payment.
* This workflow refunds payments.
*
* You can use this workflow within your customizations or your own custom workflows, allowing you to
* refund payments in your custom flow.
*
* @example
* const { result } = await refundPaymentsWorkflow(container)
* .run({
* input: [
* {
* payment_id: "pay_123",
* amount: 10,
* }
* ]
* })
*
* @summary
*
* Refund one or more payments.
*/
export const refundPaymentsWorkflow = createWorkflow(
refundPaymentsWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export const deletePriceListsWorkflowId = "delete-price-lists"
* ids: ["plist_123"]
* }
* })
*
* @summary
*
* Delete one or more price lists.
*/
export const deletePriceListsWorkflow = createWorkflow(
deletePriceListsWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export const batchProductVariantsWorkflowId = "batch-product-variants"
* delete: ["variant_321"]
* }
* })
*
* @summary
*
* Create, update, and delete product variants.
*/
export const batchProductVariantsWorkflow = createWorkflow(
batchProductVariantsWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export const createPromotionRulesWorkflowId = "create-promotion-rules-workflow"
* }
* }
* })
*
* @summary
*
* Create one or more promotion rules.
*/
export const createPromotionRulesWorkflow = createWorkflow(
createPromotionRulesWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const createRegionsWorkflowId = "create-regions"
* ]
* }
* })
*
* @summary
*
* Create one or more regions.
*/
export const createRegionsWorkflow = createWorkflow(
createRegionsWorkflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,35 @@ import { WorkflowData, createWorkflow } from "@medusajs/framework/workflows-sdk"

import { deleteReservationsByLineItemsStep } from "../steps"

export type DeleteReservationByLineItemsWorkflowInput = { ids: string[] }
/**
* The data to delete reservations by their associated line items.
*/
export type DeleteReservationByLineItemsWorkflowInput = {
/**
* The IDs of the line items to delete reservations for.
*/
ids: string[]
}

export const deleteReservationsByLineItemsWorkflowId =
"delete-reservations-by-line-items"
/**
* This workflow deletes reservations by their associated line items.
*
* You can use this workflow within your own customizations or custom workflows, allowing you
* to delete reservations by their associated line items within your custom flows.
*
* @example
* const { result } = await deleteReservationsByLineItemsWorkflow(container)
* .run({
* input: {
* ids: ["orli_123"]
* }
* })
*
* @summary
*
* Delete reservations by their associated line items.
*/
export const deleteReservationsByLineItemsWorkflow = createWorkflow(
deleteReservationsByLineItemsWorkflowId,
Expand Down
4 changes: 4 additions & 0 deletions packages/core/core-flows/src/store/workflows/delete-stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const deleteStoresWorkflowId = "delete-stores"
* ids: ["store_123"]
* }
* })
*
* @summary
*
* Delete one or more stores.
*/
export const deleteStoresWorkflow = createWorkflow(
deleteStoresWorkflowId,
Expand Down

0 comments on commit e978795

Please sign in to comment.