platform-types 1.10.735 → 1.10.737

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.
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FISCAL_CONDITIONS = void 0;
4
+ /**
5
+ * The ARCA fiscal-condition catalogue — the ONE definition. It maps each legacy
6
+ * `condFiscal` code to its display name, its ARCA `DocTipo` and the `CbteTipo`
7
+ * family that issuance resolves for it.
8
+ *
9
+ * Deliberately NOT `declare global`: it is a runtime value, so import it:
10
+ *
11
+ * ```ts
12
+ * import { FISCAL_CONDITIONS } from 'platform-types';
13
+ * ```
14
+ *
15
+ * The api re-exports this exact binding from `stacks/services/fiscalCatalogs.ts`,
16
+ * which is where invoice issuance reads it.
17
+ *
18
+ * ⚠️ **`condFiscal` is NOT a unique key.** Code `32` has two rows: «Iva Exento»
19
+ * (`DocTipo 80`, a domestic CUIT holder) and «Cliente del Exterior» (`DocTipo 91`).
20
+ * To NAME a code, prefer its `DocTipo 80` row and fall back to its only row, so
21
+ * `32` reads «Iva Exento» and `99`/`96` read Consumidor Final (spelled
22
+ * differently on the two rows):
23
+ *
24
+ * ```ts
25
+ * const rows = FISCAL_CONDITIONS.filter((c) => c.condFiscal === code);
26
+ * const name = (rows.find((c) => c.DocTipo === 80) ?? rows[0])?.name;
27
+ * ```
28
+ *
29
+ * `undefined` means a code this catalogue does not hold — issuance refuses such
30
+ * an order rather than guessing, so render it as unknown, never as a default.
31
+ *
32
+ * Provenance: these are AFIP-standardized catalogues, identical for every
33
+ * tenant, so a reviewed and versioned file is their home rather than a DynamoDB
34
+ * row an operator could silently edit. This is a byte-identical snapshot of the
35
+ * retired `STORE#CONFIG` row, cross-checked against both dev and prod, with ONE
36
+ * deliberate divergence: id 5's `CbteTipo.NC`/`ND` are corrected (see that row).
37
+ *
38
+ * `CbteTipo.NVC` is declared by `FiscalCondition` but was never populated on the
39
+ * live row and nothing reads it: the one hardcoded non-Responsable-Inscripto
40
+ * fallback in issuance sets its own literal `NVC: 16`. The `0` here is an inert
41
+ * placeholder that satisfies the type, not a real AFIP code.
42
+ */
43
+ exports.FISCAL_CONDITIONS = [
44
+ {
45
+ id: 1,
46
+ name: 'Consumidor Final',
47
+ condFiscal: 99,
48
+ DocTipo: 99,
49
+ CbteTipo: { FAC: 6, REC: 9, NC: 8, ND: 7, NVC: 0 },
50
+ },
51
+ {
52
+ id: 2,
53
+ name: 'Responsable Inscripto',
54
+ condFiscal: 30,
55
+ DocTipo: 80,
56
+ CbteTipo: { FAC: 1, REC: 4, NC: 3, ND: 2, NVC: 0 },
57
+ },
58
+ {
59
+ id: 3,
60
+ name: 'Responsable Monotributo',
61
+ condFiscal: 20,
62
+ DocTipo: 80,
63
+ CbteTipo: { FAC: 1, REC: 4, NC: 3, ND: 2, NVC: 0 },
64
+ },
65
+ {
66
+ id: 4,
67
+ name: 'Iva Exento',
68
+ condFiscal: 32,
69
+ DocTipo: 80,
70
+ CbteTipo: { FAC: 6, REC: 9, NC: 8, ND: 7, NVC: 0 },
71
+ },
72
+ {
73
+ id: 5,
74
+ name: 'Cliente del Exterior',
75
+ condFiscal: 32,
76
+ DocTipo: 91,
77
+ // NC/ND corrected from the legacy snapshot, which had them transposed vs
78
+ // RG 5762 (52 = ND, 53 = NC). `.CbteTipo` is unreachable at runtime here:
79
+ // a `condFiscal` 32 lookup resolves to id 4, not id 5.
80
+ CbteTipo: { FAC: 51, REC: 54, NC: 53, ND: 52, NVC: 0 },
81
+ },
82
+ {
83
+ id: 6,
84
+ name: 'CONSUMIDOR FINAL',
85
+ condFiscal: 96,
86
+ DocTipo: 96,
87
+ CbteTipo: { FAC: 6, REC: 9, NC: 8, ND: 7, NVC: 0 },
88
+ },
89
+ ];
package/dist/cjs/index.js CHANGED
@@ -52,6 +52,7 @@ __exportStar(require("./customerTimeline.js"), exports);
52
52
  __exportStar(require("./cycleCount.js"), exports);
53
53
  __exportStar(require("./delivery.js"), exports);
54
54
  __exportStar(require("./favorite.js"), exports);
55
+ __exportStar(require("./fiscalConditions.js"), exports);
55
56
  __exportStar(require("./gating.js"), exports);
56
57
  __exportStar(require("./holdingCost.js"), exports);
57
58
  __exportStar(require("./demo.js"), exports);
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The ARCA fiscal-condition catalogue — the ONE definition. It maps each legacy
3
+ * `condFiscal` code to its display name, its ARCA `DocTipo` and the `CbteTipo`
4
+ * family that issuance resolves for it.
5
+ *
6
+ * Deliberately NOT `declare global`: it is a runtime value, so import it:
7
+ *
8
+ * ```ts
9
+ * import { FISCAL_CONDITIONS } from 'platform-types';
10
+ * ```
11
+ *
12
+ * The api re-exports this exact binding from `stacks/services/fiscalCatalogs.ts`,
13
+ * which is where invoice issuance reads it.
14
+ *
15
+ * ⚠️ **`condFiscal` is NOT a unique key.** Code `32` has two rows: «Iva Exento»
16
+ * (`DocTipo 80`, a domestic CUIT holder) and «Cliente del Exterior» (`DocTipo 91`).
17
+ * To NAME a code, prefer its `DocTipo 80` row and fall back to its only row, so
18
+ * `32` reads «Iva Exento» and `99`/`96` read Consumidor Final (spelled
19
+ * differently on the two rows):
20
+ *
21
+ * ```ts
22
+ * const rows = FISCAL_CONDITIONS.filter((c) => c.condFiscal === code);
23
+ * const name = (rows.find((c) => c.DocTipo === 80) ?? rows[0])?.name;
24
+ * ```
25
+ *
26
+ * `undefined` means a code this catalogue does not hold — issuance refuses such
27
+ * an order rather than guessing, so render it as unknown, never as a default.
28
+ *
29
+ * Provenance: these are AFIP-standardized catalogues, identical for every
30
+ * tenant, so a reviewed and versioned file is their home rather than a DynamoDB
31
+ * row an operator could silently edit. This is a byte-identical snapshot of the
32
+ * retired `STORE#CONFIG` row, cross-checked against both dev and prod, with ONE
33
+ * deliberate divergence: id 5's `CbteTipo.NC`/`ND` are corrected (see that row).
34
+ *
35
+ * `CbteTipo.NVC` is declared by `FiscalCondition` but was never populated on the
36
+ * live row and nothing reads it: the one hardcoded non-Responsable-Inscripto
37
+ * fallback in issuance sets its own literal `NVC: 16`. The `0` here is an inert
38
+ * placeholder that satisfies the type, not a real AFIP code.
39
+ */
40
+ export declare const FISCAL_CONDITIONS: FiscalCondition[];
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The ARCA fiscal-condition catalogue — the ONE definition. It maps each legacy
3
+ * `condFiscal` code to its display name, its ARCA `DocTipo` and the `CbteTipo`
4
+ * family that issuance resolves for it.
5
+ *
6
+ * Deliberately NOT `declare global`: it is a runtime value, so import it:
7
+ *
8
+ * ```ts
9
+ * import { FISCAL_CONDITIONS } from 'platform-types';
10
+ * ```
11
+ *
12
+ * The api re-exports this exact binding from `stacks/services/fiscalCatalogs.ts`,
13
+ * which is where invoice issuance reads it.
14
+ *
15
+ * ⚠️ **`condFiscal` is NOT a unique key.** Code `32` has two rows: «Iva Exento»
16
+ * (`DocTipo 80`, a domestic CUIT holder) and «Cliente del Exterior» (`DocTipo 91`).
17
+ * To NAME a code, prefer its `DocTipo 80` row and fall back to its only row, so
18
+ * `32` reads «Iva Exento» and `99`/`96` read Consumidor Final (spelled
19
+ * differently on the two rows):
20
+ *
21
+ * ```ts
22
+ * const rows = FISCAL_CONDITIONS.filter((c) => c.condFiscal === code);
23
+ * const name = (rows.find((c) => c.DocTipo === 80) ?? rows[0])?.name;
24
+ * ```
25
+ *
26
+ * `undefined` means a code this catalogue does not hold — issuance refuses such
27
+ * an order rather than guessing, so render it as unknown, never as a default.
28
+ *
29
+ * Provenance: these are AFIP-standardized catalogues, identical for every
30
+ * tenant, so a reviewed and versioned file is their home rather than a DynamoDB
31
+ * row an operator could silently edit. This is a byte-identical snapshot of the
32
+ * retired `STORE#CONFIG` row, cross-checked against both dev and prod, with ONE
33
+ * deliberate divergence: id 5's `CbteTipo.NC`/`ND` are corrected (see that row).
34
+ *
35
+ * `CbteTipo.NVC` is declared by `FiscalCondition` but was never populated on the
36
+ * live row and nothing reads it: the one hardcoded non-Responsable-Inscripto
37
+ * fallback in issuance sets its own literal `NVC: 16`. The `0` here is an inert
38
+ * placeholder that satisfies the type, not a real AFIP code.
39
+ */
40
+ export const FISCAL_CONDITIONS = [
41
+ {
42
+ id: 1,
43
+ name: 'Consumidor Final',
44
+ condFiscal: 99,
45
+ DocTipo: 99,
46
+ CbteTipo: { FAC: 6, REC: 9, NC: 8, ND: 7, NVC: 0 },
47
+ },
48
+ {
49
+ id: 2,
50
+ name: 'Responsable Inscripto',
51
+ condFiscal: 30,
52
+ DocTipo: 80,
53
+ CbteTipo: { FAC: 1, REC: 4, NC: 3, ND: 2, NVC: 0 },
54
+ },
55
+ {
56
+ id: 3,
57
+ name: 'Responsable Monotributo',
58
+ condFiscal: 20,
59
+ DocTipo: 80,
60
+ CbteTipo: { FAC: 1, REC: 4, NC: 3, ND: 2, NVC: 0 },
61
+ },
62
+ {
63
+ id: 4,
64
+ name: 'Iva Exento',
65
+ condFiscal: 32,
66
+ DocTipo: 80,
67
+ CbteTipo: { FAC: 6, REC: 9, NC: 8, ND: 7, NVC: 0 },
68
+ },
69
+ {
70
+ id: 5,
71
+ name: 'Cliente del Exterior',
72
+ condFiscal: 32,
73
+ DocTipo: 91,
74
+ // NC/ND corrected from the legacy snapshot, which had them transposed vs
75
+ // RG 5762 (52 = ND, 53 = NC). `.CbteTipo` is unreachable at runtime here:
76
+ // a `condFiscal` 32 lookup resolves to id 4, not id 5.
77
+ CbteTipo: { FAC: 51, REC: 54, NC: 53, ND: 52, NVC: 0 },
78
+ },
79
+ {
80
+ id: 6,
81
+ name: 'CONSUMIDOR FINAL',
82
+ condFiscal: 96,
83
+ DocTipo: 96,
84
+ CbteTipo: { FAC: 6, REC: 9, NC: 8, ND: 7, NVC: 0 },
85
+ },
86
+ ];
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export * from './customerTimeline.ts';
28
28
  export * from './cycleCount.ts';
29
29
  export * from './delivery.ts';
30
30
  export * from './favorite.ts';
31
+ export * from './fiscalConditions.ts';
31
32
  export * from './gating.ts';
32
33
  export * from './holdingCost.ts';
33
34
  export * from './demo.ts';
package/dist/index.js CHANGED
@@ -36,6 +36,7 @@ export * from "./customerTimeline.js";
36
36
  export * from "./cycleCount.js";
37
37
  export * from "./delivery.js";
38
38
  export * from "./favorite.js";
39
+ export * from "./fiscalConditions.js";
39
40
  export * from "./gating.js";
40
41
  export * from "./holdingCost.js";
41
42
  export * from "./demo.js";
package/dist/order.d.ts CHANGED
@@ -953,11 +953,35 @@ declare global {
953
953
  * its own — method ids are per-catalog ordinals.
954
954
  */
955
955
  deliveryMethod?: number;
956
+ /**
957
+ * The receptor the order is invoiced to, as the creating client stated it.
958
+ *
959
+ * ⚠️ **Every key is optional, and readers must tolerate each one absent.**
960
+ * That is what the writers persist, not a loosening: the storefront checkout
961
+ * validates this object with every key optional and writes it verbatim (an
962
+ * empty object included), the presupuesto conversion passes the operator's
963
+ * object through, and only the operator create requires `condFiscal`.
964
+ *
965
+ * - `razonSocial` is routinely absent: a Consumidor Final receptor has no
966
+ * legal name, and none may be invented for one. A class A or M factura
967
+ * (an RI or Monotributo receptor) is never issued without one: issuance
968
+ * fills a blank name from the platform Padrón cache for the CUIT, and
969
+ * otherwise refuses `400 INVOICE_METHOD_RAZON_SOCIAL_MISSING` until the
970
+ * operator completes it.
971
+ * - `condFiscalName` is display-only and usually absent. Never read it for
972
+ * meaning: derive the name from `condFiscal` with the published
973
+ * `FISCAL_CONDITIONS` catalogue (its docblock gives the lookup, since
974
+ * `condFiscal` alone is not a unique key there).
975
+ * - `condFiscal` and `cuit` absent are a PERSISTABLE state, not an
976
+ * invoiceable one: issuing a factura refuses the order with a coded `400`
977
+ * (`INVOICE_METHOD_COND_FISCAL_INVALID`, `INVOICE_METHOD_CUIT_MISSING`)
978
+ * until the operator completes it.
979
+ */
956
980
  invoiceMethod?: {
957
- condFiscal: number;
958
- condFiscalName: string;
959
- cuit: string;
960
- razonSocial: string;
981
+ condFiscal?: number;
982
+ condFiscalName?: string;
983
+ cuit?: string;
984
+ razonSocial?: string;
961
985
  /**
962
986
  * Explicit per-order ARCA receptor identity, decoupled from condFiscal
963
987
  * (ARCA DocTipo: 80 = CUIT, 96 = DNI, 99 = Consumidor Final — a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.735",
3
+ "version": "1.10.737",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",