chore: abstract the modules repository (#6035)

**What**
Reduce the work effort to create repositories when building new modules by abstracting the most common cases into the base class default implementation returned by a factory

- [x] Migrate all modules

Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com>
This commit is contained in:
Adrien de Peretti
2024-01-10 13:12:02 +00:00
committed by GitHub
co-authored by Riqwan Thamir
parent ef5024980d
commit b6ac768698
38 changed files with 411 additions and 2832 deletions
@@ -212,7 +212,7 @@ describe("PriceListRule Service", () => {
}
expect(error.message).toEqual(
'PriceListRule with id(s) "does-not-exist" not found'
'PriceListRule with id "does-not-exist" not found'
)
})
})
@@ -283,7 +283,7 @@ describe("PriceRule Service", () => {
error = e
}
expect(error.message).toEqual('PriceRule with id "undefined" not found')
expect(error.message).toEqual('PriceRule with id "" not found')
})
it("should create a priceRule successfully", async () => {
@@ -370,7 +370,7 @@ describe("PriceSet Service", () => {
error = e
}
expect(error.message).toEqual('PriceSet with id "undefined" not found')
expect(error.message).toEqual('PriceSet with id "" not found')
})
it("should create a priceSet successfully", async () => {
@@ -213,7 +213,7 @@ describe("PriceListRule Service", () => {
}
expect(error.message).toEqual(
'PriceListRule with id(s) "does-not-exist" not found'
'PriceListRule with id "does-not-exist" not found'
)
})
})
@@ -1,7 +1,7 @@
import { CreatePriceRuleDTO, IPricingModuleService } from "@medusajs/types"
import { SqlEntityManager } from "@mikro-orm/postgresql"
import { PriceSetMoneyAmount, initialize } from "../../../../src"
import { initialize, PriceSetMoneyAmount } from "../../../../src"
import { createCurrencies } from "../../../__fixtures__/currency"
import { createMoneyAmounts } from "../../../__fixtures__/money-amount"
import { createPriceRules } from "../../../__fixtures__/price-rule"
@@ -279,7 +279,7 @@ describe("PricingModule Service - PriceRule", () => {
error = e
}
expect(error.message).toEqual('PriceRule with id "undefined" not found')
expect(error.message).toEqual('PriceRule with id "" not found')
})
it("should create a PriceRule successfully", async () => {