sinfactura-types 1.10.618 → 1.10.620
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/caea.d.ts +46 -3
- package/dist/cart.d.ts +6 -0
- package/dist/invoice.d.ts +6 -0
- package/dist/order.d.ts +12 -0
- package/package.json +1 -1
package/dist/caea.d.ts
CHANGED
|
@@ -78,13 +78,26 @@ declare global {
|
|
|
78
78
|
* pre-submit reasons: a period with a missing snapshot reads
|
|
79
79
|
* `MISSING_DET_SNAPSHOT` even if its siblings were also rejected.
|
|
80
80
|
*
|
|
81
|
+
* `ARCA_CONFIGURATION_REFUSED` — the job DID submit, and ARCA refused the
|
|
82
|
+
* whole call with a configuration code: today only 1204, the punto de venta
|
|
83
|
+
* the call carried is not registered at ARCA as Sistema "CAEA – Fact.
|
|
84
|
+
* Elect.". No retry can clear it; the next daily run informs the period once
|
|
85
|
+
* an operator fixes it, and the fix depends on the period. A `zero-movement`
|
|
86
|
+
* period is reported on the store's `caeaPointOfSale`: register that number
|
|
87
|
+
* at ARCA, or point `caeaPointOfSale` at one that is. An `inform` period
|
|
88
|
+
* reports its vouchers on the punto de venta each was issued on: register
|
|
89
|
+
* THAT number at ARCA — re-pointing `caeaPointOfSale` does not help vouchers
|
|
90
|
+
* already issued. Derived from the row's `informConfigRefusal`, which names
|
|
91
|
+
* the code and the punto de venta. Ranked after the three pre-submit
|
|
92
|
+
* reasons and before `DET_REJECTED`.
|
|
93
|
+
*
|
|
81
94
|
* `READ_FAILED` — not a job decision: the invoice read behind this period
|
|
82
95
|
* threw (a throttle, a transport error), so the screen cannot say whether the
|
|
83
96
|
* job would inform it. `owedInvoices` is then `0` as a lower bound and
|
|
84
97
|
* `invoiceReadTruncated` is `true`. Refetch; it clears on the next successful
|
|
85
98
|
* read.
|
|
86
99
|
*/
|
|
87
|
-
type CaeaPeriodHeldReason = 'DATA_DRIFT' | 'NO_CAEA_POINT_OF_SALE' | 'MISSING_DET_SNAPSHOT' | 'DET_REJECTED' | 'READ_FAILED';
|
|
100
|
+
type CaeaPeriodHeldReason = 'DATA_DRIFT' | 'NO_CAEA_POINT_OF_SALE' | 'MISSING_DET_SNAPSHOT' | 'ARCA_CONFIGURATION_REFUSED' | 'DET_REJECTED' | 'READ_FAILED';
|
|
88
101
|
/**
|
|
89
102
|
* The per-period facts `GET /caea` DERIVES AT READ from the period's invoices.
|
|
90
103
|
*
|
|
@@ -110,8 +123,9 @@ declare global {
|
|
|
110
123
|
* `held` — `true` when the period has ended, is still awaiting inform, and the
|
|
111
124
|
* inform job will not flip it to `informed` on its own — for EVERY refusal the
|
|
112
125
|
* job makes: the three it decides BEFORE submitting (drift, no CAEA punto de
|
|
113
|
-
* venta, a missing snapshot) and the
|
|
114
|
-
* (`DET_REJECTED`, carried on the row by
|
|
126
|
+
* venta, a missing snapshot) and the two it learns AFTER submitting
|
|
127
|
+
* (`ARCA_CONFIGURATION_REFUSED`, `DET_REJECTED`, each carried on the row by
|
|
128
|
+
* the job's own stamp) — or, for such a
|
|
115
129
|
* period, when the read behind these facts failed and the answer is unknown
|
|
116
130
|
* (`READ_FAILED`). `false`
|
|
117
131
|
* means not held — always present, never absent. `reason` is present exactly
|
|
@@ -124,6 +138,35 @@ declare global {
|
|
|
124
138
|
held: boolean;
|
|
125
139
|
reason?: CaeaPeriodHeldReason;
|
|
126
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* The coded refusals of `POST /caea { mode: 'inform' }` (the `error` field).
|
|
143
|
+
*
|
|
144
|
+
* `CAEA_PERIOD_NOT_ACTIVE` (404) — no `active` period for that
|
|
145
|
+
* `period`/`order`: it was never requested, or it is already `informed`.
|
|
146
|
+
* `CAEA_PERIOD_NOT_ENDED` (409) — the fortnight is still open.
|
|
147
|
+
* `CAEA_PERIOD_SETTLING` (409) — it closed less than a minute ago; retry.
|
|
148
|
+
* `CAEA_INFORM_IN_PROGRESS` (409) — another run (the daily cron or a second
|
|
149
|
+
* click) holds the period's inform lock; retry shortly.
|
|
150
|
+
* `CAEA_INFORM_CONFIGURATION_REFUSED` (502) — ARCA refused the Inform with a
|
|
151
|
+
* configuration code (today only 1204: the punto de venta is not registered at
|
|
152
|
+
* ARCA as a CAEA one). Nothing was informed and the period stays `active`.
|
|
153
|
+
* `data` is {@link CaeaInformConfigurationRefusedData}. Retrying does not
|
|
154
|
+
* help until an operator acts, and `message` names the fix for the refused
|
|
155
|
+
* method: for a zero-movement report, register the punto de venta at ARCA or
|
|
156
|
+
* point `caeaPointOfSale` at one that is; for issued vouchers, register
|
|
157
|
+
* `data.ptoVta` itself at ARCA.
|
|
158
|
+
*/
|
|
159
|
+
type CaeaInformErrorCode = 'CAEA_PERIOD_NOT_ENDED' | 'CAEA_PERIOD_SETTLING' | 'CAEA_PERIOD_NOT_ACTIVE' | 'CAEA_INFORM_IN_PROGRESS' | 'CAEA_INFORM_CONFIGURATION_REFUSED';
|
|
160
|
+
/**
|
|
161
|
+
* `data` of `502 CAEA_INFORM_CONFIGURATION_REFUSED`: ARCA's `code`, the
|
|
162
|
+
* punto de venta the refused call carried, and the period it was for.
|
|
163
|
+
*/
|
|
164
|
+
interface CaeaInformConfigurationRefusedData {
|
|
165
|
+
code: number;
|
|
166
|
+
ptoVta: number;
|
|
167
|
+
period: string;
|
|
168
|
+
order: 1 | 2;
|
|
169
|
+
}
|
|
127
170
|
/** One entry of the `GET /caea` period history: the stored row plus what the read derives. */
|
|
128
171
|
type CaeaPeriodView = CAEAPeriod & CaeaPeriodDerived;
|
|
129
172
|
}
|
package/dist/cart.d.ts
CHANGED
|
@@ -1278,6 +1278,12 @@ declare global {
|
|
|
1278
1278
|
* enforced by `tsc` rather than discovered at runtime. Supplying more than one
|
|
1279
1279
|
* is legal; the server tries `cartId`, then `terminalId`, then `customerId`.
|
|
1280
1280
|
*
|
|
1281
|
+
* ⚠️ A `cartId` is a DEMAND, not a first preference: when that row is gone —
|
|
1282
|
+
* checkout deletes the cart it converts — the write is `404 CART_NOT_FOUND`
|
|
1283
|
+
* and writes nothing. It never falls through to the other two and never mints
|
|
1284
|
+
* a replacement. Drop the id and address by `terminalId`/`customerId` to start
|
|
1285
|
+
* a new sale.
|
|
1286
|
+
*
|
|
1281
1287
|
* ⚠️ `cartId` names a specific walk-in ticket; `terminalId` can also resolve
|
|
1282
1288
|
* the till's open walk-in. A walk-in has no `customerId`, so the sparse
|
|
1283
1289
|
* `PK-customerId` lookup cannot find it.
|
package/dist/invoice.d.ts
CHANGED
|
@@ -508,6 +508,12 @@ declare global {
|
|
|
508
508
|
rejectedDets: number;
|
|
509
509
|
codes: number[];
|
|
510
510
|
};
|
|
511
|
+
informConfigRefusal?: {
|
|
512
|
+
code: number;
|
|
513
|
+
ptoVta: number;
|
|
514
|
+
refusedAt: string;
|
|
515
|
+
};
|
|
516
|
+
informOverdueAt?: string;
|
|
511
517
|
}
|
|
512
518
|
/** Result of requesting a new CAEA code for an upcoming period. */
|
|
513
519
|
interface CAEARequestResult {
|
package/dist/order.d.ts
CHANGED
|
@@ -2004,6 +2004,18 @@ declare global {
|
|
|
2004
2004
|
creditOverride?: {
|
|
2005
2005
|
reason: string;
|
|
2006
2006
|
};
|
|
2007
|
+
/**
|
|
2008
|
+
* The sale's whole charged total goes on the customer's account (a till's
|
|
2009
|
+
* "cuenta corriente" sale). Create only; never beside `tenders`.
|
|
2010
|
+
*
|
|
2011
|
+
* It is a credit directive, not a payment. It adds no tender leg, so
|
|
2012
|
+
* `amountPaid` / `financialStatus` stay those of an unpaid order. It books no
|
|
2013
|
+
* receivable either: the caller still records that through `POST /account`.
|
|
2014
|
+
* What it buys is the create's {@link Order.creditWarning}, computed from the
|
|
2015
|
+
* order total against the customer's ledger balance, and the ledger figures
|
|
2016
|
+
* on a {@link Order.creditOverride} sent with it.
|
|
2017
|
+
*/
|
|
2018
|
+
onAccount?: boolean;
|
|
2007
2019
|
/**
|
|
2008
2020
|
* Tender legs to ring against this order, as RAW input — NOT the persisted
|
|
2009
2021
|
* `Order.tenders`, which is why `Partial<Order>` is narrowed with `Omit`
|