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
@@ -29,7 +29,7 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
it("should create a customer address", async () => {
|
||||
// Create a customer
|
||||
const customer = await customerModuleService.create({
|
||||
const customer = await customerModuleService.createCustomers({
|
||||
first_name: "John",
|
||||
last_name: "Doe",
|
||||
})
|
||||
@@ -56,16 +56,16 @@ medusaIntegrationTestRunner({
|
||||
])
|
||||
)
|
||||
|
||||
const customerWithAddresses = await customerModuleService.retrieve(
|
||||
customer.id,
|
||||
{ relations: ["addresses"] }
|
||||
)
|
||||
const customerWithAddresses =
|
||||
await customerModuleService.retrieveCustomer(customer.id, {
|
||||
relations: ["addresses"],
|
||||
})
|
||||
|
||||
expect(customerWithAddresses.addresses?.length).toEqual(1)
|
||||
})
|
||||
|
||||
it("sets new shipping address as default and unsets the old one", async () => {
|
||||
const customer = await customerModuleService.create({
|
||||
const customer = await customerModuleService.createCustomers({
|
||||
first_name: "John",
|
||||
last_name: "Doe",
|
||||
addresses: [
|
||||
@@ -100,7 +100,7 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
|
||||
it("sets new billing address as default and unsets the old one", async () => {
|
||||
const customer = await customerModuleService.create({
|
||||
const customer = await customerModuleService.createCustomers({
|
||||
first_name: "John",
|
||||
last_name: "Doe",
|
||||
addresses: [
|
||||
|
||||
Reference in New Issue
Block a user