docs: improvements to tax related docs (#13845)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-10-24 09:44:47 +03:00
1 parent 226984cf0f
commit 8d574d6f29
4 files changed
+64 -19

No files matched your search

+7 -5
View File
@@ -12171,7 +12171,7 @@ Some examples of service events:
## Emit Event in a Workflow
To emit a workflow event, use the `emitEventStep` helper step provided in the `@medusajs/medusa/core-flows` package.
To emit a workflow event, use the `emitEventStep` helper step provided in the `@medusajs/medusa/core-flows` package. It allows you to emit an event from within a workflow, and it only emits the event after the workflow has finished successfully.
For example:
@@ -40057,10 +40057,12 @@ Refer to this [Medusa Admin User Guide](https://docs.medusajs.com/user-guide/set
## What are Tax Rates?
A tax rate is a percentage amount used to calculate the tax amount for each taxable item’s price, such as line items or shipping methods, in a cart. The sum of all calculated tax amounts are then added to the cart’s total as a tax total.
A tax rate, represented by the [TaxRate data model](https://docs.medusajs.com/references/tax/models/TaxRate/index.html.md), is a percentage amount used to calculate the tax amount for each taxable item’s price, such as line items or shipping methods, in a cart. The sum of all calculated tax amounts are then added to the cart’s total as a tax total.
Each tax region has a default tax rate. This tax rate is applied to all taxable items of a cart in that region.
The `TaxRate` data model has a `rate` property that represents the percentage amount. For example, a `rate` of `10` means a tax rate of 10%.
### Combinable Tax Rates
Tax regions can have parent tax regions. To inherit the tax rates of the parent tax region, set the `is_combinable` of the child’s tax rates to `true`.
@@ -83007,7 +83009,7 @@ A module is created under the `src/modules` directory of your Medusa application
### c. Define Module Options
Next, define a TypeScript type for the Avalara module options. These options configure the module when it's registered in the Medusa application.
Next, define a TypeScript type for the Avalara Module options. These options configure the module when it's registered in the Medusa application.
Create the file `src/modules/avalara/types.ts` with the following content:
@@ -83094,7 +83096,7 @@ The constructor of a module's service receives the following parameters:
1. An object with the dependencies to resolve from the [Module's container](https://docs.medusajs.com/docs/learn/fundamentals/modules/container/index.html.md).
2. An object with the module options passed to the provider when it's registered.
In the constructor, you validate that the required module options are provided. Then, you create an instance of the `Avatax` client using the provided options.
In the constructor, you validate that the required options are provided. Then, you create an instance of the `Avatax` client using the provided options.
You also define the `getIdentifier` method required by the `ITaxProvider` interface, which returns the provider's identifier.
@@ -84138,7 +84140,7 @@ In the compensation function, you revert the updates by restoring the original v
You can now create the workflow. Create the file `src/workflows/update-product-item.ts` with the following content:
```ts title="src/workflows/update-variant-item.ts" highlights={updateVariantItemWorkflowHighlights}
```ts title="src/workflows/update-variant-item.ts" highlights={updateProductItemWorkflowHighlights}
import { createWorkflow, WorkflowResponse, transform, when } from "@medusajs/framework/workflows-sdk"
import { useQueryGraphStep } from "@medusajs/medusa/core-flows"
import { updateItemStep } from "./steps/update-item"