Fix/minor mw fixes (#3521)

**What**
- Fix stock locations quantities being shown as `undefined` and `NaN`
- Throw if updates to location levels are made with negative quantities through the api
- Show "allocated" in order summary for partially fulfilled orders

Fixes CORE-1268, CORE-1267, CORE-1265
This commit is contained in:
Philip Korsholm
2023-03-19 20:28:59 +00:00
committed by GitHub
parent a3a7ace0c0
commit ea2633bccf
5 changed files with 53 additions and 12 deletions
@@ -1,5 +1,5 @@
import { Request, Response } from "express"
import { IsNumber, IsOptional } from "class-validator"
import { IsNumber, IsOptional, Min } from "class-validator"
import { IInventoryService } from "../../../../interfaces"
import { FindParams } from "../../../../types/common"
@@ -105,10 +105,12 @@ export default async (req: Request, res: Response) => {
export class AdminPostInventoryItemsItemLocationLevelsLevelReq {
@IsOptional()
@IsNumber()
@Min(0)
incoming_quantity?: number
@IsOptional()
@IsNumber()
@Min(0)
stocked_quantity?: number
}