sinfactura-types 1.8.0 → 1.8.2

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/invoice.d.ts CHANGED
@@ -1,5 +1,26 @@
1
1
  declare global {
2
2
  type FiscalStatus = 'pending_cae' | 'authorized_cae' | 'authorized_caea' | 'caea_reported' | 'rejected' | 'voided';
3
+ /**
4
+ * One discriminated IVA alicuota on an issued voucher (api#1961).
5
+ *
6
+ * `id` is AFIP's WSFE `Iva[].Id`, which is ALSO the Libro IVA Digital alicuota
7
+ * code once 4-padded — verified against ARCA's *Tablas del SISTEMA* section 1:
8
+ * 0003 = 0,00 % · 0004 = 10,50 % · 0005 = 21,00 % · 0006 = 27,00 % ·
9
+ * 0008 = 5,00 % · 0009 = 2,50 %. Those six are the whole valid domain; Ids 1
10
+ * and 2 (No Gravado / Exento) are Codigos de Operacion, not alicuotas, and
11
+ * WSFEv1 rejects them inside `Iva[]`.
12
+ *
13
+ * A bucket is meaningful when `baseImp !== 0`: a 0 %-rated line has
14
+ * `importe === 0` but is still a real, declarable alicuota.
15
+ */
16
+ interface InvoiceAlicuota {
17
+ /** AFIP WSFE `Iva[].Id` — one of 3, 4, 5, 6, 8, 9. */
18
+ id: number;
19
+ /** Neto gravado at this rate. */
20
+ baseImp: number;
21
+ /** IVA liquidado at this rate; `0` for the 0 % rate. */
22
+ importe: number;
23
+ }
3
24
  interface Invoice {
4
25
  storeId: string;
5
26
  invoiceId: string;
@@ -28,6 +49,21 @@ declare global {
28
49
  neto21: number;
29
50
  iva10: number;
30
51
  iva21: number;
52
+ /**
53
+ * api#1961 — the FULL per-alicuota IVA breakdown, one entry per declared rate.
54
+ *
55
+ * The `neto10`/`neto21`/`iva10`/`iva21` quartet above only ever captured AFIP
56
+ * Iva Ids 4 (10,5 %) and 5 (21 %). The catalog has SIX rates, so the other
57
+ * four (0 %, 2,5 %, 5 %, 27 %) were declared to ARCA yet dropped from the row,
58
+ * while `total` included every bucket — silently under-reporting the Libro IVA
59
+ * Digital, the RG 3685 export, the F.2051 apertura and the invoice PDF.
60
+ *
61
+ * Forward-only, no backfill: absent on every row issued before api#1961, and
62
+ * never set on the WSFEX export path. Consumers MUST fall back to the legacy
63
+ * quartet when it is absent rather than treating an empty result as "no IVA".
64
+ * The quartet is retained, not deprecated — still written on every new row.
65
+ */
66
+ alicuotas?: InvoiceAlicuota[];
31
67
  discount?: number;
32
68
  total: number;
33
69
  cae: string;
@@ -327,6 +363,13 @@ declare global {
327
363
  effectiveFrom: string;
328
364
  acceptanceWindowDays: number;
329
365
  acceptanceWindowValidThrough?: string;
366
+ /**
367
+ * api#1754 — epoch-ms last-write trace, set by the api on every threshold
368
+ * write and echoed on GET /config + the POST response (api PLATFORM_API.md
369
+ * section 20). OPTIONAL by design: a row written before the field carries
370
+ * none, so a reader must not treat its absence as "never updated".
371
+ */
372
+ updatedAt?: number;
330
373
  }
331
374
  }
332
375
  export {};
package/dist/store.d.ts CHANGED
@@ -109,6 +109,14 @@ declare global {
109
109
  * default — does NOT reinterpret existing Account rows.
110
110
  */
111
111
  defaultAccountCurrency?: string;
112
+ /**
113
+ * api#1768 / ADR-0004 section 5 — tenant opt-out from AI product
114
+ * enrichment. Absent is the (common) "tenant never touched the toggle"
115
+ * default and does NOT block; only an explicit `true` blocks. The api
116
+ * gate is fail-CLOSED on a read failure, but open on a missing field —
117
+ * do not conflate the two.
118
+ */
119
+ aiOptOut?: boolean;
112
120
  /**
113
121
  * api#1740 — per-category × per-channel notification/feedback defaults.
114
122
  * Store-level baseline the app layers per-device overrides on top of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",