sinfactura-types 1.10.330 → 1.10.331

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.
Files changed (2) hide show
  1. package/dist/caea.d.ts +46 -0
  2. package/package.json +1 -1
package/dist/caea.d.ts CHANGED
@@ -45,5 +45,51 @@ declare global {
45
45
  monthMinutesPct?: number;
46
46
  monthsFlagged: number;
47
47
  }
48
+ /**
49
+ * Why a CAEA period is being held back from the automatic inform. Closed set
50
+ * of bare codes — render from the code, never from prose.
51
+ *
52
+ * `DATA_DRIFT` — the period row counts CAEA-stamped invoices
53
+ * (`invoiceCount > 0`) yet no invoice carrying its code can be found, in
54
+ * either the owed or the already-informed state. The inform job refuses both
55
+ * to report the period as unused and to mark it informed; it stays that way
56
+ * until someone investigates. It will NOT resolve on its own.
57
+ */
58
+ type CaeaPeriodHeldReason = 'DATA_DRIFT';
59
+ /**
60
+ * The per-period facts `GET /caea` DERIVES AT READ from the period's invoices.
61
+ *
62
+ * ⚠️ None of this is ever stored. It is deliberately not part of `CAEAPeriod`
63
+ * (the row): no writer sets these fields, and a row read by any other path
64
+ * does not carry them.
65
+ *
66
+ * `owedInvoices` — how many of the period's CAEA-stamped invoices are still
67
+ * owed to ARCA, counted with the same rule the inform job uses to pick what it
68
+ * sends. It is NOT `invoiceCount`: that is the period's running TOTAL of
69
+ * stamped invoices and never decreases. A PARTIAL inform (some vouchers
70
+ * accepted, some rejected or deferred) leaves the period `active` with
71
+ * `invoiceCount` untouched and `owedInvoices` reduced but non-zero — quote
72
+ * this number, not the total, when saying what is pending. It is also NOT
73
+ * `CAEAInformResult.pendingInvoices`, which counts only the owed invoices that
74
+ * cannot be informed because their frozen det snapshot is missing. A period
75
+ * already `informed` reads `0`.
76
+ *
77
+ * `invoiceReadTruncated` — `true` when the invoice read behind these facts
78
+ * stopped at its read bound before finishing. `owedInvoices` is then a LOWER
79
+ * bound (say "at least N"), and `held` is never asserted from a short read.
80
+ *
81
+ * `held` — `true` when the period has ended, is still awaiting inform, and the
82
+ * inform job classifies it as one it will not inform automatically. `false`
83
+ * means not held — always present, never absent. `reason` is present exactly
84
+ * when `held` is `true`.
85
+ */
86
+ interface CaeaPeriodDerived {
87
+ owedInvoices: number;
88
+ invoiceReadTruncated: boolean;
89
+ held: boolean;
90
+ reason?: CaeaPeriodHeldReason;
91
+ }
92
+ /** One entry of the `GET /caea` period history: the stored row plus what the read derives. */
93
+ type CaeaPeriodView = CAEAPeriod & CaeaPeriodDerived;
48
94
  }
49
95
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.330",
3
+ "version": "1.10.331",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",