docs: use tooling convention across docs (#10512)

This commit is contained in:
Shahed Nasser
2024-12-09 19:15:29 +02:00
committed by GitHub
parent 7c76ee24cb
commit 3409953c4f
76 changed files with 283 additions and 265 deletions
@@ -26,7 +26,7 @@ Modules are created in a sub-directory of `src/modules`. So, start by creating t
## 2. Create Data Model
A data model represents a table in the database. You create data models using Medusa's data modeling utility, which is built to improve readability and provide an intuitive developer experience.
A data model represents a table in the database. You create data models using Medusa's Data Model Language (DML). It simplifies defining a table's columns, relations, and indexes with straightforward methods and configurations.
<Note>
@@ -49,7 +49,7 @@ export const Brand = model.define("brand", {
You create a `Brand` data model which has an `id` primary key property, and a `name` text property.
You define the data model using the `define` method of the `model` utility imported from `@medusajs/framework/utils`. It accepts two parameters:
You define the data model using the `define` method of the DML. It accepts two parameters:
1. The first one is the name of the data model's table in the database. Use snake-case names.
2. The second is an object, which is the data model's schema.
@@ -95,7 +95,7 @@ class BrandModuleService extends MedusaService({
export default BrandModuleService
```
The `BrandModuleService` extends a class returned by the `MedusaService` function imported from `@medusajs/framework/utils`. This function generates a class with data-management methods for your module's data models.
The `BrandModuleService` extends a class returned by `MedusaService` from the Modules SDK. This function generates a class with data-management methods for your module's data models.
The `MedusaService` function receives an object of the module's data models as a parameter, and generates methods to manage those data models. So, the `BrandModuleService` now has methods like `createBrands` and `retrieveBrand` to manage the `Brand` data model.
@@ -128,7 +128,7 @@ export default Module(BRAND_MODULE, {
})
```
You use the `Module` function imported from `@medusajs/framework/utils` to create the module's definition. It accepts two parameters:
You use `Module` from the Modules SDK to create the module's definition. It accepts two parameters:
1. The module's name (`brand`). You'll use this name when you use this module in other customizations.
2. An object with a required property `service` indicating the module's main service.