Chore/rm main entity concept (#7709)
**What** Update the `MedusaService` class, factory and types to remove the concept of main modules. The idea being that all method will be explicitly named and suffixes to represent the object you are trying to manipulate. This pr also includes various fixes in different modules Co-authored-by: Stevche Radevski <4820812+sradevski@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
co-authored by
Stevche Radevski
Oli Juhl
parent
2895ccfba8
commit
48963f55ef
@@ -87,9 +87,12 @@ medusaIntegrationTestRunner({
|
||||
deleted: true,
|
||||
})
|
||||
|
||||
const deletedRegion = await service.retrieve(updated.data.region.id, {
|
||||
withDeleted: true,
|
||||
})
|
||||
const deletedRegion = await service.retrieveRegion(
|
||||
updated.data.region.id,
|
||||
{
|
||||
withDeleted: true,
|
||||
}
|
||||
)
|
||||
|
||||
// @ts-ignore
|
||||
expect(deletedRegion.deleted_at).toBeTruthy()
|
||||
@@ -294,7 +297,7 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
|
||||
it("should throw on unknown properties in update", async () => {
|
||||
const created = await service.create({
|
||||
const created = await service.createRegions({
|
||||
name: "Test Region",
|
||||
currency_code: "usd",
|
||||
})
|
||||
@@ -318,7 +321,7 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
|
||||
it("should get all regions and count", async () => {
|
||||
await service.create([
|
||||
await service.createRegions([
|
||||
{
|
||||
name: "Test",
|
||||
currency_code: "usd",
|
||||
@@ -344,7 +347,7 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
|
||||
it("should support searching of regions", async () => {
|
||||
await service.create([
|
||||
await service.createRegions([
|
||||
{
|
||||
name: "APAC",
|
||||
currency_code: "usd",
|
||||
@@ -369,7 +372,7 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
|
||||
it("should get a region", async () => {
|
||||
const [region] = await service.create([
|
||||
const [region] = await service.createRegions([
|
||||
{
|
||||
name: "Test",
|
||||
currency_code: "usd",
|
||||
|
||||
Reference in New Issue
Block a user