Add inventory item detail detail (basic)

This commit is contained in:
Thomas Andres Gomez 2025-04-17 22:37:44 +02:00
parent 05a376aea8
commit c94c820efb
28 changed files with 490 additions and 77 deletions

View file

@ -80,7 +80,7 @@ class ItemStore(
throw JsonConversionException(root = exception)
}
}
?.sortedWith(compareBy(Collator.getInstance()) { it.metadata.name })
?.sortedWith(compareBy(Collator.getInstance()) { it.metadata.label })
?: emptyList()
}
@ -113,7 +113,7 @@ class ItemStore(
code = APIResponse.ErrorCode.ItemId,
)
}
if (item.metadata.name.isEmpty()) {
if (item.metadata.label.isEmpty()) {
throw BusinessException(
message = "Item 'name' is a mandatory field.",
code = APIResponse.ErrorCode.ItemName,
@ -146,7 +146,7 @@ class ItemStore(
}
}
.sortedWith(compareBy(Collator.getInstance()) {
it.metadata.name
it.metadata.label
})
}
}
@ -173,7 +173,7 @@ class ItemStore(
item.removeIf { it.id == id }
}
.sortedWith(compareBy(Collator.getInstance()) {
it.metadata.name
it.metadata.label
})
}
}