sinfactura-types 1.10.231 → 1.10.232
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/store.d.ts +54 -0
- package/package.json +1 -1
package/dist/store.d.ts
CHANGED
|
@@ -157,6 +157,42 @@ declare global {
|
|
|
157
157
|
interface ReportDigestConfig {
|
|
158
158
|
frequency: 'none' | 'daily' | 'weekly' | 'monthly';
|
|
159
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Cut-offs and window for the periodic ABC (Pareto) classification of the
|
|
162
|
+
* catalogue. Every member is optional and absence falls back to the api's
|
|
163
|
+
* built-in defaults, so a store that has never configured this is still
|
|
164
|
+
* classified — the job runs on defaults rather than not running.
|
|
165
|
+
*
|
|
166
|
+
* ⚠️ The two cut-offs are CUMULATIVE consumption-value share, not per-product
|
|
167
|
+
* share, and that is the whole of Pareto: products are ranked by consumption
|
|
168
|
+
* value descending, the running total is taken as a percentage of the store's
|
|
169
|
+
* total, and the class is the first band the running total falls inside. A
|
|
170
|
+
* per-product reading would put almost every product in `C` on any real
|
|
171
|
+
* catalogue.
|
|
172
|
+
*
|
|
173
|
+
* ⚠️ `bCumulativePercent` must be greater than `aCumulativePercent`; a pair
|
|
174
|
+
* that inverts them describes no `B` band at all. The api clamps rather than
|
|
175
|
+
* refusing, because this is a config leaf on a row that is written through a
|
|
176
|
+
* `.loose()` body and a refusal here would strand the whole catalogue
|
|
177
|
+
* unclassified rather than one field unread.
|
|
178
|
+
*/
|
|
179
|
+
interface AbcClassificationConfig {
|
|
180
|
+
/**
|
|
181
|
+
* Trailing window, in days, of `SALE#` ledger rows the ranking is computed
|
|
182
|
+
* over. Absent falls back to the api default (90).
|
|
183
|
+
*
|
|
184
|
+
* ⚠️ A window is not the same as available history. `dated` on the `SALE#`
|
|
185
|
+
* ledger is forward-only from 2026-08-29, so a 90-day window on a store
|
|
186
|
+
* that started yesterday ranks one day of sales — correct arithmetic over a
|
|
187
|
+
* thin sample, which is exactly why an unclassified product must stay
|
|
188
|
+
* unclassified rather than being defaulted into a band.
|
|
189
|
+
*/
|
|
190
|
+
windowDays?: number;
|
|
191
|
+
/** Cumulative consumption-value share, in percent, up to which a product is `A`. Absent falls back to 80. */
|
|
192
|
+
aCumulativePercent?: number;
|
|
193
|
+
/** Cumulative consumption-value share, in percent, up to which a product is `B`. Absent falls back to 95. */
|
|
194
|
+
bCumulativePercent?: number;
|
|
195
|
+
}
|
|
160
196
|
interface Store {
|
|
161
197
|
/**
|
|
162
198
|
* Cmd-K palette overrides. Absent means "all built-in verbs, default order".
|
|
@@ -307,6 +343,24 @@ declare global {
|
|
|
307
343
|
* send to everyone.
|
|
308
344
|
*/
|
|
309
345
|
reportDigest?: ReportDigestConfig;
|
|
346
|
+
/**
|
|
347
|
+
* Cut-offs and window for the periodic ABC classification job.
|
|
348
|
+
*
|
|
349
|
+
* Absent means the job runs on the api's defaults — NOT that it is off.
|
|
350
|
+
* The classification is a platform capability rather than an opt-in
|
|
351
|
+
* feature, and a store that never configured it still wants its catalogue
|
|
352
|
+
* ranked; the leaf exists to move the cut-offs, not to switch the job on.
|
|
353
|
+
*
|
|
354
|
+
* ⚠️ Writable at the PRIVILEGED tier, like `reportDigest` above — the
|
|
355
|
+
* cut-offs decide how often a product is counted, so they are an
|
|
356
|
+
* ADMIN/SUPERVISOR/MANAGER setting with a `STORE_CONFIG_FORBIDDEN`
|
|
357
|
+
* refusal, never a per-user preference.
|
|
358
|
+
*
|
|
359
|
+
* ⚠️ Changing either cut-off re-bands the whole catalogue on the next run
|
|
360
|
+
* and emits a `products` frame for every product that moved. That is
|
|
361
|
+
* intended, and it is why the job caps its own fan-out.
|
|
362
|
+
*/
|
|
363
|
+
abcClassification?: AbcClassificationConfig;
|
|
310
364
|
/**
|
|
311
365
|
* Ceiling on concurrent refresh-token sessions per user. When a new login
|
|
312
366
|
* would exceed it the OLDEST family is revoked, so the cap never blocks a
|