feat(items): adapt item flows to inventory schema defaults and SKU generation

This commit is contained in:
2026-06-19 17:14:22 +02:00
parent 7b8a415c6a
commit 965a04a468
7 changed files with 306 additions and 19 deletions
@@ -0,0 +1,13 @@
import { describe, expect, it } from "vitest"
import { buildItemSku } from "@/use-cases/item.helpers"
describe("item sku generation", () => {
it("builds a normalized sku from the item name", () => {
expect(buildItemSku("Item A!", 0)).toBe("ITEM-A")
})
it("adds a numeric suffix for repeated normalized names", () => {
expect(buildItemSku("Item A?", 1)).toBe("ITEM-A-2")
})
})