feat(medusa,event-bus-local,event-bus-redis): Event Bus modules (#2599)
This commit is contained in:
@@ -3,10 +3,9 @@ import {
|
||||
CreateInventoryItemInput,
|
||||
FilterableInventoryItemProps,
|
||||
FindConfig,
|
||||
IEventBusService,
|
||||
InventoryItemDTO,
|
||||
InventoryItemDTO
|
||||
} from "@medusajs/medusa"
|
||||
import { SharedContext } from "@medusajs/types"
|
||||
import { EventBusTypes, SharedContext } from "@medusajs/types"
|
||||
import { InjectEntityManager, MedusaContext } from "@medusajs/utils"
|
||||
import { isDefined, MedusaError } from "medusa-core-utils"
|
||||
import { DeepPartial, EntityManager, FindManyOptions } from "typeorm"
|
||||
@@ -14,7 +13,7 @@ import { InventoryItem } from "../models"
|
||||
import { getListQuery } from "../utils/query"
|
||||
|
||||
type InjectedDependencies = {
|
||||
eventBusService: IEventBusService
|
||||
eventBusService: EventBusTypes.IEventBusService
|
||||
manager: EntityManager
|
||||
}
|
||||
|
||||
@@ -26,7 +25,7 @@ export default class InventoryItemService {
|
||||
}
|
||||
|
||||
protected readonly manager_: EntityManager
|
||||
protected readonly eventBusService_: IEventBusService | undefined
|
||||
protected readonly eventBusService_: EventBusTypes.IEventBusService | undefined
|
||||
|
||||
constructor({ eventBusService, manager }: InjectedDependencies) {
|
||||
this.manager_ = manager
|
||||
|
||||
@@ -2,17 +2,16 @@ import {
|
||||
buildQuery,
|
||||
CreateInventoryLevelInput,
|
||||
FilterableInventoryLevelProps,
|
||||
FindConfig,
|
||||
IEventBusService,
|
||||
FindConfig
|
||||
} from "@medusajs/medusa"
|
||||
import { SharedContext } from "@medusajs/types"
|
||||
import { EventBusTypes, SharedContext } from "@medusajs/types"
|
||||
import { InjectEntityManager, MedusaContext } from "@medusajs/utils"
|
||||
import { isDefined, MedusaError } from "medusa-core-utils"
|
||||
import { DeepPartial, EntityManager, FindManyOptions, In } from "typeorm"
|
||||
import { InventoryLevel } from "../models"
|
||||
|
||||
type InjectedDependencies = {
|
||||
eventBusService: IEventBusService
|
||||
eventBusService: EventBusTypes.IEventBusService
|
||||
manager: EntityManager
|
||||
}
|
||||
|
||||
@@ -24,7 +23,7 @@ export default class InventoryLevelService {
|
||||
}
|
||||
|
||||
protected readonly manager_: EntityManager
|
||||
protected readonly eventBusService_: IEventBusService | undefined
|
||||
protected readonly eventBusService_: EventBusTypes.IEventBusService | undefined
|
||||
|
||||
constructor({ eventBusService, manager }: InjectedDependencies) {
|
||||
this.manager_ = manager
|
||||
|
||||
@@ -8,34 +8,33 @@ import {
|
||||
FilterableInventoryLevelProps,
|
||||
FilterableReservationItemProps,
|
||||
FindConfig,
|
||||
IEventBusService,
|
||||
IInventoryService,
|
||||
InventoryItemDTO,
|
||||
InventoryLevelDTO,
|
||||
ReservationItemDTO,
|
||||
UpdateInventoryLevelInput,
|
||||
UpdateReservationItemInput,
|
||||
UpdateReservationItemInput
|
||||
} from "@medusajs/medusa"
|
||||
import { SharedContext } from "@medusajs/types"
|
||||
import { EventBusTypes, SharedContext } from "@medusajs/types"
|
||||
import { InjectEntityManager, MedusaContext } from "@medusajs/utils"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
import { EntityManager } from "typeorm"
|
||||
import {
|
||||
InventoryItemService,
|
||||
InventoryLevelService,
|
||||
ReservationItemService,
|
||||
ReservationItemService
|
||||
} from "./"
|
||||
|
||||
type InjectedDependencies = {
|
||||
manager: EntityManager
|
||||
eventBusService: IEventBusService
|
||||
eventBusService: EventBusTypes.IEventBusService
|
||||
inventoryItemService: InventoryItemService
|
||||
inventoryLevelService: InventoryLevelService
|
||||
reservationItemService: ReservationItemService
|
||||
}
|
||||
export default class InventoryService implements IInventoryService {
|
||||
protected readonly manager_: EntityManager
|
||||
protected readonly eventBusService_: IEventBusService | undefined
|
||||
protected readonly eventBusService_: EventBusTypes.IEventBusService | undefined
|
||||
protected readonly inventoryItemService_: InventoryItemService
|
||||
protected readonly reservationItemService_: ReservationItemService
|
||||
protected readonly inventoryLevelService_: InventoryLevelService
|
||||
|
||||
@@ -2,11 +2,9 @@ import {
|
||||
buildQuery,
|
||||
CreateReservationItemInput,
|
||||
FilterableReservationItemProps,
|
||||
FindConfig,
|
||||
IEventBusService,
|
||||
UpdateReservationItemInput,
|
||||
FindConfig, UpdateReservationItemInput
|
||||
} from "@medusajs/medusa"
|
||||
import { SharedContext } from "@medusajs/types"
|
||||
import { EventBusTypes, SharedContext } from "@medusajs/types"
|
||||
import { InjectEntityManager, MedusaContext } from "@medusajs/utils"
|
||||
import { isDefined, MedusaError } from "medusa-core-utils"
|
||||
import { EntityManager, FindManyOptions } from "typeorm"
|
||||
@@ -14,7 +12,7 @@ import { InventoryLevelService } from "."
|
||||
import { ReservationItem } from "../models"
|
||||
|
||||
type InjectedDependencies = {
|
||||
eventBusService: IEventBusService
|
||||
eventBusService: EventBusTypes.IEventBusService
|
||||
manager: EntityManager
|
||||
inventoryLevelService: InventoryLevelService
|
||||
}
|
||||
@@ -27,7 +25,7 @@ export default class ReservationItemService {
|
||||
}
|
||||
|
||||
protected readonly manager_: EntityManager
|
||||
protected readonly eventBusService_: IEventBusService | undefined
|
||||
protected readonly eventBusService_: EventBusTypes.IEventBusService | undefined
|
||||
protected readonly inventoryLevelService_: InventoryLevelService
|
||||
|
||||
constructor({
|
||||
|
||||
Reference in New Issue
Block a user