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 companyAutomat.js
* @description Manages configuration details of the currently selected company
* (tax rates, currency, language, legal details, and root category ID).
*
* Upstream Triggers:
* - `authAutomat`: Subscribes to auth state changes — triggers `actions.load()`
* when status is `'authed'` with a `selectedCompanyId`, and `actions.reset()` on `'anon'`.
* - UI / Settings: Calls `update(payload)` or manual `load()`.
*
* Downstream Triggers:
* - `categoryAutomat`: Subscribes to `companyAutomat` — triggers `actions.loadTree()`
* whenever `company.current.id` or `rootCategoryId` changes/becomes available;
* resets when company is unset.
* - `posterminalAutomat`: Reads `companyAutomat.state.current?.id` as a fallback company ID.
*/
import { Automat } from 'react-automat';
import { company as companyApi } from '../api';
import authAutomat from './authAutomat';