u
This commit is contained in:
30
TODO.md
30
TODO.md
@@ -1,30 +0,0 @@
|
|||||||
# TODO — nächster Schritt (Brands / Artikelfelder)
|
|
||||||
|
|
||||||
Geschwister: **dashdbschema** hat `libdashstore` um folgende Store-Methoden erweitert (alle authenticated, `googleAuthId` = eingeloggter User). Die Brand-Store-API existiert bereits. Das HTTP-Layer + OpenAPI-Doku hier in dashback ist **umgesetzt** — **dashfront** kann die UI bauen.
|
|
||||||
|
|
||||||
## Store-Methoden + HTTP-Routen (in dashback verdrahtet)
|
|
||||||
|
|
||||||
**`companyId` kommt immer aus der Auth-Session** (`req.user.selectedCompanyId`) — keine explizite `companyId` in Pfad/Query/Body, wie bei den Unit-Routen.
|
|
||||||
|
|
||||||
### `article` (alle liefern dasselbe Shape wie `getBySku`)
|
|
||||||
| Store-Methode | HTTP-Route | Args |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| `setEansBySku` | `PUT /api/article/:sku/eans` | `(googleAuthId, sku, string[])` — replace-all |
|
|
||||||
| `setBrandIdBySku` | `PUT /api/article/:sku/brand` | `(googleAuthId, sku, brandId \| null)` |
|
|
||||||
| `setWeightBySku` | `PUT /api/article/:sku/weight` | `(googleAuthId, sku, weight)` |
|
|
||||||
| `setCategoryIdsBySku` | `PUT /api/article/:sku/categories` | `(googleAuthId, sku, number[])` — replace-all |
|
|
||||||
| `getBySku` | `GET /api/article/:sku` | liefert `eans`, `categoryIds`, `weight`, `brand` bereits mit |
|
|
||||||
|
|
||||||
### `brand` (verdrahtet)
|
|
||||||
| Store-Methode | HTTP-Route | Args |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| `brand.list` | `GET /api/brand` | `(googleAuthId, selectedCompanyId)` |
|
|
||||||
| `brand.upsert` | `PUT /api/brand` | `(googleAuthId, selectedCompanyId, { name, gsprpinfo? })` |
|
|
||||||
| `brand.delete` | `DELETE /api/brand/:id` | `(googleAuthId, selectedCompanyId, id)` — Fehler `Brand in use`, wenn noch Artikel referenzieren |
|
|
||||||
|
|
||||||
## Umgesetzt
|
|
||||||
1. Routen unter `docs/api/routes/` + OpenAPI via `@openapi` JSDoc angelegt (stil wie existing routes).
|
|
||||||
2. Auth-Integration: `googleAuthId` aus Session bezogen (wie bestehende Routen).
|
|
||||||
3. Company-Scope: `selectedCompanyId` aus Session; Methoden validieren selbst (`Company not found` / `Not authorized` / etc.).
|
|
||||||
4. `npm run docs:api` regenerieren.
|
|
||||||
5. `README.md` (dashback) mit neuen Endpoints ergänzen.
|
|
||||||
Reference in New Issue
Block a user