sinfactura-types 1.10.356 → 1.10.359
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 +14 -1
- package/dist/afip.d.ts +31 -0
- package/dist/auth.d.ts +14 -1
- package/dist/cjs/storefrontEvent.js +4 -4
- package/dist/customer.d.ts +35 -1
- package/dist/print.d.ts +22 -3
- package/dist/report.d.ts +222 -0
- package/dist/serviceOrder.d.ts +11 -0
- package/dist/store.d.ts +20 -11
- package/dist/storefrontEvent.d.ts +7 -1
- package/dist/storefrontEvent.js +4 -4
- package/dist/userActivity.d.ts +16 -1
- package/package.json +1 -1
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
|
-
/**
|
|
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;
|
package/dist/afip.d.ts
CHANGED
|
@@ -111,5 +111,36 @@ declare global {
|
|
|
111
111
|
lastSuccessAt?: number;
|
|
112
112
|
fetchedAt: number;
|
|
113
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Why `POST /afip {mode: upload}` refused an AFIP certificate or private key.
|
|
116
|
+
*
|
|
117
|
+
* A CLOSED vocabulary the FE maps to copy, so it is published rather than
|
|
118
|
+
* left as a `string`. Every member arrives as a `400` with the code in
|
|
119
|
+
* `error` and Spanish copy in `message`; none of them carries a CUIT value
|
|
120
|
+
* or a PEM byte (Ley 25.326), so the code is all an FE has to branch on.
|
|
121
|
+
*
|
|
122
|
+
* ⚠️ `AFIP_CERT_CUIT_MISSING` / `_UNREADABLE` / `_MISMATCH` are the SAME
|
|
123
|
+
* three strings `verifiedAfipCuit` throws at WSAA login time. The upload
|
|
124
|
+
* pre-flight is that check moved to the only moment where the message can
|
|
125
|
+
* name the fix; an FE keyed on the string handles both origins.
|
|
126
|
+
*
|
|
127
|
+
* `AFIP_CERT_NOT_A_CERTIFICATE` — the file is not a parseable X.509 PEM.
|
|
128
|
+
* `AFIP_KEY_NOT_A_PRIVATE_KEY` — the file is not a parseable private key.
|
|
129
|
+
* `AFIP_CERT_CUIT_MISSING` — the store has no `integrations.afip.cuit`
|
|
130
|
+
* to verify the certificate against.
|
|
131
|
+
* `AFIP_CERT_CUIT_UNREADABLE` — the certificate declares no CUIT in its
|
|
132
|
+
* subject `serialNumber` RDN.
|
|
133
|
+
* `AFIP_CERT_CUIT_MISMATCH` — the certificate was issued to a DIFFERENT
|
|
134
|
+
* taxpayer than the store declares.
|
|
135
|
+
* `AFIP_CERT_KEY_MISMATCH` — certificate and stored private key are not
|
|
136
|
+
* one keypair (a re-enrolment against a
|
|
137
|
+
* stale CSR is how they come apart).
|
|
138
|
+
* `AFIP_CERT_EXPIRED` — the certificate's `notAfter` has passed.
|
|
139
|
+
*
|
|
140
|
+
* ⚠️ A FUTURE `notBefore` is deliberately NOT refused: ARCA issues in Buenos
|
|
141
|
+
* Aires local time and a few hours of skew would otherwise refuse a good
|
|
142
|
+
* certificate at the one moment the operator is uploading it.
|
|
143
|
+
*/
|
|
144
|
+
type AfipCertUploadErrorCode = 'AFIP_CERT_NOT_A_CERTIFICATE' | 'AFIP_KEY_NOT_A_PRIVATE_KEY' | 'AFIP_CERT_CUIT_MISSING' | 'AFIP_CERT_CUIT_UNREADABLE' | 'AFIP_CERT_CUIT_MISMATCH' | 'AFIP_CERT_KEY_MISMATCH' | 'AFIP_CERT_EXPIRED';
|
|
114
145
|
}
|
|
115
146
|
export {};
|
package/dist/auth.d.ts
CHANGED
|
@@ -454,8 +454,21 @@ declare global {
|
|
|
454
454
|
* — the mandate is scoped to operator surfaces, and there is no customer
|
|
455
455
|
* enrolment endpoint for a web mandate to be satisfiable against, so a
|
|
456
456
|
* `kind: 'CUSTOMER'` row can never carry it.
|
|
457
|
+
* - `role_not_allowed` — the credentials were correct and the account is
|
|
458
|
+
* enabled, but the ROLE it carries is not admitted at the door it knocked
|
|
459
|
+
* on. ⚠️ A property of the DOOR, not of the account, which is what makes it
|
|
460
|
+
* different from `disabled`: the same row may be refused here and sign in
|
|
461
|
+
* successfully at another mode, so it must never be rendered as "this
|
|
462
|
+
* account is blocked". Emitted by `login`, `social`, `magic-link-verify`
|
|
463
|
+
* and `printer`.
|
|
457
464
|
*/
|
|
458
|
-
type LoginOutcome = 'success' | 'wrong_password' | 'disabled' | 'blocked' | 'requires_2fa' | 'wrong_totp' | 'totp_replay' | 'totp_locked' | 'enrollment_required'
|
|
465
|
+
type LoginOutcome = 'success' | 'wrong_password' | 'disabled' | 'blocked' | 'requires_2fa' | 'wrong_totp' | 'totp_replay' | 'totp_locked' | 'enrollment_required'
|
|
466
|
+
/**
|
|
467
|
+
* See the list above. Forward-only like every other value — rows written
|
|
468
|
+
* before it existed carry nothing, and an EMPTY history is still never
|
|
469
|
+
* proof that nothing was attempted.
|
|
470
|
+
*/
|
|
471
|
+
| 'role_not_allowed';
|
|
459
472
|
/**
|
|
460
473
|
* One row of `GET /auth?mode=login-history[&days=N]` — a storefront
|
|
461
474
|
* customer's own login audit trail. The stored row reaches the wire
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
// for event names; snake_case for properties so the GA4 / Segment
|
|
10
10
|
// vocabulary on the wire maps without translation.
|
|
11
11
|
//
|
|
12
|
-
//
|
|
13
|
-
// `
|
|
14
|
-
//
|
|
15
|
-
//
|
|
12
|
+
// 22 variants — the 3 storefront-only events (`Page Viewed`,
|
|
13
|
+
// `Whatsapp Clicked`, `Error Captured`) currently emitted by storefront
|
|
14
|
+
// are NOT in this taxonomy yet; they ride the legacy `Log` path and are
|
|
15
|
+
// tracked for a follow-up types release.
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/customer.d.ts
CHANGED
|
@@ -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`:
|
package/dist/print.d.ts
CHANGED
|
@@ -249,22 +249,41 @@ declare global {
|
|
|
249
249
|
* so a `register_printers` upsert cannot reset it on every agent restart.
|
|
250
250
|
* Absent means the operator has not declared one — a renderer falls back to
|
|
251
251
|
* its own default rather than guessing from the driver string.
|
|
252
|
+
*
|
|
253
|
+
* **The writer is `POST /print {mode:'printer-profile'}`** (ADMIN;
|
|
254
|
+
* `api/stacks/lambdas/print/_printerProfile.ts` →
|
|
255
|
+
* `services/printers.ts`'s `setPrinterProfile`), and the reader is
|
|
256
|
+
* `api/stacks/helpers/printerRenderHints.ts`. ⚠️ Until that mode landed
|
|
257
|
+
* this docblock described an ownership rule NOTHING implemented, and all
|
|
258
|
+
* four hints resolved their fallback for every printer, permanently.
|
|
259
|
+
*
|
|
260
|
+
* ⚠️ **That write is SUPPLIED-ONLY and there is no clear path.** A request
|
|
261
|
+
* naming one leaf leaves the other three exactly as declared; none of the
|
|
262
|
+
* four can be unset, because "absent" above is defined as never-declared
|
|
263
|
+
* rather than as a value. This is deliberately unlike `rawFormats`, where
|
|
264
|
+
* `[]` IS a documented clear.
|
|
252
265
|
*/
|
|
253
266
|
columns?: number;
|
|
254
267
|
/**
|
|
255
268
|
* Which image command this device renders correctly. Operator-declared and
|
|
256
|
-
* BE-owned — same ownership rule as `columns
|
|
269
|
+
* BE-owned — same ownership rule as `columns`, same writer
|
|
270
|
+
* (`POST /print {mode:'printer-profile'}`), same supplied-only, no-clear
|
|
271
|
+
* semantics.
|
|
257
272
|
*/
|
|
258
273
|
imageMode?: 'raster' | 'column';
|
|
259
274
|
/**
|
|
260
275
|
* Which QR command this device renders correctly: `native` = the device's
|
|
261
276
|
* own QR command set, `raster` = send it as an image. Operator-declared and
|
|
262
|
-
* BE-owned — same ownership rule as `columns
|
|
277
|
+
* BE-owned — same ownership rule as `columns`, same writer
|
|
278
|
+
* (`POST /print {mode:'printer-profile'}`), same supplied-only, no-clear
|
|
279
|
+
* semantics.
|
|
263
280
|
*/
|
|
264
281
|
qrMode?: 'native' | 'raster';
|
|
265
282
|
/**
|
|
266
283
|
* Append a cash-drawer pulse to receipt jobs. Operator-declared and BE-owned
|
|
267
|
-
* — same ownership rule as `columns
|
|
284
|
+
* — same ownership rule as `columns`, same writer
|
|
285
|
+
* (`POST /print {mode:'printer-profile'}`), same supplied-only, no-clear
|
|
286
|
+
* semantics.
|
|
268
287
|
*/
|
|
269
288
|
drawerKick?: boolean;
|
|
270
289
|
/** ms epoch of the last `register_printers` report that included this printer. */
|
package/dist/report.d.ts
CHANGED
|
@@ -598,5 +598,227 @@ declare global {
|
|
|
598
598
|
*/
|
|
599
599
|
mixedCurrency: boolean;
|
|
600
600
|
}
|
|
601
|
+
/**
|
|
602
|
+
* ONE Buenos Aires day of `GET /reports?mode=cogs-series` — the COGS and
|
|
603
|
+
* gross-margin NUMERATOR published on the same terms as
|
|
604
|
+
* {@link InventoryValueSeries}, which is the denominator.
|
|
605
|
+
*
|
|
606
|
+
* ## Attribution, stated so a consumer never has to guess
|
|
607
|
+
*
|
|
608
|
+
* `date` is the order's **`deliveredDate`**, a Buenos Aires business day.
|
|
609
|
+
* Returns are attributed to the return's OWN `dated` — the day it was
|
|
610
|
+
* PROCESSED, never the originating order's delivery — so a December order
|
|
611
|
+
* returned in January credits January. That is the identical rule
|
|
612
|
+
* {@link ReportSales} applies, through the identical predicate.
|
|
613
|
+
*
|
|
614
|
+
* ⚠️ **The inventory-value series is a SNAPSHOT that OPENS a day, not a day's
|
|
615
|
+
* average.** Its nightly job runs just after the 03:00 UTC Buenos Aires day
|
|
616
|
+
* roll, so the point labelled `D` is the valuation day `D` opens with. A day
|
|
617
|
+
* of COGS is therefore consumed out of inventory held BETWEEN the snapshot of
|
|
618
|
+
* `D` and the snapshot of `D + 1`, and the SANCTIONED pairing — the one this
|
|
619
|
+
* contract commits to, so the app does not have to invent one — is their mean:
|
|
620
|
+
*
|
|
621
|
+
* ```text
|
|
622
|
+
* averageInventory(from..to) = mean(value[from] … value[to + 1])
|
|
623
|
+
* turnover = summary.cogs / averageInventory
|
|
624
|
+
* DSI = summary.days / turnover
|
|
625
|
+
* GMROI = summary.grossMargin / averageInventory
|
|
626
|
+
* ```
|
|
627
|
+
*
|
|
628
|
+
* ⚠️ **`to + 1` is not optional.** Averaging `from..to` alone pairs a period's
|
|
629
|
+
* COGS with an inventory window that closes a day early: turnover reads high
|
|
630
|
+
* for a store drawing stock down and low for one stocking up. If the snapshot
|
|
631
|
+
* for `to + 1` is ABSENT from the series (the job missed that night, or `to`
|
|
632
|
+
* is today and tomorrow has not opened), the ratio is not available — the
|
|
633
|
+
* series never interpolates and neither may a consumer.
|
|
634
|
+
*
|
|
635
|
+
* ⚠️ **A ratio is only as good as the weaker side.** `complete` here and
|
|
636
|
+
* {@link InventoryValuePoint.complete} there must BOTH be true before a
|
|
637
|
+
* turnover, DSI or GMROI may be presented as a fact; otherwise it is a floor
|
|
638
|
+
* and must be labelled one.
|
|
639
|
+
*
|
|
640
|
+
* ## Floors
|
|
641
|
+
*
|
|
642
|
+
* Every money figure below EXCLUDES two populations rather than guessing at
|
|
643
|
+
* them, each counted beside the figure it is missing from:
|
|
644
|
+
*
|
|
645
|
+
* - orders whose `Order.cost` is absent — absence means WITHHELD or UNKNOWN
|
|
646
|
+
* and never `0`, so summing them would report 100 % margin;
|
|
647
|
+
* - orders this store holds no trustworthy rate for, or that carry no
|
|
648
|
+
* denomination at all.
|
|
649
|
+
*
|
|
650
|
+
* ⚠️ Every field is emitted on EVERY row, `0` included — a `0` is the positive
|
|
651
|
+
* statement that nothing was left out.
|
|
652
|
+
*/
|
|
653
|
+
interface ReportCogsSeriesPoint {
|
|
654
|
+
/** `YYYYMMDD` as a NUMBER, Buenos Aires. */
|
|
655
|
+
date: number;
|
|
656
|
+
/**
|
|
657
|
+
* COGS of this day, NET of the COSTED returns and FX-converted into
|
|
658
|
+
* `currency`: `Σ Order.cost of costed, convertible orders − Σ Return.cost
|
|
659
|
+
* of costed returns`. The gross half is `cogs + returnCost`.
|
|
660
|
+
*
|
|
661
|
+
* ⚠️ A FLOOR whenever `complete` is `false`.
|
|
662
|
+
*/
|
|
663
|
+
cogs: number;
|
|
664
|
+
/**
|
|
665
|
+
* The **cost-comparable** revenue base, net of the COSTED returns:
|
|
666
|
+
* `Σ Order.total of the SAME costed, convertible orders − (returns −
|
|
667
|
+
* uncostedReturns)`.
|
|
668
|
+
*
|
|
669
|
+
* ⚠️ This is deliberately NOT a gross `total`. An uncosted order's revenue
|
|
670
|
+
* is real but has no COGS to sit against, so it is excluded here and
|
|
671
|
+
* reported in `uncostedTotal` — the published rule that `total − cost` is
|
|
672
|
+
* not margin, applied at the source instead of left to the caller.
|
|
673
|
+
*
|
|
674
|
+
* ⚠️ **And it is deliberately net of only HALF the returns, which is where
|
|
675
|
+
* this departs from {@link ReportSales}.** `Return.cost` is withheld
|
|
676
|
+
* exactly when the originating `Order.cost` is, so an uncosted return is
|
|
677
|
+
* the return of an order whose revenue never entered this figure.
|
|
678
|
+
* Subtracting it would drive a day of purely uncosted trade to a negative
|
|
679
|
+
* revenue out of nothing — one uncosted order of 500 with a 200 return
|
|
680
|
+
* would read `-200`. `ReportSales` nets every return because its `total` is
|
|
681
|
+
* GROSS; this one cannot. The credit is not lost: it is in `returns` /
|
|
682
|
+
* `uncostedReturns` / `uncostedReturnCount`.
|
|
683
|
+
*/
|
|
684
|
+
revenue: number;
|
|
685
|
+
/** `revenue − cogs`. The GMROI numerator. */
|
|
686
|
+
grossMargin: number;
|
|
687
|
+
/** Delivered orders on this day that carried a cost AND could be converted. */
|
|
688
|
+
costedOrders: number;
|
|
689
|
+
/** Delivered orders excluded from `cogs`/`revenue` for carrying no `Order.cost`. */
|
|
690
|
+
uncostedOrders: number;
|
|
691
|
+
/** Converted revenue of those uncosted orders — what `revenue` deliberately omits. */
|
|
692
|
+
uncostedTotal: number;
|
|
693
|
+
/**
|
|
694
|
+
* Delivered orders excluded from EVERY figure because their denomination
|
|
695
|
+
* could not be trusted. A count, matching
|
|
696
|
+
* {@link InventoryValuePoint.unconvertedProducts}'s shape; the
|
|
697
|
+
* denominations behind it are named once, window-wide, in
|
|
698
|
+
* {@link ReportCogsSeries.unconvertedCurrencies}.
|
|
699
|
+
*/
|
|
700
|
+
unconvertedOrders: number;
|
|
701
|
+
/**
|
|
702
|
+
* Positive magnitude of returns credited on this day — every return,
|
|
703
|
+
* costed or not. Only the COSTED half reaches `revenue`.
|
|
704
|
+
*
|
|
705
|
+
* ⚠️ Taken at FACE VALUE in `currency` and NOT FX-converted: a `Return`
|
|
706
|
+
* row carries no denomination and no rate, so there is nothing to convert
|
|
707
|
+
* with and inventing a rate would be a second source of truth for the same
|
|
708
|
+
* money.
|
|
709
|
+
*
|
|
710
|
+
* ⚠️ **The flag for that is `faceValueReturns`, NOT `mixedCurrency`.**
|
|
711
|
+
* `mixedCurrency` only ever fires when the STORE changed its display
|
|
712
|
+
* currency; a store that has always displayed pesos while selling in
|
|
713
|
+
* dollars never trips it, and every one of its returns is nonetheless
|
|
714
|
+
* being read in a denomination nobody recorded.
|
|
715
|
+
*/
|
|
716
|
+
returns: number;
|
|
717
|
+
/** Positive magnitude of COGS reversed by the COSTED returns among them. */
|
|
718
|
+
returnCost: number;
|
|
719
|
+
/**
|
|
720
|
+
* Returns that reversed NO cost, and their credit.
|
|
721
|
+
*
|
|
722
|
+
* ⚠️ An uncosted return credits revenue (the credit is known) and reverses
|
|
723
|
+
* nothing (its COGS is not), so this day's margin is understated by exactly
|
|
724
|
+
* the COGS of those goods. The identical disposition {@link ReportSales}
|
|
725
|
+
* gives the same case.
|
|
726
|
+
*/
|
|
727
|
+
uncostedReturnCount: number;
|
|
728
|
+
uncostedReturns: number;
|
|
729
|
+
/**
|
|
730
|
+
* Returns on this day whose denomination cannot be certified, because the
|
|
731
|
+
* day carried at least one order that was not natively in `currency`
|
|
732
|
+
* (converted or not). Their `total` is read at face value in `currency`.
|
|
733
|
+
*
|
|
734
|
+
* ⚠️ **Conservative and DERIVED, not measured.** A `Return` row carries no
|
|
735
|
+
* denomination and no link this read projects, so the day's ORDERS are the
|
|
736
|
+
* only evidence available: every return on a non-native day is counted,
|
|
737
|
+
* and a day that traded natively throughout counts none. It is therefore
|
|
738
|
+
* an upper bound on the affected population, not an exact one — which is
|
|
739
|
+
* the right direction for a flag whose whole job is to stop a figure being
|
|
740
|
+
* certified.
|
|
741
|
+
*
|
|
742
|
+
* Emitted always, `0` included.
|
|
743
|
+
*/
|
|
744
|
+
faceValueReturns: number;
|
|
745
|
+
/**
|
|
746
|
+
* `uncostedOrders === 0 && unconvertedOrders === 0 && faceValueReturns ===
|
|
747
|
+
* 0` — this row's figures describe the whole day, in one denomination.
|
|
748
|
+
* Derived, never stored.
|
|
749
|
+
*/
|
|
750
|
+
complete: boolean;
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* The window's totals — the EXACT sum of the published `points`, rounded the
|
|
754
|
+
* same way after every addition, so a consumer adding the rows up cannot land
|
|
755
|
+
* a cent away from this.
|
|
756
|
+
*/
|
|
757
|
+
interface ReportCogsSeriesSummary extends Omit<ReportCogsSeriesPoint, 'date'> {
|
|
758
|
+
/** The requested window, inclusive, echoed as resolved (`YYYYMMDD`). */
|
|
759
|
+
from: number;
|
|
760
|
+
to: number;
|
|
761
|
+
/** Calendar days in `[from, to]`, inclusive — the DSI denominator. */
|
|
762
|
+
days: number;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* `GET /reports?mode=cogs-series&from=YYYYMMDD&to=YYYYMMDD` payload —
|
|
766
|
+
* ADMIN/MANAGER, behind `advancedReports`, store-wide.
|
|
767
|
+
*
|
|
768
|
+
* ⚠️ **STORE-WIDE ONLY, no `warehouseId`** — matching
|
|
769
|
+
* {@link InventoryValueSeries} exactly, and for the ratio's sake rather than
|
|
770
|
+
* by imitation: a numerator at one scope over a denominator at another is not
|
|
771
|
+
* a turnover.
|
|
772
|
+
*
|
|
773
|
+
* ⚠️ **`points` is SPARSE.** A day on which nothing was delivered and nothing
|
|
774
|
+
* returned has no row at all. It is not a measured zero; the window bounds are
|
|
775
|
+
* what make the gap readable.
|
|
776
|
+
*
|
|
777
|
+
* ⚠️ **`points`, `summary` and `unconvertedCurrencies` are ABSENT when
|
|
778
|
+
* `truncated`.** A short walk drops whole orders and whole returns, so the
|
|
779
|
+
* figures would be WRONG rather than merely short, and a ratio built on them
|
|
780
|
+
* wrong in a direction nobody can bound. `from`/`to`/`currency` survive, so a
|
|
781
|
+
* partial window can never be read as a total.
|
|
782
|
+
*
|
|
783
|
+
* ⚠️ **The 800-day cap is the WINDOW GRAMMAR, not the read bound**, and the
|
|
784
|
+
* two are independent. The cap exists so this read and
|
|
785
|
+
* {@link InventoryValueSeries} accept the same periods; the walk over orders
|
|
786
|
+
* and returns is bounded separately by the shared `getAll` guard rail. So a
|
|
787
|
+
* busy store CAN ask for a perfectly legal window and receive `truncated:
|
|
788
|
+
* true` with no figures. The remedy is to re-ask over a narrower window —
|
|
789
|
+
* never to read the last un-truncated answer as covering the wider one.
|
|
790
|
+
*/
|
|
791
|
+
interface ReportCogsSeries {
|
|
792
|
+
/** Pinned. The literal exists so a future second scope cannot arrive unannounced. */
|
|
793
|
+
scope: 'store';
|
|
794
|
+
/** The resolved window, echoed on EVERY response including a truncated one. */
|
|
795
|
+
from: number;
|
|
796
|
+
to: number;
|
|
797
|
+
/** The store's display currency — the denomination of every figure below. */
|
|
798
|
+
currency: string;
|
|
799
|
+
/**
|
|
800
|
+
* The store changed its DISPLAY currency inside this window, so the series
|
|
801
|
+
* is not one line and nothing may be divided across the change.
|
|
802
|
+
*
|
|
803
|
+
* ⚠️ Detected exactly as {@link InventoryValueSeries.mixedCurrency} is —
|
|
804
|
+
* from the nightly snapshots' own per-day `currency`, which is the only
|
|
805
|
+
* record of what the display currency WAS on a past day. An order merely
|
|
806
|
+
* denominated in a foreign currency does NOT make a window mixed; that is a
|
|
807
|
+
* conversion, reported through `unconvertedOrders` when it fails. `true`
|
|
808
|
+
* when the snapshot read itself came up short, because a short read may
|
|
809
|
+
* have dropped the very day the denomination moved.
|
|
810
|
+
*/
|
|
811
|
+
mixedCurrency: boolean;
|
|
812
|
+
/** Ascending by `date`, sparse. Absent when the read truncated. */
|
|
813
|
+
points?: ReportCogsSeriesPoint[];
|
|
814
|
+
/** Absent when the read truncated. */
|
|
815
|
+
summary?: ReportCogsSeriesSummary;
|
|
816
|
+
/**
|
|
817
|
+
* The catalog currency ids behind every row's `unconvertedOrders`,
|
|
818
|
+
* ascending; `'unknown'` stands for an order carrying no denomination at
|
|
819
|
+
* all. Empty when nothing was dropped. Absent when the read truncated.
|
|
820
|
+
*/
|
|
821
|
+
unconvertedCurrencies?: string[];
|
|
822
|
+
}
|
|
601
823
|
}
|
|
602
824
|
export {};
|
package/dist/serviceOrder.d.ts
CHANGED
|
@@ -953,6 +953,17 @@ declare global {
|
|
|
953
953
|
* linkage.
|
|
954
954
|
*/
|
|
955
955
|
parentServiceOrderId?: string;
|
|
956
|
+
/**
|
|
957
|
+
* A recorded fact only — nothing branches on it. `POST /services
|
|
958
|
+
* {mode:'create'}` accepts it and stamps it when supplied, and no handler,
|
|
959
|
+
* projection rule or money derivation reads it back.
|
|
960
|
+
*
|
|
961
|
+
* Deliberately independent of `billable`, which is the ONLY field that
|
|
962
|
+
* makes a job free: a rework can be goodwill-billed and a non-rework can be
|
|
963
|
+
* free, so neither implies the other. Kept published rather than removed
|
|
964
|
+
* because it is what an operator answers the art. 23 warranty question
|
|
965
|
+
* with, and a consumer reading the trio needs all three.
|
|
966
|
+
*/
|
|
956
967
|
isWarrantyRework?: boolean;
|
|
957
968
|
/**
|
|
958
969
|
* False on a warranty rework. Absent is treated as billable.
|
package/dist/store.d.ts
CHANGED
|
@@ -533,18 +533,26 @@ declare global {
|
|
|
533
533
|
* parity and compares the DNI/CUIT threshold against an unconverted
|
|
534
534
|
* total.
|
|
535
535
|
*
|
|
536
|
-
* Seed catalogId
|
|
537
|
-
* customer-facing money
|
|
538
|
-
* rows, and — importantly — **does not denominate the Account
|
|
536
|
+
* Seed catalogId an operator declares as the intended currency-selector
|
|
537
|
+
* default for new customer-facing money rows. Does not reinterpret
|
|
538
|
+
* existing rows, and — importantly — **does not denominate the Account
|
|
539
|
+
* ledger.**
|
|
539
540
|
*
|
|
540
541
|
* ⚠️ Read this before treating it as the account currency. `credit`/`debit`
|
|
541
542
|
* on every row of the ACCOUNT partition are denominated in
|
|
542
543
|
* `displayCurrency`, and the backend enforces that: caller-chosen and
|
|
543
544
|
* order-derived amounts alike convert before persisting and refuse with
|
|
544
545
|
* `FX_CONVERSION_UNAVAILABLE` when no usable rate resolves. Nothing on the
|
|
545
|
-
* backend reads this field at all
|
|
546
|
-
*
|
|
547
|
-
*
|
|
546
|
+
* backend reads this field at all.
|
|
547
|
+
*
|
|
548
|
+
* ⚠️ **Nor does any frontend flow consume it as a default today.** This
|
|
549
|
+
* docblock used to say the FE preselects it on customer creation and on
|
|
550
|
+
* the invoice flow; grepping `sinfactura/app` finds its only readers in
|
|
551
|
+
* the store-configuration editor itself (`components/store/`,
|
|
552
|
+
* `screens/supervisor/Store/`) — it is displayed and written there and
|
|
553
|
+
* read nowhere else. So it is, today, a stored operator preference with
|
|
554
|
+
* no consumer: state that rather than a behaviour, and re-grep before
|
|
555
|
+
* quoting either claim.
|
|
548
556
|
*
|
|
549
557
|
* ⚠️ Consequence: setting this to anything other than `displayCurrency`
|
|
550
558
|
* produces customer rows whose stamped currency disagrees with the
|
|
@@ -873,11 +881,12 @@ declare global {
|
|
|
873
881
|
* A tenant may carry both; treat `staticQr` as the legacy default counter.
|
|
874
882
|
*
|
|
875
883
|
* Every field here is server-written by the dedicated POS endpoints, never
|
|
876
|
-
* by a client
|
|
877
|
-
*
|
|
878
|
-
* (`
|
|
879
|
-
*
|
|
880
|
-
*
|
|
884
|
+
* by a client — and that is enforced rather than inherited: the top-level
|
|
885
|
+
* `mercadopago` write vehicle is narrowed to `MP_CLIENT_WRITABLE`
|
|
886
|
+
* (`stacks/helpers/integrationsWrite.ts`, an ALLOW-list), which this key is
|
|
887
|
+
* not on, so every one of the three writers drops it. BOTH `.loose()`
|
|
888
|
+
* pass-throughs additionally delete the whole `integrations` umbrella
|
|
889
|
+
* (`store/_post.ts`, `tenants/_post.ts`).
|
|
881
890
|
*/
|
|
882
891
|
staticQrs?: Record<string, MercadopagoStaticQr>;
|
|
883
892
|
lastMovementCheckpoint?: number;
|
|
@@ -163,6 +163,12 @@ declare global {
|
|
|
163
163
|
event: 'Customer Password Changed';
|
|
164
164
|
customer_id: string;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
interface FavoriteToggledEvent extends StorefrontEventBase {
|
|
167
|
+
event: 'Favorite Toggled';
|
|
168
|
+
product_id: string;
|
|
169
|
+
product_name: string;
|
|
170
|
+
direction: 'added' | 'removed';
|
|
171
|
+
}
|
|
172
|
+
type StorefrontEvent = ProductViewedEvent | ProductListViewedEvent | CartItemAddedEvent | CartItemRemovedEvent | CartViewedEvent | SearchSubmittedEvent | CheckoutStartedEvent | CheckoutStepCompletedEvent | PaymentInfoEnteredEvent | OrderCompletedEvent | OrderCancelledByCustomerEvent | CustomerLoggedInEvent | CustomerSignedUpEvent | CustomerLoggedOutEvent | CustomerIdentifiedEvent | CustomerPasswordResetRequestedEvent | NotificationMarkedReadEvent | NotificationsMarkedAllReadEvent | SurveySubmittedEvent | CustomerProfileUpdatedEvent | CustomerPasswordChangedEvent | FavoriteToggledEvent;
|
|
167
173
|
}
|
|
168
174
|
export {};
|
package/dist/storefrontEvent.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// for event names; snake_case for properties so the GA4 / Segment
|
|
9
9
|
// vocabulary on the wire maps without translation.
|
|
10
10
|
//
|
|
11
|
-
//
|
|
12
|
-
// `
|
|
13
|
-
//
|
|
14
|
-
//
|
|
11
|
+
// 22 variants — the 3 storefront-only events (`Page Viewed`,
|
|
12
|
+
// `Whatsapp Clicked`, `Error Captured`) currently emitted by storefront
|
|
13
|
+
// are NOT in this taxonomy yet; they ride the legacy `Log` path and are
|
|
14
|
+
// tracked for a follow-up types release.
|
|
15
15
|
export {};
|
package/dist/userActivity.d.ts
CHANGED
|
@@ -944,6 +944,21 @@ declare global {
|
|
|
944
944
|
printer_id: string;
|
|
945
945
|
raw_formats: ('zpl' | 'escpos')[];
|
|
946
946
|
}
|
|
947
|
+
/**
|
|
948
|
+
* Sibling of `PrinterRawFormatsUpdatedEvent` for `POST /print
|
|
949
|
+
* {mode:'printer-profile'}` — the operator-declared render hints
|
|
950
|
+
* (`PrintPrinter.columns/imageMode/qrMode/drawerKick`). Carries ONLY the
|
|
951
|
+
* leaves the request supplied; an absent key was not touched, never cleared.
|
|
952
|
+
*/
|
|
953
|
+
interface PrinterProfileUpdatedEvent extends UserActivityEventBase {
|
|
954
|
+
event: 'Printer Profile Updated';
|
|
955
|
+
agent_id: string;
|
|
956
|
+
printer_id: string;
|
|
957
|
+
columns?: number;
|
|
958
|
+
image_mode?: 'raster' | 'column';
|
|
959
|
+
qr_mode?: 'native' | 'raster';
|
|
960
|
+
drawer_kick?: boolean;
|
|
961
|
+
}
|
|
947
962
|
/**
|
|
948
963
|
* A MANAGER edit to a PLAN TEMPLATE's own fields via
|
|
949
964
|
* `PATCH /platform/billing/plans/{tier}` — the catalog row, not anybody's
|
|
@@ -1030,7 +1045,7 @@ declare global {
|
|
|
1030
1045
|
carrier?: string;
|
|
1031
1046
|
tracking_set: boolean;
|
|
1032
1047
|
}
|
|
1033
|
-
type UserActivityEvent = CustomerConsentImportedEvent | CustomerConsentImportCompletedEvent | UserLoggedInEvent | UserLoggedOutEvent | UserPasswordChangedEvent | UserSuspendedEvent | TwoFactorEnrolledEvent | TwoFactorDisabledEvent | TwoFactorResetEvent | TwoFactorRecoveryCodesGeneratedEvent | StoreSettingsUpdatedEvent | PlanChangedEvent | InvoiceCreatedEvent | OrderCreatedEvent | OrderCancelledEvent | OrderEditedEvent | OrderReturnedEvent | ProductPriceChangedEvent | CustomerCreatedEvent | CustomerEditedEvent | CustomerRecordServedEvent | CashDrawerOpenedEvent | CashDrawerClosedEvent | TenantImpersonatedEvent | SecretRotatedEvent | UserCreatedEvent | UserUpdatedEvent | ProductCreatedEvent | ProductUpdatedEvent | StockIncomeCreatedEvent | StockAdjustedEvent | CategoryCreatedEvent | CategoryUpdatedEvent | BrandCreatedEvent | BrandUpdatedEvent | SupplierCreatedEvent | SupplierUpdatedEvent | SupplierInvoiceCreatedEvent | SupplierAccountCreatedEvent | SupplierAccountUpdatedEvent | AccountCreatedEvent | AccountDeletedEvent | BasketUpdatedEvent | BasketDiscountGrantedEvent | BasketDeletedEvent | CashDrawerMovementEvent | PaymentCreatedEvent | PaymentLinkedEvent | PaymentUnlinkedEvent | PaymentLinkageUpdatedEvent | CreditLimitOverriddenEvent | NotificationReadEvent | LogDeletedEvent | PlanCreatedEvent | StoreMaintenanceToggledEvent | PlatformMaintenanceToggledEvent | MaintenanceBroadcastSentEvent | TenantCreatedEvent | LiteralUpdatedEvent | SupportTicketCreatedEvent | SupportTicketUpdatedEvent | AuditTrailViewedEvent | ReportViewedEvent | CustomerPiiViewedEvent | CashDrawerUiOpenedEvent | CashDrawerUiClosedEvent | ExportInitiatedEvent | ImpersonationUiStartedEvent | ImpersonationUiEndedEvent | PaymentViewedEvent | InvoiceViewedEvent | CustomerDetailViewedEvent | SupplierAccountViewedEvent | SearchPerformedEvent | ActionDeniedEvent | TwoFactorChallengeShownEvent | TwoFactorCodeValidationFailedEvent | TwoFactorEnrollmentStartedEvent | TwoFactorRecoveryCodesRevealedEvent | TwoFactorResetInitiatedEvent | IntegrationTokenRefreshedEvent | WaitlistConvertedEvent | PlatformConfigUpdatedEvent | MlChannelStatusChangedEvent | PrintRuleCreatedEvent | PrintRuleEditedEvent | PrintRuleDeletedEvent | WebhookCreatedEvent | WebhookUpdatedEvent | WebhookDeletedEvent | PrinterActiveToggledEvent | PrinterRawFormatsUpdatedEvent | PlanTemplateUpdatedEvent | SupplierAccountDeletedEvent | CustomerPasswordResetInitiatedEvent | UserSessionsRevokedEvent | UserAnonymizedEvent | UserPasswordResetInitiatedByOperatorEvent | AgentCommandDispatchedEvent | RmaRequestedEvent | RmaTransitionedEvent | RmaTrackingUpdatedEvent | ClockedInEvent | ClockedOutEvent | AttendanceCorrectedEvent;
|
|
1048
|
+
type UserActivityEvent = CustomerConsentImportedEvent | CustomerConsentImportCompletedEvent | UserLoggedInEvent | UserLoggedOutEvent | UserPasswordChangedEvent | UserSuspendedEvent | TwoFactorEnrolledEvent | TwoFactorDisabledEvent | TwoFactorResetEvent | TwoFactorRecoveryCodesGeneratedEvent | StoreSettingsUpdatedEvent | PlanChangedEvent | InvoiceCreatedEvent | OrderCreatedEvent | OrderCancelledEvent | OrderEditedEvent | OrderReturnedEvent | ProductPriceChangedEvent | CustomerCreatedEvent | CustomerEditedEvent | CustomerRecordServedEvent | CashDrawerOpenedEvent | CashDrawerClosedEvent | TenantImpersonatedEvent | SecretRotatedEvent | UserCreatedEvent | UserUpdatedEvent | ProductCreatedEvent | ProductUpdatedEvent | StockIncomeCreatedEvent | StockAdjustedEvent | CategoryCreatedEvent | CategoryUpdatedEvent | BrandCreatedEvent | BrandUpdatedEvent | SupplierCreatedEvent | SupplierUpdatedEvent | SupplierInvoiceCreatedEvent | SupplierAccountCreatedEvent | SupplierAccountUpdatedEvent | AccountCreatedEvent | AccountDeletedEvent | BasketUpdatedEvent | BasketDiscountGrantedEvent | BasketDeletedEvent | CashDrawerMovementEvent | PaymentCreatedEvent | PaymentLinkedEvent | PaymentUnlinkedEvent | PaymentLinkageUpdatedEvent | CreditLimitOverriddenEvent | NotificationReadEvent | LogDeletedEvent | PlanCreatedEvent | StoreMaintenanceToggledEvent | PlatformMaintenanceToggledEvent | MaintenanceBroadcastSentEvent | TenantCreatedEvent | LiteralUpdatedEvent | SupportTicketCreatedEvent | SupportTicketUpdatedEvent | AuditTrailViewedEvent | ReportViewedEvent | CustomerPiiViewedEvent | CashDrawerUiOpenedEvent | CashDrawerUiClosedEvent | ExportInitiatedEvent | ImpersonationUiStartedEvent | ImpersonationUiEndedEvent | PaymentViewedEvent | InvoiceViewedEvent | CustomerDetailViewedEvent | SupplierAccountViewedEvent | SearchPerformedEvent | ActionDeniedEvent | TwoFactorChallengeShownEvent | TwoFactorCodeValidationFailedEvent | TwoFactorEnrollmentStartedEvent | TwoFactorRecoveryCodesRevealedEvent | TwoFactorResetInitiatedEvent | IntegrationTokenRefreshedEvent | WaitlistConvertedEvent | PlatformConfigUpdatedEvent | MlChannelStatusChangedEvent | PrintRuleCreatedEvent | PrintRuleEditedEvent | PrintRuleDeletedEvent | WebhookCreatedEvent | WebhookUpdatedEvent | WebhookDeletedEvent | PrinterActiveToggledEvent | PrinterRawFormatsUpdatedEvent | PrinterProfileUpdatedEvent | PlanTemplateUpdatedEvent | SupplierAccountDeletedEvent | CustomerPasswordResetInitiatedEvent | UserSessionsRevokedEvent | UserAnonymizedEvent | UserPasswordResetInitiatedByOperatorEvent | AgentCommandDispatchedEvent | RmaRequestedEvent | RmaTransitionedEvent | RmaTrackingUpdatedEvent | ClockedInEvent | ClockedOutEvent | AttendanceCorrectedEvent;
|
|
1034
1049
|
}
|
|
1035
1050
|
/**
|
|
1036
1051
|
* Canonical whitelist of UI-only `UserActivityEvent` variant names. Imported by
|