Feat/bulk operations for inventory service (#4503)

* initial push

* bulk delete reservations by location ids

* add method to interface (not implemented yet)

* bulk update

* delete reservations by location id bulk

* add create bulk for inventory item

* refactor attach inventory item method

* add changeset

* verbose false

* method override instead of multiple methods

* change up method signature

* redo changes when updating interface

* update createInventoryLevel method

* rename variables

* fix feedback

* return correct string array when emitting event

* refactor inventory service

* redo order changes

* snapshot

* move prep methods
This commit is contained in:
Philip Korsholm
2023-07-18 11:17:57 +02:00
committed by GitHub
parent d440c834d3
commit d184d23c63
20 changed files with 1194 additions and 228 deletions
+5
View File
@@ -268,6 +268,11 @@ export type UpdateInventoryLevelInput = {
incoming_quantity?: number
}
export type BulkUpdateInventoryLevelInput = {
inventory_item_id: string
location_id: string
} & UpdateInventoryLevelInput
export type UpdateReservationItemInput = {
quantity?: number
location_id?: string
+27 -5
View File
@@ -56,16 +56,38 @@ export interface IInventoryService {
context?: SharedContext
): Promise<ReservationItemDTO>
// TODO make it bulk
createReservationItems(
input: CreateReservationItemInput[],
context?: SharedContext
): Promise<ReservationItemDTO[]>
createInventoryItem(
input: CreateInventoryItemInput,
context?: SharedContext
): Promise<InventoryItemDTO>
createInventoryItems(
input: CreateInventoryItemInput[],
context?: SharedContext
): Promise<InventoryItemDTO[]>
createInventoryLevel(
data: CreateInventoryLevelInput,
data: CreateInventoryLevelInput ,
context?: SharedContext
): Promise<InventoryLevelDTO>
createInventoryLevels(
data: CreateInventoryLevelInput[],
context?: SharedContext
): Promise<InventoryLevelDTO[]>
updateInventoryLevels(
updates: ({
inventory_item_id: string
location_id: string
} & UpdateInventoryLevelInput)[],
context?: SharedContext
): Promise<InventoryLevelDTO[]>
updateInventoryLevel(
inventoryItemId: string,
@@ -98,17 +120,17 @@ export interface IInventoryService {
// TODO make it bulk
deleteInventoryItem(
inventoryItemId: string,
inventoryItemId: string | string[],
context?: SharedContext
): Promise<void>
deleteInventoryItemLevelByLocationId(
locationId: string,
locationId: string | string[],
context?: SharedContext
): Promise<void>
deleteReservationItemByLocationId(
locationId: string,
locationId: string | string[],
context?: SharedContext
): Promise<void>