Added shipping method data to tax module context (#13747)
This commit is contained in:
6
.changeset/late-seals-mix.md
Normal file
6
.changeset/late-seals-mix.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/core-flows": patch
|
||||
"@medusajs/types": patch
|
||||
---
|
||||
|
||||
Added shipping method data to tax module context
|
||||
@@ -91,6 +91,12 @@ function normalizeTaxModuleContext(
|
||||
},
|
||||
customer,
|
||||
is_return: isReturn ?? false,
|
||||
shipping_methods: orderOrCart.shipping_methods?.map((method) => ({
|
||||
id: method.id,
|
||||
name: method.name,
|
||||
shipping_option_id: method.shipping_option_id,
|
||||
amount: method.amount,
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -490,6 +490,31 @@ export interface TaxCalculationContext {
|
||||
* Whether the tax lines are calculated for an order return.
|
||||
*/
|
||||
is_return?: boolean
|
||||
|
||||
/**
|
||||
* The shipping method details.
|
||||
*/
|
||||
shipping_methods?: {
|
||||
/**
|
||||
* The associated shipping method's ID.
|
||||
*/
|
||||
id: string
|
||||
|
||||
/**
|
||||
* The name of the shipping method.
|
||||
*/
|
||||
name: string
|
||||
|
||||
/**
|
||||
* The associated shipping options's ID.
|
||||
*/
|
||||
shipping_option_id: string
|
||||
|
||||
/**
|
||||
* The amount of the shipping method.
|
||||
*/
|
||||
amount: number
|
||||
}[]
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user