docs: add documentation for Locking Module (#11824)

* add locking docs

* fix main navbar

* added implementation example links

* generate refs

* update architecture

* fix vale error
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-03-13 12:20:24 +02:00
1 parent 5cf0bf4d93
commit 28b0d08591
94 files changed
+15932 -10857

No files matched your search

@@ -9,23 +9,23 @@ sidebar_label: Create Tax Provider
import { TypeList } from "docs-ui"
# How to Create a Tax Provider
# How to Create a Tax Module Provider
In this document, you’ll learn how to create a tax provider to use with the Tax Module, and the methods to implement.
In this document, you’ll learn how to create a Tax Module Provider to use with the Tax Module, and the methods to implement.
---
## Overview
A tax provider is used to retrieve the tax lines in a provided context. The Tax Module provides a default `system` provider. You can create your own tax provider, either in a plugin, in a module provider, or directly in your Medusa application's codebase, then use it in any tax region.
A Tax Module Provider is used to retrieve the tax lines in a provided context. The Tax Module provides a default `system` provider. You can create your own Tax Module Provider, either in a plugin, in a module provider, or directly in your Medusa application's codebase, then use it in any tax region.
---
## Understanding Tax Provider Implementation
## Understanding Tax Module Provider Implementation
The Tax Module Provider handles calculating taxes with a third-party provirder. However, it's not responsible for managing tax concepts within Medusa, such as creating a tax region. The Tax Module uses your tax provider within core operations.
The Tax Module Provider handles calculating taxes with a third-party provirder. However, it's not responsible for managing tax concepts within Medusa, such as creating a tax region. The Tax Module uses your Tax Module Provider within core operations.
For example, during checkout, the tax provider of the tax region that the customer is in is used to calculate the tax for the cart and order. So, you only have to implement the third-party tax calculation logic in your tax provider.
For example, during checkout, the Tax Module Provider of the tax region that the customer is in is used to calculate the tax for the cart and order. So, you only have to implement the third-party tax calculation logic in your Tax Module Provider.
---
@@ -45,9 +45,9 @@ The rest of this guide always uses the `src/modules/my-tax` directory as an exam
---
## 2. Create the Tax Provider Service
## 2. Create the Tax Module Provider's Service
Create the file `src/modules/my-tax/service.ts` that holds the module's main service. It must extend the `ITaxProvider` class imported from `@medusajs/framework/types`:
Create the file `src/modules/my-tax/service.ts` that holds the module provider's main service. It must extend the `ITaxProvider` class imported from `@medusajs/framework/types`:
```ts title="src/modules/my-tax/service.ts"
import { ITaxProvider } from "@medusajs/framework/types"
@@ -156,7 +156,7 @@ export default class SystemTaxService implements ITaxProvider {
---
## 3. Create Module Definition File
## 3. Create Module Provider Definition File
Create the file `src/modules/my-tax/index.ts` with the following content:
@@ -172,11 +172,11 @@ export default ModuleProvider(Modules.TAX, {
})
```
This exports the module's definition, indicating that the `MyTaxProvider` is the module's service.
This exports the module provider's definition, indicating that the `MyTaxProvider` is the module provider's service.
---
## 4. Use Module
## 4. Use Module Provider
To use your Tax Module Provider, add it to the `providers` array of the Tax Module in `medusa-config.ts`: