Chore(medusa,utils,types,inventory,stock-location): remove core dependency modules (#3531)

This commit is contained in:
Carlos R. L. Rodrigues
2023-03-23 08:07:32 -03:00
committed by GitHub
parent bfef22b33e
commit 4e9d257d3b
159 changed files with 1769 additions and 693 deletions
@@ -1,16 +1,15 @@
import { IStockLocationService } from "@medusajs/medusa"
import {
ExternalModuleDeclaration,
InternalModuleDeclaration,
MedusaModule
MedusaModule,
} from "@medusajs/modules-sdk"
import { EventBusTypes } from "@medusajs/types"
import { IEventBusService, IStockLocationService } from "@medusajs/types"
import { StockLocationServiceInitializeOptions } from "../types"
export const initialize = async (
options?: StockLocationServiceInitializeOptions | ExternalModuleDeclaration,
injectedDependencies?: {
eventBusService: EventBusTypes.IEventBusService
eventBusService: IEventBusService
}
): Promise<IStockLocationService> => {
const serviceKey = "stockLocationService"
@@ -2,10 +2,10 @@ import {
InternalModuleDeclaration,
LoaderOptions,
MODULE_RESOURCE_TYPE,
MODULE_SCOPE
MODULE_SCOPE,
} from "@medusajs/modules-sdk"
import { MedusaError } from "@medusajs/utils"
import { asValue } from "awilix"
import { MedusaError } from "medusa-core-utils"
import { DataSource, DataSourceOptions } from "typeorm"
import * as StockLocationModels from "../models"
import { StockLocationServiceInitializeOptions } from "../types"
@@ -1,5 +1,5 @@
import { generateEntityId, SoftDeletableEntity } from "@medusajs/utils"
import { BeforeInsert, Column, Entity, Index } from "typeorm"
import { SoftDeletableEntity, generateEntityId } from "@medusajs/medusa"
@Entity()
export class StockLocationAddress extends SoftDeletableEntity {
@@ -1,3 +1,4 @@
import { generateEntityId, SoftDeletableEntity } from "@medusajs/utils"
import {
BeforeInsert,
Column,
@@ -6,9 +7,7 @@ import {
JoinColumn,
ManyToOne,
} from "typeorm"
import { SoftDeletableEntity, generateEntityId } from "@medusajs/medusa"
import { StockLocationAddress } from "."
import { StockLocationAddress } from "./stock-location-address"
@Entity()
export class StockLocation extends SoftDeletableEntity {
@@ -1,22 +1,27 @@
import { InternalModuleDeclaration } from "@medusajs/modules-sdk"
import {
buildQuery,
CreateStockLocationInput,
FilterableStockLocationProps,
FindConfig,
setMetadata,
IEventBusService,
SharedContext,
StockLocationAddressInput,
UpdateStockLocationInput
} from "@medusajs/medusa"
import { InternalModuleDeclaration } from "@medusajs/modules-sdk"
import { EventBusTypes, SharedContext } from "@medusajs/types"
import { InjectEntityManager, MedusaContext } from "@medusajs/utils"
import { isDefined, MedusaError } from "medusa-core-utils"
UpdateStockLocationInput,
} from "@medusajs/types"
import {
buildQuery,
InjectEntityManager,
isDefined,
MedusaContext,
MedusaError,
setMetadata,
} from "@medusajs/utils"
import { EntityManager } from "typeorm"
import { StockLocation, StockLocationAddress } from "../models"
type InjectedDependencies = {
manager: EntityManager
eventBusService: EventBusTypes.IEventBusService
eventBusService: IEventBusService
}
/**
@@ -31,7 +36,7 @@ export default class StockLocationService {
}
protected readonly manager_: EntityManager
protected readonly eventBusService_: EventBusTypes.IEventBusService
protected readonly eventBusService_: IEventBusService
constructor(
{ eventBusService, manager }: InjectedDependencies,