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

@@ -14,7 +14,13 @@ function shapeArticleDetail(row, categoryIds, photos, eans, prices) {
slug: row.slug,
unitamount: row.unitamount,
weight: row.weight,
unit: { si: row.unitSi },
unit: {
si: row.unitSi,
basesi: row.unitBasesi,
basesifactor: row.unitBasesifactor,
symbol: row.unitSymbol ?? null,
name: row.unitName ?? null,
},
brand: row.brandName
? {
name: row.brandName,