feat: Plug tax inclusivity in cart and order workflows (#8013)
This commit is contained in:
@@ -132,6 +132,16 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
])
|
||||
|
||||
await api.post(
|
||||
"/admin/price-preferences",
|
||||
{
|
||||
attribute: "currency_code",
|
||||
value: "usd",
|
||||
is_tax_inclusive: true,
|
||||
},
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
await remoteLink.create([
|
||||
{
|
||||
[Modules.PRODUCT]: {
|
||||
@@ -252,7 +262,7 @@ medusaIntegrationTestRunner({
|
||||
variant_option_values: null,
|
||||
requires_shipping: true,
|
||||
is_discountable: true,
|
||||
is_tax_inclusive: false,
|
||||
is_tax_inclusive: true,
|
||||
raw_compare_at_unit_price: null,
|
||||
raw_unit_price: expect.objectContaining({
|
||||
value: "3000",
|
||||
@@ -306,6 +316,7 @@ medusaIntegrationTestRunner({
|
||||
note: "reduced price",
|
||||
},
|
||||
unit_price: 200,
|
||||
is_tax_inclusive: true,
|
||||
quantity: 1,
|
||||
raw_quantity: expect.objectContaining({
|
||||
value: "1",
|
||||
|
||||
@@ -40,6 +40,7 @@ async function prepareDataFixtures({ container }) {
|
||||
ModuleRegistrationName.STOCK_LOCATION
|
||||
)
|
||||
const productModule = container.resolve(ModuleRegistrationName.PRODUCT)
|
||||
const pricingModule = container.resolve(ModuleRegistrationName.PRICING)
|
||||
const inventoryModule = container.resolve(ModuleRegistrationName.INVENTORY)
|
||||
|
||||
const shippingProfile = await fulfillmentService.createShippingProfiles({
|
||||
@@ -145,6 +146,19 @@ async function prepareDataFixtures({ container }) {
|
||||
},
|
||||
])
|
||||
|
||||
await pricingModule.createPricePreferences([
|
||||
{
|
||||
attribute: "currency_code",
|
||||
value: "usd",
|
||||
is_tax_inclusive: true,
|
||||
},
|
||||
{
|
||||
attribute: "region_id",
|
||||
value: region.id,
|
||||
is_tax_inclusive: true,
|
||||
},
|
||||
])
|
||||
|
||||
const shippingOptionData: FulfillmentWorkflow.CreateShippingOptionsWorkflowInput =
|
||||
{
|
||||
name: "Return shipping option",
|
||||
@@ -471,7 +485,7 @@ medusaIntegrationTestRunner({
|
||||
id: expect.any(String),
|
||||
name: shippingOption.name,
|
||||
description: null,
|
||||
is_tax_inclusive: false,
|
||||
is_tax_inclusive: true,
|
||||
shipping_option_id: shippingOption.id,
|
||||
amount: 10,
|
||||
order_id: expect.any(String),
|
||||
|
||||
Reference in New Issue
Block a user