This commit is contained in:
seb
2026-10-04 22:47:26 +02:00
parent 8b401fa50b
commit a90069d340
44 changed files with 994 additions and 268 deletions

View File

@@ -1,3 +1,20 @@
/**
* @file articleIndexAutomat.js
* @description Cached company article search index (`GET /api/articleIndex`).
* Provides fast client-side searching, manifest pickers, and optimistic updates.
* Built via `createListAutomat`.
*
* Upstream Triggers:
* - `authAutomat`: Via `createListAutomat` — triggers `load()` on `'authed'` with
* a `selectedCompanyId`, and `reset()` on `'anon'`.
* - `sseAutomat`: Triggers `reload()` upon receiving an `'articles'` SSE event.
* - `artikelAutomat`: Triggers `setArticleIndexName(sku, name)` on optimistic
* article renames, or `reset()` on mutation failure rollback.
*
* Downstream Triggers:
* - `articleSearchAutomat`: Reads and searches records via `actions.ensureLoaded()`.
*/
import { articleIndex as articleIndexApi } from '../api';
import { createListAutomat } from './createListAutomat';
@@ -8,7 +25,7 @@ import { createListAutomat } from './createListAutomat';
* @property {string} name Article name.
* @property {Array<string>} eans Article EANs.
* @property {string|null} categories Comma-joined category ids.
* @property {boolean} isFather Whether the article has child variants.
* @property {boolean} isParent Whether the article has child variants.
*/
/**