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:
Adrien de Peretti
2024-06-19 15:02:16 +02:00
committed by GitHub
parent 2895ccfba8
commit 48963f55ef
533 changed files with 6469 additions and 9769 deletions

View File

@@ -12,6 +12,9 @@ export const CartCustomer: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "customer_id",
alias: "customer",
args: {
methodSuffix: "Customers",
},
},
},
{
@@ -21,6 +24,9 @@ export const CartCustomer: ModuleJoinerConfig = {
primaryKey: "customer_id",
foreignKey: "id",
alias: "carts",
args: {
methodSuffix: "Carts",
},
isList: true,
},
},

View File

@@ -12,6 +12,9 @@ export const CartProduct: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "items.product_id",
alias: "product",
args: {
methodSuffix: "Products",
},
},
},
{
@@ -22,7 +25,7 @@ export const CartProduct: ModuleJoinerConfig = {
foreignKey: "items.variant_id",
alias: "variant",
args: {
methodSuffix: "Variants",
methodSuffix: "ProductVariants",
},
},
},

View File

@@ -12,6 +12,9 @@ export const CartRegion: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "region_id",
alias: "region",
args: {
methodSuffix: "Regions",
},
},
},
{
@@ -21,6 +24,9 @@ export const CartRegion: ModuleJoinerConfig = {
primaryKey: "region_id",
foreignKey: "id",
alias: "carts",
args: {
methodSuffix: "Carts",
},
isList: true,
},
},

View File

@@ -12,6 +12,9 @@ export const CartSalesChannel: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "sales_channel_id",
alias: "sales_channel",
args: {
methodSuffix: "SalesChannels",
},
},
},
{
@@ -21,6 +24,9 @@ export const CartSalesChannel: ModuleJoinerConfig = {
primaryKey: "sales_channel_id",
foreignKey: "id",
alias: "carts",
args: {
methodSuffix: "Carts",
},
isList: true,
},
},

View File

@@ -12,6 +12,9 @@ export const InventoryLevelStockLocation: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "location_id",
alias: "stock_locations",
args: {
methodSuffix: "StockLocations",
},
isList: true,
},
},

View File

@@ -12,6 +12,9 @@ export const LineItemAdjustmentPromotion: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "promotion_id",
alias: "promotion",
args: {
methodSuffix: "Promotions",
},
},
},
],

View File

@@ -12,6 +12,9 @@ export const OrderCustomer: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "customer_id",
alias: "customer",
args: {
methodSuffix: "Customers",
},
},
},
{
@@ -21,6 +24,9 @@ export const OrderCustomer: ModuleJoinerConfig = {
primaryKey: "customer_id",
foreignKey: "id",
alias: "orders",
args: {
methodSuffix: "Orders",
},
isList: true,
},
},

View File

@@ -12,6 +12,9 @@ export const OrderProduct: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "items.product_id",
alias: "product",
args: {
methodSuffix: "Products",
},
},
},
{
@@ -22,7 +25,7 @@ export const OrderProduct: ModuleJoinerConfig = {
foreignKey: "items.variant_id",
alias: "variant",
args: {
methodSuffix: "Variants",
methodSuffix: "ProductVariants",
},
},
},

View File

@@ -12,6 +12,9 @@ export const OrderRegion: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "region_id",
alias: "region",
args: {
methodSuffix: "Regions",
},
},
},
{
@@ -21,6 +24,9 @@ export const OrderRegion: ModuleJoinerConfig = {
primaryKey: "region_id",
foreignKey: "id",
alias: "orders",
args: {
methodSuffix: "Orders",
},
isList: true,
},
},

View File

@@ -13,6 +13,9 @@ export const OrderSalesChannel: ModuleJoinerConfig = {
primaryKey: "id",
foreignKey: "sales_channel_id",
alias: "sales_channel",
args: {
methodSuffix: "SalesChannels",
},
},
},
{
@@ -22,6 +25,9 @@ export const OrderSalesChannel: ModuleJoinerConfig = {
primaryKey: "sales_channel_id",
foreignKey: "id",
alias: "orders",
args: {
methodSuffix: "Orders",
},
isList: true,
},
},

View File

@@ -12,6 +12,9 @@ export const StoreDefaultCurrency: ModuleJoinerConfig = {
primaryKey: "code",
foreignKey: "default_currency_code",
alias: "default_currency",
args: {
methodSuffix: "Currencies",
},
},
},
],