This commit is contained in:
seb
2026-07-31 16:06:51 +02:00
parent 38f90ceec1
commit f9dec6d51a
11 changed files with 200 additions and 0 deletions

View File

@@ -135,6 +135,18 @@ Backend mapping:
---
## `article`
| Method | Signature | Returns |
| --- | --- | --- |
| `createUnderParent` | `({ googleAuthId, parentId, name })` | `{ id, parentId, name, sku }` |
`parentId` is the category id. Creates `article` + `articletext` (company default language) + `categoryarticle` in one transaction. Allocates `sku` via `getnextnumberwithprefixandpadding` (`type` `sku`; creates `numbers` row with empty prefix if missing). Default unit `pc` is ensured if missing (`unitamount` 1, `weight` 0).
Auth via `resolveCategoryAccess(googleAuthId, parentId)` — `Parent not found` / `Not authorized`.
---
## Backend route cheatsheet
| Route | Store call |
@@ -147,6 +159,7 @@ Backend mapping:
| `GET /api/category/tree?companyId=` | `category.getTreeForCompany(googleAuthId, companyId)` |
| `POST /api/category` | `category.createUnderParent({ googleAuthId, parentId, name })` |
| `DELETE /api/category/:id` | `category.delete({ googleAuthId, id })` |
| `POST /api/article` | `article.createUnderParent({ googleAuthId, parentId, name })` |
---