platform-types 1.10.713 → 1.10.714

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INVOICE_POST_VOUCHER_ERROR_CODES = void 0;
3
+ exports.INVOICE_ISSUANCE_REFUSAL_RECOVERY = exports.INVOICE_ISSUANCE_REFUSAL_CODES = exports.INVOICE_POST_VOUCHER_ERROR_CODES = void 0;
4
4
  /**
5
5
  * The codes `POST /invoices` answers AFTER a voucher number was spent — ARCA
6
6
  * was asked, or a CAEA number was claimed — as a runtime value the app maps.
@@ -32,3 +32,44 @@ exports.INVOICE_POST_VOUCHER_ERROR_CODES = [
32
32
  'INVOICE_EXPORT_OUTCOME_UNKNOWN',
33
33
  'CAEA_COMMIT_FAILED_AFTER_CLAIM',
34
34
  ];
35
+ /**
36
+ * The codes `POST /invoices` answers when it REFUSED to start an issuance — or
37
+ * could not confirm it — before any voucher of this request was recorded, as a
38
+ * runtime value a client maps. Distinct from
39
+ * {@link INVOICE_POST_VOUCHER_ERROR_CODES}: each has its own recovery, given by
40
+ * {@link INVOICE_ISSUANCE_REFUSAL_RECOVERY}.
41
+ *
42
+ * - `INVOICE_ISSUANCE_IN_PROGRESS` · 409 — another issuance of this order is
43
+ * live: the same request's idempotency lock, or another request holding the
44
+ * order's factura issuance guard inside its horizon. Also answered after the
45
+ * order read, when the guard's owner-conditioned pre-ARCA mark or attempt
46
+ * record finds the guard taken over by a successor — before that request's
47
+ * submit went on the wire, so it spent nothing. Retry the same body shortly.
48
+ * - `CAEA_CLAIM_AMBIGUOUS` · 503 — ARCA was down and the CAEA number claim could
49
+ * not be confirmed: the claim may have landed (an operator row records it), no
50
+ * invoice was recorded and nothing was sent to ARCA, and the request released
51
+ * its idempotency record. Retry the same body shortly — a retry claims again,
52
+ * so the worst case is one unused CAEA number, never a second voucher.
53
+ * - `INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH` · 409 — the request's key is bound to
54
+ * an issuance with a different voucher-shaping body (or to a record from
55
+ * before payload hashing, which matches nothing). It does NOT say a voucher
56
+ * exists on the order. Resend only the body that was issued, or credit the
57
+ * voucher first.
58
+ * - `INVOICE_ISSUANCE_OUTCOME_UNCERTAIN` · 409 — an earlier factura of this
59
+ * order was interrupted once it may have spent a voucher number, with no
60
+ * recorded outcome. `data`
61
+ * is {@link InvoiceIssuanceOutcomeUncertainErrorData}. Never retry; support
62
+ * reconciles.
63
+ */
64
+ exports.INVOICE_ISSUANCE_REFUSAL_CODES = [
65
+ 'INVOICE_ISSUANCE_IN_PROGRESS',
66
+ 'CAEA_CLAIM_AMBIGUOUS',
67
+ 'INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH',
68
+ 'INVOICE_ISSUANCE_OUTCOME_UNCERTAIN',
69
+ ];
70
+ exports.INVOICE_ISSUANCE_REFUSAL_RECOVERY = {
71
+ INVOICE_ISSUANCE_IN_PROGRESS: 'retry',
72
+ CAEA_CLAIM_AMBIGUOUS: 'retry',
73
+ INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH: 'resend-issued-body',
74
+ INVOICE_ISSUANCE_OUTCOME_UNCERTAIN: 'reconcile',
75
+ };
package/dist/invoice.d.ts CHANGED
@@ -837,6 +837,86 @@ declare global {
837
837
  /** The fortnight's CAEA code the number was claimed under. */
838
838
  CAEA: string;
839
839
  }
840
+ /**
841
+ * `data` of a `409 INVOICE_ISSUANCE_OUTCOME_UNCERTAIN` answer from
842
+ * `POST /invoices` (a factura): an earlier issuance of this order was
843
+ * interrupted once it may have spent a voucher number — a live or WSFEX
844
+ * submit was recorded, or the outage path (a CAEA stamp or a `pending_cae`
845
+ * degrade) began — and the server holds no evidence of its outcome: the
846
+ * order's `invoices[]` does not name the recorded invoice and no
847
+ * stranded-voucher row names it. ARCA may hold a voucher for it, or may hold
848
+ * nothing.
849
+ *
850
+ * ⚠️ **Never retry, and never resend the original body as proof.** An
851
+ * unchanged body, a refetched order with no voucher and an elapsed lock are
852
+ * not evidence the earlier attempt spent nothing. The order stays fenced
853
+ * until support reconciles the attempt at ARCA and releases it.
854
+ */
855
+ interface InvoiceIssuanceOutcomeUncertainErrorData {
856
+ orderId: string;
857
+ /** The server's id for the interrupted invoice. No order entry names it. */
858
+ invoiceId?: string;
859
+ /**
860
+ * How the interrupted attempt reached ARCA: `cae` (live FECAESolicitar),
861
+ * `export` (WSFEX FEXAuthorize) or `outage` (a CAEA stamp or a
862
+ * `pending_cae` degrade). Written with `invoiceId` and `submittedAt` by
863
+ * the same mark, so absent only on a row edited by hand.
864
+ */
865
+ path?: 'cae' | 'export' | 'outage';
866
+ /** Epoch ms the interrupted attempt was cleared to contact ARCA. */
867
+ submittedAt?: number;
868
+ /**
869
+ * The voucher the interrupted attempt spent or was about to spend. A
870
+ * `cae`/`export` answer always carries it — such a row with no recorded
871
+ * voucher proves no submit went out and is never refused. On `outage` it
872
+ * is the claimed CAEA number (`kind: 'caea'`) when that best-effort
873
+ * record landed, or a live submit's voucher (`kind: 'arca'`) when the
874
+ * outage branch fell through to it; absent, it proves nothing.
875
+ */
876
+ voucher?: {
877
+ /** `arca` — submitted to ARCA (CAE or WSFEX); `caea` — a claimed CAEA number. */
878
+ kind: 'arca' | 'caea';
879
+ /** ARCA `CbteTipo` — the voucher class. */
880
+ CbteTipo: number;
881
+ /** ARCA `PtoVta` — the punto de venta it went out under. */
882
+ PtoVta: number;
883
+ /** ARCA `CbteNro` — the number ARCA may or may not hold. */
884
+ CbteNro: number;
885
+ /**
886
+ * The submitted voucher's `CbteFch` (`yyyymmdd`), when the attempt
887
+ * recorded one. `fingerprintMatches` compares it too: a voucher found
888
+ * at the number under another date is not this one.
889
+ */
890
+ CbteFch?: string;
891
+ /**
892
+ * A live `FECAESolicitar` attempt's identifying fields, as submitted —
893
+ * compare a `FECompConsultar` answer at the number against these, never
894
+ * against a rebuild from the order. The receptor's `DocNro` is withheld:
895
+ * compare it against the order's `invoiceMethod`. Absent on a CAEA claim,
896
+ * a WSFEX attempt, and an attempt recorded before it was stored.
897
+ */
898
+ fingerprint?: InvoiceIssuanceAttemptFingerprint;
899
+ };
900
+ }
901
+ /**
902
+ * The fields `FECompConsultar` echoes that identify a submitted voucher, as
903
+ * the interrupted attempt sent them, minus the receptor's `DocNro` and the
904
+ * date (`CbteFch`, beside it). Amounts are in the voucher currency (`MonId`).
905
+ */
906
+ interface InvoiceIssuanceAttemptFingerprint {
907
+ /** ARCA `DocTipo` — the receptor's document type. */
908
+ DocTipo: number;
909
+ /** ARCA `MonId` — the voucher currency code. */
910
+ MonId: string;
911
+ /** ARCA `MonCotiz` — the rate the voucher was submitted at. */
912
+ MonCotiz: number;
913
+ ImpTotal: number;
914
+ ImpNeto: number;
915
+ ImpIVA: number;
916
+ ImpTotConc: number;
917
+ ImpOpEx: number;
918
+ ImpTrib: number;
919
+ }
840
920
  }
841
921
  /**
842
922
  * The codes `POST /invoices` answers AFTER a voucher number was spent — ARCA
@@ -866,4 +946,50 @@ declare global {
866
946
  */
867
947
  export declare const INVOICE_POST_VOUCHER_ERROR_CODES: readonly ["INVOICE_PERSIST_AFTER_CAE_FAILED", "INVOICE_EXPORT_OUTCOME_UNKNOWN", "CAEA_COMMIT_FAILED_AFTER_CLAIM"];
868
948
  export type InvoicePostVoucherErrorCode = (typeof INVOICE_POST_VOUCHER_ERROR_CODES)[number];
949
+ /**
950
+ * The codes `POST /invoices` answers when it REFUSED to start an issuance — or
951
+ * could not confirm it — before any voucher of this request was recorded, as a
952
+ * runtime value a client maps. Distinct from
953
+ * {@link INVOICE_POST_VOUCHER_ERROR_CODES}: each has its own recovery, given by
954
+ * {@link INVOICE_ISSUANCE_REFUSAL_RECOVERY}.
955
+ *
956
+ * - `INVOICE_ISSUANCE_IN_PROGRESS` · 409 — another issuance of this order is
957
+ * live: the same request's idempotency lock, or another request holding the
958
+ * order's factura issuance guard inside its horizon. Also answered after the
959
+ * order read, when the guard's owner-conditioned pre-ARCA mark or attempt
960
+ * record finds the guard taken over by a successor — before that request's
961
+ * submit went on the wire, so it spent nothing. Retry the same body shortly.
962
+ * - `CAEA_CLAIM_AMBIGUOUS` · 503 — ARCA was down and the CAEA number claim could
963
+ * not be confirmed: the claim may have landed (an operator row records it), no
964
+ * invoice was recorded and nothing was sent to ARCA, and the request released
965
+ * its idempotency record. Retry the same body shortly — a retry claims again,
966
+ * so the worst case is one unused CAEA number, never a second voucher.
967
+ * - `INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH` · 409 — the request's key is bound to
968
+ * an issuance with a different voucher-shaping body (or to a record from
969
+ * before payload hashing, which matches nothing). It does NOT say a voucher
970
+ * exists on the order. Resend only the body that was issued, or credit the
971
+ * voucher first.
972
+ * - `INVOICE_ISSUANCE_OUTCOME_UNCERTAIN` · 409 — an earlier factura of this
973
+ * order was interrupted once it may have spent a voucher number, with no
974
+ * recorded outcome. `data`
975
+ * is {@link InvoiceIssuanceOutcomeUncertainErrorData}. Never retry; support
976
+ * reconciles.
977
+ */
978
+ export declare const INVOICE_ISSUANCE_REFUSAL_CODES: readonly ["INVOICE_ISSUANCE_IN_PROGRESS", "CAEA_CLAIM_AMBIGUOUS", "INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH", "INVOICE_ISSUANCE_OUTCOME_UNCERTAIN"];
979
+ export type InvoiceIssuanceRefusalCode = (typeof INVOICE_ISSUANCE_REFUSAL_CODES)[number];
980
+ /**
981
+ * What a client may do with each {@link InvoiceIssuanceRefusalCode}:
982
+ *
983
+ * - `retry` — resend the same body after a short wait;
984
+ * - `resend-issued-body` — only the body of the issuance the key is bound to
985
+ * (or credit that voucher first); a corrected body is refused again;
986
+ * - `reconcile` — do not resend at all; the order is fenced until support acts.
987
+ */
988
+ export type InvoiceIssuanceRecovery = 'retry' | 'resend-issued-body' | 'reconcile';
989
+ export declare const INVOICE_ISSUANCE_REFUSAL_RECOVERY: {
990
+ readonly INVOICE_ISSUANCE_IN_PROGRESS: "retry";
991
+ readonly CAEA_CLAIM_AMBIGUOUS: "retry";
992
+ readonly INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH: "resend-issued-body";
993
+ readonly INVOICE_ISSUANCE_OUTCOME_UNCERTAIN: "reconcile";
994
+ };
869
995
  export {};
package/dist/invoice.js CHANGED
@@ -29,3 +29,44 @@ export const INVOICE_POST_VOUCHER_ERROR_CODES = [
29
29
  'INVOICE_EXPORT_OUTCOME_UNKNOWN',
30
30
  'CAEA_COMMIT_FAILED_AFTER_CLAIM',
31
31
  ];
32
+ /**
33
+ * The codes `POST /invoices` answers when it REFUSED to start an issuance — or
34
+ * could not confirm it — before any voucher of this request was recorded, as a
35
+ * runtime value a client maps. Distinct from
36
+ * {@link INVOICE_POST_VOUCHER_ERROR_CODES}: each has its own recovery, given by
37
+ * {@link INVOICE_ISSUANCE_REFUSAL_RECOVERY}.
38
+ *
39
+ * - `INVOICE_ISSUANCE_IN_PROGRESS` · 409 — another issuance of this order is
40
+ * live: the same request's idempotency lock, or another request holding the
41
+ * order's factura issuance guard inside its horizon. Also answered after the
42
+ * order read, when the guard's owner-conditioned pre-ARCA mark or attempt
43
+ * record finds the guard taken over by a successor — before that request's
44
+ * submit went on the wire, so it spent nothing. Retry the same body shortly.
45
+ * - `CAEA_CLAIM_AMBIGUOUS` · 503 — ARCA was down and the CAEA number claim could
46
+ * not be confirmed: the claim may have landed (an operator row records it), no
47
+ * invoice was recorded and nothing was sent to ARCA, and the request released
48
+ * its idempotency record. Retry the same body shortly — a retry claims again,
49
+ * so the worst case is one unused CAEA number, never a second voucher.
50
+ * - `INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH` · 409 — the request's key is bound to
51
+ * an issuance with a different voucher-shaping body (or to a record from
52
+ * before payload hashing, which matches nothing). It does NOT say a voucher
53
+ * exists on the order. Resend only the body that was issued, or credit the
54
+ * voucher first.
55
+ * - `INVOICE_ISSUANCE_OUTCOME_UNCERTAIN` · 409 — an earlier factura of this
56
+ * order was interrupted once it may have spent a voucher number, with no
57
+ * recorded outcome. `data`
58
+ * is {@link InvoiceIssuanceOutcomeUncertainErrorData}. Never retry; support
59
+ * reconciles.
60
+ */
61
+ export const INVOICE_ISSUANCE_REFUSAL_CODES = [
62
+ 'INVOICE_ISSUANCE_IN_PROGRESS',
63
+ 'CAEA_CLAIM_AMBIGUOUS',
64
+ 'INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH',
65
+ 'INVOICE_ISSUANCE_OUTCOME_UNCERTAIN',
66
+ ];
67
+ export const INVOICE_ISSUANCE_REFUSAL_RECOVERY = {
68
+ INVOICE_ISSUANCE_IN_PROGRESS: 'retry',
69
+ CAEA_CLAIM_AMBIGUOUS: 'retry',
70
+ INVOICE_IDEMPOTENCY_PAYLOAD_MISMATCH: 'resend-issued-body',
71
+ INVOICE_ISSUANCE_OUTCOME_UNCERTAIN: 'reconcile',
72
+ };
@@ -846,15 +846,15 @@ export interface TenantBillingRollupRow {
846
846
  }
847
847
  /**
848
848
  * @deprecated Nothing produces one any more. The copy↔entitlement consistency
849
- * check went with the free-text plan copy it checked, so the `warnings` array
850
- * on the `POST` / `PATCH /platform/billing/plans` replies is ALWAYS empty. The
851
- * type stays only so a consumer still naming it compiles; it will be removed
852
- * together with that array.
849
+ * check went with the free-text plan copy it checked, and the `warnings` array
850
+ * that carried its findings is gone from the `POST` / `PATCH
851
+ * /platform/billing/plans` replies. The type stays only for the archived check
852
+ * under `stacks/services/_retired/` and for a consumer still naming it.
853
853
  */
854
854
  export type CatalogWarningCode = 'NUMERIC_MISMATCH' | 'UNLIMITED_ADVERTISED_AS_CAPPED' | 'UNBACKED_CAPABILITY' | 'MISSING_FEATURE_ROW';
855
855
  /**
856
- * @deprecated See {@link CatalogWarningCode} — no writer emits one; the
857
- * `warnings` array that carried it is always empty.
856
+ * @deprecated See {@link CatalogWarningCode} — no writer emits one, and no
857
+ * reply carries a `warnings` array of them any more.
858
858
  */
859
859
  export interface CatalogWarning {
860
860
  code: CatalogWarningCode;
@@ -1053,7 +1053,10 @@ export interface PlatformMrrMetrics {
1053
1053
  * the safer direction for a number an operator acts on.
1054
1054
  */
1055
1055
  countedStatuses: SubscriptionStatus[];
1056
- /** `priceAnnualCents / annualDivisor` is one annual subscription's monthly contribution. */
1056
+ /**
1057
+ * `priceAnnualCents` is the yearly total charged once per year, so
1058
+ * `priceAnnualCents / annualDivisor` is one annual subscription's monthly contribution.
1059
+ */
1057
1060
  annualDivisor: number;
1058
1061
  /** Subscriptions in a counted status. The denominator for `excluded`. */
1059
1062
  countedSubscriptions: number;
@@ -249,7 +249,7 @@ declare global {
249
249
  *
250
250
  * Prices are integers in the `currency` smallest unit (centavos for ARS,
251
251
  * cents for USD). `null` = "Contactar ventas" (AVANZADO annual at launch
252
- * is sales-led; basico/fundador are free) per spec §6.4.
252
+ * is sales-led; basico is free) per spec §6.4.
253
253
  *
254
254
  * **Breaking change vs 1.1.x:** the catalog Plan interface was reshaped
255
255
  * to match the BE wire format. Renames & removals:
@@ -293,7 +293,12 @@ declare global {
293
293
  displayOrder: number;
294
294
  /** Monthly price in `currency` smallest units. `null` = sales-led / free. */
295
295
  priceMonthlyCents: number | null;
296
- /** Annual price in `currency` smallest units. `null` = sales-led / free. */
296
+ /**
297
+ * The YEARLY TOTAL, charged once per year, in `currency` smallest units —
298
+ * never a per-month figure. Divide by 12 for a monthly equivalent.
299
+ * Nothing enforces its ratio to `priceMonthlyCents`; the operator sets
300
+ * both. `null` = sales-led / free.
301
+ */
297
302
  priceAnnualCents: number | null;
298
303
  /**
299
304
  * Currency the prices are denominated in. `'ARS'` at launch; `'USD'`
@@ -313,14 +318,6 @@ declare global {
313
318
  * `limit`.
314
319
  */
315
320
  features: PlanFeature[];
316
- /**
317
- * @deprecated ALWAYS `[]`. The free-text card copy was retired: a plan
318
- * card renders {@link Plan.highlights} instead, and no write accepts
319
- * `bullets` any more (`POST`/`PATCH /platform/billing/plans` answer 400
320
- * `VALIDATION_FAILED`). A value an old row still stores is ignored, never
321
- * echoed. The key will be removed once the app's copy editor is gone.
322
- */
323
- bullets: string[];
324
321
  /**
325
322
  * Keys worth calling out on this tier's card: highlight-eligible keys with
326
323
  * status `live` or `service` whose grant improves on the next lower
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.713",
3
+ "version": "1.10.714",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",