fix(medusa): Fix hanging inventory item migration script (#3624)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { FindConfig } from "../common"
|
||||
|
||||
import {
|
||||
CreateInventoryItemInput,
|
||||
CreateInventoryLevelInput,
|
||||
@@ -14,101 +12,139 @@ import {
|
||||
UpdateReservationItemInput,
|
||||
} from "./common"
|
||||
|
||||
import { FindConfig } from "../common"
|
||||
import { SharedContext } from ".."
|
||||
|
||||
export interface IInventoryService {
|
||||
listInventoryItems(
|
||||
selector: FilterableInventoryItemProps,
|
||||
config?: FindConfig<InventoryItemDTO>
|
||||
config?: FindConfig<InventoryItemDTO>,
|
||||
context?: SharedContext
|
||||
): Promise<[InventoryItemDTO[], number]>
|
||||
|
||||
listReservationItems(
|
||||
selector: FilterableReservationItemProps,
|
||||
config?: FindConfig<ReservationItemDTO>
|
||||
config?: FindConfig<ReservationItemDTO>,
|
||||
context?: SharedContext
|
||||
): Promise<[ReservationItemDTO[], number]>
|
||||
|
||||
listInventoryLevels(
|
||||
selector: FilterableInventoryLevelProps,
|
||||
config?: FindConfig<InventoryLevelDTO>
|
||||
config?: FindConfig<InventoryLevelDTO>,
|
||||
context?: SharedContext
|
||||
): Promise<[InventoryLevelDTO[], number]>
|
||||
|
||||
retrieveInventoryItem(
|
||||
inventoryItemId: string,
|
||||
config?: FindConfig<InventoryItemDTO>
|
||||
config?: FindConfig<InventoryItemDTO>,
|
||||
context?: SharedContext
|
||||
): Promise<InventoryItemDTO>
|
||||
|
||||
retrieveInventoryLevel(
|
||||
inventoryItemId: string,
|
||||
locationId: string
|
||||
locationId: string,
|
||||
context?: SharedContext
|
||||
): Promise<InventoryLevelDTO>
|
||||
|
||||
retrieveReservationItem(reservationId: string): Promise<ReservationItemDTO>
|
||||
retrieveReservationItem(
|
||||
reservationId: string,
|
||||
context?: SharedContext
|
||||
): Promise<ReservationItemDTO>
|
||||
|
||||
createReservationItem(
|
||||
input: CreateReservationItemInput
|
||||
input: CreateReservationItemInput,
|
||||
context?: SharedContext
|
||||
): Promise<ReservationItemDTO>
|
||||
|
||||
createInventoryItem(
|
||||
input: CreateInventoryItemInput
|
||||
input: CreateInventoryItemInput,
|
||||
context?: SharedContext
|
||||
): Promise<InventoryItemDTO>
|
||||
|
||||
createInventoryLevel(
|
||||
data: CreateInventoryLevelInput
|
||||
data: CreateInventoryLevelInput,
|
||||
context?: SharedContext
|
||||
): Promise<InventoryLevelDTO>
|
||||
|
||||
updateInventoryLevel(
|
||||
inventoryItemId: string,
|
||||
locationId: string,
|
||||
update: UpdateInventoryLevelInput
|
||||
update: UpdateInventoryLevelInput,
|
||||
context?: SharedContext
|
||||
): Promise<InventoryLevelDTO>
|
||||
|
||||
updateInventoryItem(
|
||||
inventoryItemId: string,
|
||||
input: CreateInventoryItemInput
|
||||
input: CreateInventoryItemInput,
|
||||
context?: SharedContext
|
||||
): Promise<InventoryItemDTO>
|
||||
|
||||
updateReservationItem(
|
||||
reservationItemId: string,
|
||||
input: UpdateReservationItemInput
|
||||
input: UpdateReservationItemInput,
|
||||
context?: SharedContext
|
||||
): Promise<ReservationItemDTO>
|
||||
|
||||
deleteReservationItemsByLineItem(lineItemId: string): Promise<void>
|
||||
deleteReservationItemsByLineItem(
|
||||
lineItemId: string,
|
||||
context?: SharedContext
|
||||
): Promise<void>
|
||||
|
||||
deleteReservationItem(reservationItemId: string | string[]): Promise<void>
|
||||
deleteReservationItem(
|
||||
reservationItemId: string | string[],
|
||||
context?: SharedContext
|
||||
): Promise<void>
|
||||
|
||||
deleteInventoryItem(inventoryItemId: string): Promise<void>
|
||||
deleteInventoryItem(
|
||||
inventoryItemId: string,
|
||||
context?: SharedContext
|
||||
): Promise<void>
|
||||
|
||||
deleteInventoryItemLevelByLocationId(locationId: string): Promise<void>
|
||||
deleteInventoryItemLevelByLocationId(
|
||||
locationId: string,
|
||||
context?: SharedContext
|
||||
): Promise<void>
|
||||
|
||||
deleteReservationItemByLocationId(locationId: string): Promise<void>
|
||||
deleteReservationItemByLocationId(
|
||||
locationId: string,
|
||||
context?: SharedContext
|
||||
): Promise<void>
|
||||
|
||||
deleteInventoryLevel(
|
||||
inventoryLevelId: string,
|
||||
locationId: string
|
||||
locationId: string,
|
||||
context?: SharedContext
|
||||
): Promise<void>
|
||||
|
||||
adjustInventory(
|
||||
inventoryItemId: string,
|
||||
locationId: string,
|
||||
adjustment: number
|
||||
adjustment: number,
|
||||
context?: SharedContext
|
||||
): Promise<InventoryLevelDTO>
|
||||
|
||||
confirmInventory(
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
quantity: number
|
||||
quantity: number,
|
||||
context?: SharedContext
|
||||
): Promise<boolean>
|
||||
|
||||
retrieveAvailableQuantity(
|
||||
inventoryItemId: string,
|
||||
locationIds: string[]
|
||||
locationIds: string[],
|
||||
context?: SharedContext
|
||||
): Promise<number>
|
||||
|
||||
retrieveStockedQuantity(
|
||||
inventoryItemId: string,
|
||||
locationIds: string[]
|
||||
locationIds: string[],
|
||||
context?: SharedContext
|
||||
): Promise<number>
|
||||
|
||||
retrieveReservedQuantity(
|
||||
inventoryItemId: string,
|
||||
locationIds: string[]
|
||||
locationIds: string[],
|
||||
context?: SharedContext
|
||||
): Promise<number>
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { FindConfig } from "../common/common"
|
||||
import {
|
||||
CreateStockLocationInput,
|
||||
FilterableStockLocationProps,
|
||||
@@ -6,25 +5,38 @@ import {
|
||||
UpdateStockLocationInput,
|
||||
} from "./common"
|
||||
|
||||
import { FindConfig } from "../common/common"
|
||||
import { SharedContext } from "../shared-context"
|
||||
|
||||
export interface IStockLocationService {
|
||||
list(
|
||||
selector: FilterableStockLocationProps,
|
||||
config?: FindConfig<StockLocationDTO>
|
||||
config?: FindConfig<StockLocationDTO>,
|
||||
context?: SharedContext
|
||||
): Promise<StockLocationDTO[]>
|
||||
|
||||
listAndCount(
|
||||
selector: FilterableStockLocationProps,
|
||||
config?: FindConfig<StockLocationDTO>
|
||||
config?: FindConfig<StockLocationDTO>,
|
||||
context?: SharedContext
|
||||
): Promise<[StockLocationDTO[], number]>
|
||||
|
||||
retrieve(
|
||||
id: string,
|
||||
config?: FindConfig<StockLocationDTO>
|
||||
config?: FindConfig<StockLocationDTO>,
|
||||
context?: SharedContext
|
||||
): Promise<StockLocationDTO>
|
||||
|
||||
create(input: CreateStockLocationInput): Promise<StockLocationDTO>
|
||||
create(
|
||||
input: CreateStockLocationInput,
|
||||
context?: SharedContext
|
||||
): Promise<StockLocationDTO>
|
||||
|
||||
update(id: string, input: UpdateStockLocationInput): Promise<StockLocationDTO>
|
||||
update(
|
||||
id: string,
|
||||
input: UpdateStockLocationInput,
|
||||
context?: SharedContext
|
||||
): Promise<StockLocationDTO>
|
||||
|
||||
delete(id: string): Promise<void>
|
||||
delete(id: string, context?: SharedContext): Promise<void>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user