sinfactura-types 1.10.355 → 1.10.357

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/account.d.ts CHANGED
@@ -368,7 +368,20 @@ declare global {
368
368
  * candidate forever on a drift that will never be checkpointed.
369
369
  */
370
370
  candidates: number;
371
- /** `BALANCE-{customerId}-{date}` rows written. */
371
+ /**
372
+ * `BALANCE-{customerId}-{date}` rows written — by the ordinary full pass AND
373
+ * by the bounded catch-up passes.
374
+ *
375
+ * ⚠️ **A catch-up write counts, and excluding it inverted the one number an
376
+ * operator reads.** A customer whose ledger is too long for the full walk
377
+ * ends on `ledgerTruncated`, which is counted as `failed`; when the catch-up
378
+ * loop inside that branch wrote three checkpoints, three rows landed, the
379
+ * next walk got strictly shorter, and the run still reported one failure and
380
+ * zero checkpoints. Converging looked identical to stuck — on exactly the
381
+ * customers the catch-up pass exists for. A customer can therefore appear in
382
+ * both `checkpointed` and `failed` in one run; that pair IS the state
383
+ * "advancing but not done", and neither number alone can say it.
384
+ */
372
385
  checkpointed: number;
373
386
  /** Candidates whose RE-DERIVED count came in under the threshold. Correct refusals, never errors. */
374
387
  skippedBelowThreshold: number;
@@ -420,7 +420,26 @@ declare global {
420
420
  * stopped short is indistinguishable from a clean history, and erasure is
421
421
  * irreversible.
422
422
  */
423
- | 'CUSTOMER_ORDER_HISTORY_TRUNCATED';
423
+ | 'CUSTOMER_ORDER_HISTORY_TRUNCATED'
424
+ /**
425
+ * The customer's ACCOUNT ledger could not be read to the end, so the live
426
+ * balance could not be derived. Refused for the same reason as
427
+ * `CUSTOMER_ORDER_HISTORY_TRUNCATED`: a short fold is a WRONG SUM rather
428
+ * than a short list, and erasure is irreversible.
429
+ */
430
+ | 'CUSTOMER_LEDGER_TRUNCATED'
431
+ /**
432
+ * A concurrent LEDGER write moved `balance` or `eventSeq` between the
433
+ * erasure's pre-read and its conditional write, so the write cancelled.
434
+ *
435
+ * ⚠️ **NOTHING was erased, and this is the one refusal that is safe to
436
+ * retry immediately.** It is distinct from `CUSTOMER_ALREADY_ANONYMIZED`
437
+ * precisely because the two used to be reported as one: the erasure's
438
+ * condition pins three predicates and DynamoDB reports one cancellation
439
+ * code for all of them, so a customer who simply took delivery of an order
440
+ * mid-request was announced to the operator as already erased.
441
+ */
442
+ | 'CUSTOMER_CHANGED_DURING_ERASURE';
424
443
  /**
425
444
  * ONE channel's consent as the customer row records it — a CURRENT value
426
445
  * with its provenance, flattened per channel for the data-subject export.
@@ -501,6 +520,21 @@ declare global {
501
520
  * operator handler additionally writes an un-deduped `ERROR` row.
502
521
  */
503
522
  sessionRevocationComplete: boolean;
523
+ /**
524
+ * `ACCOUNT#` ledger rows whose denormalised `fullName` was removed by this
525
+ * erasure.
526
+ *
527
+ * ⚠️ The ledger rows are NOT erased — they are the retained fiscal trail.
528
+ * Only the personal attributes copied onto them are, which is what stops an
529
+ * erased customer's name being served on statements and exports.
530
+ */
531
+ ledgerRowsScrubbed: number;
532
+ /**
533
+ * `false` when the ledger could not be read to the end, so rows carrying the
534
+ * name may remain. The CUSTOMER row IS anonymised either way; a caller must
535
+ * surface this rather than implying a clean scrub.
536
+ */
537
+ ledgerScrubComplete: boolean;
504
538
  }
505
539
  /**
506
540
  * A stored `Customer` plus the session tokens. Same caveat as `AuthUser`:
@@ -785,6 +785,15 @@ declare global {
785
785
  format: 'csv' | 'pdf' | 'xlsx';
786
786
  entity_type: string;
787
787
  row_count: number;
788
+ /**
789
+ * The source read was CAPPED, so `row_count` is a FLOOR, not a total.
790
+ * Optional and mirrored by the `/audit` ingest schema, which accepted it
791
+ * ahead of this declaration because that surface is the RECEIVER — a
792
+ * receiver widens before an emitter narrows. Only the customers export
793
+ * can set it today; the other emitters source from handlers that throw on
794
+ * truncation, so their `row_count` is already a total.
795
+ */
796
+ truncated?: boolean;
788
797
  }
789
798
  interface ImpersonationUiStartedEvent extends UserActivityEventBase {
790
799
  event: 'Impersonation UI Started';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.355",
3
+ "version": "1.10.357",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",