docs: updates to use DML and other changes (#7834)

- Change existing data model guides and add new ones for DML
- Change module's docs around service factory + remove guides that are now necessary
- Hide/remove all mentions of module relationships, or label them as coming soon.
- Change all data model creation snippets to use DML
- use `property` instead of `field` when referring to a data model's properties.
- Fix all snippets in commerce module guides to use new method suffix (no more main model methods)
- Rework recipes, removing/hiding a lot of sections as a lot of recipes are incomplete with the current state of DML.


### Other changes

- Highlight fixes in some guides
- Remove feature flags guide
- Fix code block styles when there are no line numbers.

### Upcoming changes in other PRs

- Re-generate commerce module references (for the updates in the method names)
- Ensure that the data model references are generated correctly for models using DML.
- (probably at a very later point) revisit recipes
This commit is contained in:
Shahed Nasser
2024-06-26 07:55:59 +00:00
committed by GitHub
parent 62dacdda75
commit 0462cc5acf
126 changed files with 1808 additions and 14242 deletions
@@ -25,7 +25,7 @@ In this guide, youll find common examples of how you can use the Region Modul
const regionModuleService: IRegionModuleService =
req.scope.resolve(ModuleRegistrationName.REGION)
const region = await regionModuleService.create({
const region = await regionModuleService.createRegions({
name: "Europe",
currency_code: "eur",
})
@@ -49,7 +49,7 @@ In this guide, youll find common examples of how you can use the Region Modul
export async function POST(request: Request) {
const regionModuleService = await initializeRegionModule()
const region = await regionModuleService.create({
const region = await regionModuleService.createRegions({
name: "Europe",
currency_code: "eur",
})
@@ -83,7 +83,7 @@ In this guide, youll find common examples of how you can use the Region Modul
req.scope.resolve(ModuleRegistrationName.REGION)
res.json({
regions: await regionModuleService.list(),
regions: await regionModuleService.listRegions(),
})
}
```
@@ -102,7 +102,7 @@ In this guide, youll find common examples of how you can use the Region Modul
const regionModuleService = await initializeRegionModule()
return NextResponse.json({
regions: await regionModuleService.list(),
regions: await regionModuleService.listRegions(),
})
}
```
@@ -129,7 +129,8 @@ In this guide, youll find common examples of how you can use the Region Modul
const regionModuleService: IRegionModuleService =
req.scope.resolve(ModuleRegistrationName.REGION)
const region = await regionModuleService.retrieve("reg_123")
const region = await regionModuleService
.retrieveRegion("reg_123")
res.json({ region })
}
@@ -150,7 +151,8 @@ In this guide, youll find common examples of how you can use the Region Modul
) {
const regionModuleService = await initializeRegionModule()
const region = await regionModuleService.retrieve("reg_123")
const region = await regionModuleService
.retrieveRegion("reg_123")
return NextResponse.json({ region })
}
@@ -178,9 +180,10 @@ In this guide, youll find common examples of how you can use the Region Modul
const regionModuleService: IRegionModuleService =
req.scope.resolve(ModuleRegistrationName.REGION)
const region = await regionModuleService.update("reg_123", {
automatic_taxes: false,
})
const region = await regionModuleService
.updateRegions("reg_123", {
automatic_taxes: false,
})
res.json({ region })
}
@@ -201,9 +204,10 @@ In this guide, youll find common examples of how you can use the Region Modul
) {
const regionModuleService = await initializeRegionModule()
const region = await regionModuleService.update("reg_123", {
automatic_taxes: false,
})
const region = await regionModuleService
.updateRegions("reg_123", {
automatic_taxes: false,
})
return NextResponse.json({ region })
}
@@ -231,7 +235,7 @@ In this guide, youll find common examples of how you can use the Region Modul
const regionModuleService: IRegionModuleService =
req.scope.resolve(ModuleRegistrationName.REGION)
await regionModuleService.delete("reg_123")
await regionModuleService.deleteRegions("reg_123")
res.status(200)
}
@@ -252,7 +256,7 @@ In this guide, youll find common examples of how you can use the Region Modul
) {
const regionModuleService = await initializeRegionModule()
await regionModuleService.delete("reg_123")
await regionModuleService.deleteRegions("reg_123")
}
```