feat: make AbstractModuleService create method type-safe (#11216)

This commit is contained in:
Harminder Virk
2025-02-03 21:25:01 +05:30
committed by GitHub
parent 6cd8249a2c
commit 016e332e9b
23 changed files with 677 additions and 35 deletions
@@ -222,11 +222,12 @@ export default class InventoryModuleService
})
}
// @ts-ignore
// @ts-expect-error
async createReservationItems(
input: InventoryTypes.CreateReservationItemInput[],
context?: Context
): Promise<InventoryTypes.ReservationItemDTO[]>
// @ts-expect-error
async createReservationItems(
input: InventoryTypes.CreateReservationItemInput,
context?: Context
@@ -234,6 +235,7 @@ export default class InventoryModuleService
@InjectManager()
@EmitEvents()
// @ts-expect-error
async createReservationItems(
input:
| InventoryTypes.CreateReservationItemInput[]
@@ -380,6 +382,7 @@ export default class InventoryModuleService
input: InventoryTypes.CreateInventoryLevelInput,
context?: Context
): Promise<InventoryTypes.InventoryLevelDTO>
// @ts-expect-error
createInventoryLevels(
input: InventoryTypes.CreateInventoryLevelInput[],
context?: Context
@@ -387,6 +390,7 @@ export default class InventoryModuleService
@InjectManager()
@EmitEvents()
// @ts-expect-error
async createInventoryLevels(
input:
| InventoryTypes.CreateInventoryLevelInput[]
@@ -434,6 +438,7 @@ export default class InventoryModuleService
input: InventoryTypes.UpdateInventoryItemInput[],
context?: Context
): Promise<InventoryTypes.InventoryItemDTO[]>
// @ts-expect-error
updateInventoryItems(
input: InventoryTypes.UpdateInventoryItemInput,
context?: Context
@@ -441,6 +446,7 @@ export default class InventoryModuleService
@InjectManager()
@EmitEvents()
// @ts-expect-error
async updateInventoryItems(
input:
| InventoryTypes.UpdateInventoryItemInput
@@ -549,6 +555,7 @@ export default class InventoryModuleService
updates: InventoryTypes.UpdateInventoryLevelInput[],
context?: Context
): Promise<InventoryTypes.InventoryLevelDTO[]>
// @ts-expect-error
async updateInventoryLevels(
updates: InventoryTypes.UpdateInventoryLevelInput,
context?: Context
@@ -556,6 +563,7 @@ export default class InventoryModuleService
@InjectManager()
@EmitEvents()
// @ts-expect-error
async updateInventoryLevels(
updates:
| InventoryTypes.UpdateInventoryLevelInput[]
@@ -628,11 +636,12 @@ export default class InventoryModuleService
* @param context
* @return The updated inventory level
*/
// @ts-ignore
// @ts-expect-error
async updateReservationItems(
input: InventoryTypes.UpdateReservationItemInput[],
context?: Context
): Promise<InventoryTypes.ReservationItemDTO[]>
// @ts-expect-error
async updateReservationItems(
input: InventoryTypes.UpdateReservationItemInput,
context?: Context
@@ -640,6 +649,7 @@ export default class InventoryModuleService
@InjectManager()
@EmitEvents()
// @ts-expect-error
async updateReservationItems(
input:
| InventoryTypes.UpdateReservationItemInput