feat: refactor module joiner config and links generation (#7859)

* feat: refactor module joiner config and links generation

* improve typings

* WIP

* WIP

* WIP

* rename type file

* create link config

* finish typings and add utils

* improve links

* WIP typings

* finalize ExportModule utils

* finalize ExportModule utils

* fix: dml tests

* improve and fixes

* simplify typings with id changes

* add toJSON

* multiple fixes and entity builder fixes

* fix currency searchable

* fix tests

* medusa service refactoring

* cleanup

* cleanup and fixes

* make module name optional

* renaming

---------

Co-authored-by: Harminder Virk <virk.officials@gmail.com>
This commit is contained in:
Adrien de PerettiandHarminder Virk authored and GitHub committed 2024-07-03 13:12:49 +02:00
1 parent 5aa62e59e4
commit 617a5972bf
89 files changed
+1706 -950

No files matched your search

@@ -51,7 +51,7 @@ import {
UpdateTypeInput,
} from "../types"
import { eventBuilders } from "../utils"
import { entityNameToLinkableKeysMap, joinerConfig } from "./../joiner-config"
import { joinerConfig } from "./../joiner-config"
type InjectedDependencies = {
baseRepository: DAL.RepositoryService
@@ -90,18 +90,15 @@ export default class ProductModuleService
ProductVariant: {
dto: ProductTypes.ProductVariantDTO
}
}>(
{
Product,
ProductCategory,
ProductCollection,
ProductOption,
ProductTag,
ProductType,
ProductVariant,
},
entityNameToLinkableKeysMap
)
}>({
Product,
ProductCategory,
ProductCollection,
ProductOption,
ProductTag,
ProductType,
ProductVariant,
})
implements ProductTypes.IProductModuleService
{
protected baseRepository_: DAL.RepositoryService
@@ -18,9 +18,10 @@ type NormalizedFilterableProductProps = ProductTypes.FilterableProductProps & {
}
}
export default class ProductService extends ModulesSdkUtils.MedusaInternalService<InjectedDependencies>(
export default class ProductService extends ModulesSdkUtils.MedusaInternalService<
InjectedDependencies,
Product
)<Product> {
>(Product) {
protected readonly productRepository_: DAL.RepositoryService<Product>
constructor({ productRepository }: InjectedDependencies) {