Skip to content

Commit 097d460

Browse files
docs: add TSDocs for f2c9d7d (#16299)
Co-authored-by: kodiakhq[bot] <kodiakhq[bot]@users.noreply.github.com>
1 parent 68a414a commit 097d460

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

packages/core/core-flows/src/cart/utils/prepare-confirm-inventory-input.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import {
99
deepFlatMap,
1010
} from "@medusajs/framework/utils"
1111

12+
/**
13+
* The order fields required to confirm inventory availability.
14+
* Use these fields when querying an order to pass to
15+
* `prepareConfirmInventoryInput`.
16+
*/
1217
export const requiredOrderFieldsForInventoryConfirmation = [
1318
"id",
1419
"version",
@@ -30,6 +35,11 @@ export const requiredOrderFieldsForInventoryConfirmation = [
3035
"items.variant.inventory_items.inventory.location_levels.stock_locations.sales_channels.name",
3136
]
3237

38+
/**
39+
* The variant fields required to confirm inventory availability.
40+
* Use these fields when querying a variant to pass to
41+
* `prepareConfirmInventoryInput`.
42+
*/
3343
export const requiredVariantFieldsForInventoryConfirmation = [
3444
"manage_inventory",
3545
"allow_backorder",

packages/core/types/src/cart/workflows.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,24 +405,70 @@ export interface CartWorkflowDTO extends CartDTO {
405405
region?: RegionDTO
406406
}
407407

408+
/**
409+
* The details required to list shipping options for a cart.
410+
*/
408411
export interface ListShippingOptionsForCartWorkflowInputDTO {
412+
/**
413+
* The ID of the cart to list shipping options for.
414+
*/
409415
cart_id: string
416+
/**
417+
* Whether to list shipping options for a return shipment.
418+
*/
410419
is_return: boolean
420+
/**
421+
* The ID of the sales channel to filter shipping options by.
422+
*/
411423
sales_channel_id?: string
424+
/**
425+
* The ID of the region to filter shipping options by.
426+
*/
412427
region_id?: string
428+
/**
429+
* The currency code of the cart.
430+
*
431+
* @example usd
432+
*/
413433
currency_code: string
434+
/**
435+
* The shipping address to filter shipping options by.
436+
*/
414437
shipping_address: {
438+
/**
439+
* The city of the shipping address.
440+
*/
415441
city?: string
442+
/**
443+
* The country code of the shipping address.
444+
*
445+
* @example us
446+
*/
416447
country_code?: string
448+
/**
449+
* The lower-case [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) province or state of the shipping address.
450+
*/
417451
province?: string
418452
}
419453
}
420454

455+
/**
456+
* A shipping option with a resolved price.
457+
*/
421458
export interface PricedShippingOptionDTO extends ShippingOptionDTO {
459+
/**
460+
* The calculated price of the shipping option.
461+
*/
422462
amount: BigNumberInput
423463
}
424464

465+
/**
466+
* The details required to complete a cart.
467+
*/
425468
export interface CompleteCartWorkflowInputDTO {
469+
/**
470+
* The ID of the cart to complete.
471+
*/
426472
id: string
427473
}
428474

@@ -548,6 +594,9 @@ export interface ConfirmVariantInventoryWorkflowInputDTO {
548594
}[]
549595
}
550596

597+
/**
598+
* A cart with its payment collection details.
599+
*/
551600
export interface CartWorkflowDTO {
552601
id: string
553602
payment_collection: PaymentCollectionDTO

0 commit comments

Comments
 (0)