Add company-scoped unit list/upsert/delete and article unit patches.

Units are isolated per company; article detail exposes full unit shape, and unused units can be deleted safely via FK NO ACTION.
This commit is contained in:
seb
2026-08-01 06:12:24 +02:00
parent 54700a145e
commit 12e83a7ffb
16 changed files with 519 additions and 44 deletions

View File

@@ -28,7 +28,7 @@ export default function createUnderParent(pool) {
await tx.begin();
try {
const unitId = await ensureUnit(tx);
const unitId = await ensureUnit(tx, languageId, companyId);
const sku = await allocateSku(companyId, tx);
const slug = slugify(name);