Skip to content

Commit

Permalink
Merge pull request #131 from nginformatica/fix/consider-lot-empty-object
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksjm authored Nov 25, 2024
2 parents ce615bc + d848426 commit 262480d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quirons-broker",
"version": "0.0.1-alpha.142",
"version": "0.0.1-alpha.143",
"description": "A small library to expose the broker types",
"typings": "index.d.ts",
"types": "index.d.ts",
Expand Down
7 changes: 6 additions & 1 deletion src/inventory/internal/stock-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ export const Converter = {
Content.ListOfReturnItem.forEach(item => {
const { ListOfWarehouseStock, ListOfLotStock } = item

if (useLotNumber && ListOfLotStock && ListOfLotStock.length > 0) {
if (
useLotNumber
&& ListOfLotStock
&& Array.isArray(ListOfLotStock)
&& ListOfLotStock.length > 0
) {
ListOfLotStock.forEach(warehouse => {
stockLevel.push({
headerErpCompany: Header.CompanyId,
Expand Down
5 changes: 4 additions & 1 deletion src/inventory/schema/StockLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ const ReturnItem = t.intersection([
UnitItemCost: t.union([t.string, t.number]),
WarehouseInternalId: t.string,
BranchId: nullable(t.string),
ListOfLotStock: nullable(t.array(ListOfLotStock))
ListOfLotStock: nullable(t.union([
t.type({}),
t.array(ListOfLotStock)
]))
})
])

Expand Down

0 comments on commit 262480d

Please sign in to comment.