chore: joiner config entity property (#9084)

This commit is contained in:
Carlos R. L. Rodrigues
2024-09-11 06:25:25 -03:00
committed by GitHub
parent 28dc8d4d17
commit fdd0543011
80 changed files with 464 additions and 294 deletions

View File

@@ -91,7 +91,7 @@ medusaIntegrationTestRunner({
expect(response.status).toEqual(200)
const [address] = await customerModuleService.listAddresses({
const [address] = await customerModuleService.listCustomerAddresses({
customer_id: customer.id,
is_default_shipping: true,
})
@@ -126,7 +126,7 @@ medusaIntegrationTestRunner({
expect(response.status).toEqual(200)
const [address] = await customerModuleService.listAddresses({
const [address] = await customerModuleService.listCustomerAddresses({
customer_id: customer.id,
is_default_billing: true,
})

View File

@@ -34,7 +34,7 @@ medusaIntegrationTestRunner({
last_name: "Doe",
})
const address = await customerModuleService.createAddresses({
const address = await customerModuleService.createCustomerAddresses({
customer_id: customer.id,
first_name: "John",
last_name: "Doe",

View File

@@ -34,7 +34,7 @@ medusaIntegrationTestRunner({
last_name: "Doe",
})
const address = await customerModuleService.createAddresses({
const address = await customerModuleService.createCustomerAddresses({
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
@@ -66,21 +66,23 @@ medusaIntegrationTestRunner({
first_name: "John",
last_name: "Doe",
})
const [, address] = await customerModuleService.createAddresses([
{
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
address_1: "Test street 1",
is_default_shipping: true,
},
{
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
address_1: "Test street 2",
},
])
const [, address] = await customerModuleService.createCustomerAddresses(
[
{
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
address_1: "Test street 1",
is_default_shipping: true,
},
{
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
address_1: "Test street 2",
},
]
)
const response = await api.post(
`/admin/customers/${customer.id}/addresses/${address.id}`,
@@ -93,10 +95,11 @@ medusaIntegrationTestRunner({
expect(response.status).toEqual(200)
const [defaultAddress] = await customerModuleService.listAddresses({
customer_id: customer.id,
is_default_shipping: true,
})
const [defaultAddress] =
await customerModuleService.listCustomerAddresses({
customer_id: customer.id,
is_default_shipping: true,
})
expect(defaultAddress.first_name).toEqual("jane")
expect(defaultAddress.address_1).toEqual("Test street 2")
@@ -108,21 +111,23 @@ medusaIntegrationTestRunner({
first_name: "John",
last_name: "Doe",
})
const [, address] = await customerModuleService.createAddresses([
{
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
address_1: "Test street 1",
is_default_billing: true,
},
{
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
address_1: "Test street 2",
},
])
const [, address] = await customerModuleService.createCustomerAddresses(
[
{
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
address_1: "Test street 1",
is_default_billing: true,
},
{
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
address_1: "Test street 2",
},
]
)
const response = await api.post(
`/admin/customers/${customer.id}/addresses/${address.id}`,
@@ -135,10 +140,11 @@ medusaIntegrationTestRunner({
expect(response.status).toEqual(200)
const [defaultAddress] = await customerModuleService.listAddresses({
customer_id: customer.id,
is_default_billing: true,
})
const [defaultAddress] =
await customerModuleService.listCustomerAddresses({
customer_id: customer.id,
is_default_billing: true,
})
expect(defaultAddress.first_name).toEqual("jane")
expect(defaultAddress.address_1).toEqual("Test street 2")

View File

@@ -26,7 +26,7 @@ medusaIntegrationTestRunner({
appContainer
)
const address = await customerModuleService.createAddresses({
const address = await customerModuleService.createCustomerAddresses({
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
@@ -57,7 +57,7 @@ medusaIntegrationTestRunner({
first_name: "Jane",
last_name: "Doe",
})
const address = await customerModuleService.createAddresses({
const address = await customerModuleService.createCustomerAddresses({
customer_id: otherCustomer.id,
first_name: "John",
last_name: "Doe",

View File

@@ -26,7 +26,7 @@ medusaIntegrationTestRunner({
appContainer
)
await customerModuleService.createAddresses([
await customerModuleService.createCustomerAddresses([
{
first_name: "Test",
last_name: "Test",

View File

@@ -26,7 +26,7 @@ medusaIntegrationTestRunner({
appContainer
)
const address = await customerModuleService.createAddresses({
const address = await customerModuleService.createCustomerAddresses({
customer_id: customer.id,
first_name: "John",
last_name: "Doe",
@@ -59,7 +59,7 @@ medusaIntegrationTestRunner({
last_name: "Doe",
})
const address = await customerModuleService.createAddresses({
const address = await customerModuleService.createCustomerAddresses({
customer_id: otherCustomer.id,
first_name: "John",
last_name: "Doe",

View File

@@ -2,8 +2,8 @@ import { medusaIntegrationTestRunner } from "medusa-test-utils"
import CurrencyModule from "@medusajs/currency"
import { MedusaModule } from "@medusajs/modules-sdk"
import RegionModule from "@medusajs/region"
import ProductModule from "@medusajs/product"
import RegionModule from "@medusajs/region"
import { defineLink } from "@medusajs/utils"
jest.setTimeout(50000)
@@ -43,6 +43,7 @@ medusaIntegrationTestRunner({
relationships: [
{
serviceName: "currency",
entity: "Currency",
primaryKey: "code",
foreignKey: "currency_code",
alias: "currency",
@@ -53,6 +54,7 @@ medusaIntegrationTestRunner({
},
{
serviceName: "region",
entity: "Region",
primaryKey: "id",
foreignKey: "region_id",
alias: "region",
@@ -69,6 +71,7 @@ medusaIntegrationTestRunner({
region: {
path: "region_link.region",
isList: false,
forwardArgumentsOnPath: ["region_link.region"],
},
},
relationship: {
@@ -85,6 +88,7 @@ medusaIntegrationTestRunner({
currency: {
path: "currency_link.currency",
isList: false,
forwardArgumentsOnPath: ["currency_link.currency"],
},
},
relationship: {
@@ -134,6 +138,7 @@ medusaIntegrationTestRunner({
relationships: [
{
serviceName: "productService",
entity: "ProductVariant",
primaryKey: "id",
foreignKey: "product_variant_id",
alias: "product_variant",
@@ -144,6 +149,7 @@ medusaIntegrationTestRunner({
},
{
serviceName: "region",
entity: "Region",
primaryKey: "id",
foreignKey: "region_id",
alias: "region",
@@ -160,6 +166,7 @@ medusaIntegrationTestRunner({
region: {
path: "region_link.region",
isList: false,
forwardArgumentsOnPath: ["region_link.region"],
},
},
relationship: {
@@ -176,6 +183,9 @@ medusaIntegrationTestRunner({
product_variant: {
path: "product_variant_link.product_variant",
isList: false,
forwardArgumentsOnPath: [
"product_variant_link.product_variant",
],
},
},
relationship: {
@@ -228,6 +238,7 @@ medusaIntegrationTestRunner({
relationships: [
{
serviceName: "currency",
entity: "Currency",
primaryKey: "code",
foreignKey: "currency_code",
alias: "currency",
@@ -238,6 +249,7 @@ medusaIntegrationTestRunner({
},
{
serviceName: "region",
entity: "Region",
primaryKey: "id",
foreignKey: "region_id",
alias: "region",
@@ -254,6 +266,7 @@ medusaIntegrationTestRunner({
region: {
path: "region_link.region",
isList: false,
forwardArgumentsOnPath: ["region_link.region"],
},
},
relationship: {
@@ -270,6 +283,7 @@ medusaIntegrationTestRunner({
currency: {
path: "currency_link.currency",
isList: false,
forwardArgumentsOnPath: ["currency_link.currency"],
},
},
relationship: {
@@ -318,6 +332,7 @@ medusaIntegrationTestRunner({
relationships: [
{
serviceName: "currency",
entity: "Currency",
primaryKey: "code",
foreignKey: "currency_code",
alias: "currency",
@@ -328,6 +343,7 @@ medusaIntegrationTestRunner({
},
{
serviceName: "region",
entity: "Region",
primaryKey: "id",
foreignKey: "region_id",
alias: "region",
@@ -344,6 +360,7 @@ medusaIntegrationTestRunner({
regions: {
path: "region_link.region",
isList: true,
forwardArgumentsOnPath: ["region_link.region"],
},
},
relationship: {
@@ -360,6 +377,7 @@ medusaIntegrationTestRunner({
currency: {
path: "currency_link.currency",
isList: false,
forwardArgumentsOnPath: ["currency_link.currency"],
},
},
relationship: {