@vitrina/api 17.27.1 → 17.28.0
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/index.d.cts +269 -3
- package/dist/index.d.ts +269 -3
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -18303,7 +18303,7 @@ interface paths {
|
|
|
18303
18303
|
*
|
|
18304
18304
|
* SIN COSTO (ADR 0114 §8). A car that entered without a compra (nota de compra), a consignación (contrato) or a parte de pago (nota de venta) has no acquisition, so nothing records what it cost. Every row carries `sin_costo: true` for such a unit (any status), and `view=sin_costo` lists the pile still on the floor — active, not vendido, no acquisition; the SAME predicate as the `sin_costo` count on `GET /vehicles/stats` and the `stock_without_cost` dealer alert. It is never a gate: bulk imports and migrations land cars here on purpose. `sin_costo` is a statement about the cost basis and follows the cost omission above: ABSENT without `dealership_economics:read`.
|
|
18305
18305
|
*
|
|
18306
|
-
* MANDATO SIN FIRMAR (ADR 0114 §5). `view=mandato_sin_firmar` lists the cars whose consignación (activa or vendida) has an emitted mandato and no signed copy filed in the expediente — the SAME predicate as the `mandato_sin_firmar` count on `GET /vehicles/stats
|
|
18306
|
+
* MANDATO SIN FIRMAR (ADR 0114 §5). `view=mandato_sin_firmar` lists the cars whose consignación (activa or vendida) has an emitted mandato and no signed copy filed in the expediente — the SAME predicate as the `mandato_sin_firmar` count on `GET /vehicles/stats`. Never a gate, and no longer a dealer alert (retired 2026-11-10: it is a filter you open, not a to-do).
|
|
18307
18307
|
*/
|
|
18308
18308
|
get: {
|
|
18309
18309
|
parameters: {
|
|
@@ -38329,6 +38329,8 @@ interface paths {
|
|
|
38329
38329
|
*
|
|
38330
38330
|
* **`receivable_obligation_id`** is the open ledger receivable this note settles — pass it as `obligation_id` to `POST /payments` to apply a payment to this note. `null` once the note is voided (the void releases its money) or when it has no receivable.
|
|
38331
38331
|
*
|
|
38332
|
+
* **`print_missing_fields`** is what `GET /sale-notes/{id}/pdf` would refuse with right now — the SAME `{ variable, label, fix, contact_id? }` list as its 409 `details.missing_fields` — so a screen can ask for the buyer’s domicilio while the buyer is still at the counter. `[]` when the note prints, and always `[]` on a voided note.
|
|
38333
|
+
*
|
|
38332
38334
|
* **`trade_ins` names the cars taken in part-exchange** (ERP S9-6) — one entry per car with the line’s own id (never the vehicle’s: BR-457), the `vehicle_id`, the `precio_toma_clp` allowed for it, and the `acquisition_id` of the `vehicle_acquisition` that arrival created. That is the SALE → UNIT direction; the UNIT → SALE direction needs no surface here, because `vehicle_acquisition.sale_note_id` is projected on every read of `GET /vehicle-acquisitions?vehicle_id=`. `acquisition_id` is `null` once the document has been VOIDED — a void retracts the arrival and keeps the line, so the null says exactly what happened: this credit was agreed, and the arrival it caused has been withdrawn.
|
|
38333
38335
|
*
|
|
38334
38336
|
* **`credit` is the LIVE brokered credit, or `null`** (ERP S9-7) — the `institution` that is lending (BR-464 makes the financiera the credit’s identity on the document), the `amount_clp`, and its OWN `state`: `committed` (the bank has promised) or `disbursed` (the money has arrived, with `disbursed_at` / `disbursed_by` beside it). ⚠ **Both count the same in `funding`** (BR-463), so never read `funded` as "the cash is in" — read `credit.state` for that. The committed-vs-collected gap is exactly this pair of fields read side by side. ⚠ **The credit’s state is INDEPENDENT of the document’s `status`**: a voided nota de venta keeps its credit row untouched, and a disbursed credit does not make the document anything. Credits that were REPLACED or REMOVED are tombstoned and are deliberately not served here — they are history, not funding, and listing them beside the live one would invite a client to add them up.
|
|
@@ -38379,6 +38381,14 @@ interface paths {
|
|
|
38379
38381
|
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
38380
38382
|
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
38381
38383
|
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
38384
|
+
* "print_missing_fields": [
|
|
38385
|
+
* {
|
|
38386
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
38387
|
+
* "label": "Domicilio del comprador",
|
|
38388
|
+
* "fix": "buyer_contact",
|
|
38389
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
38390
|
+
* }
|
|
38391
|
+
* ],
|
|
38382
38392
|
* "payments": [
|
|
38383
38393
|
* {
|
|
38384
38394
|
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
@@ -38593,6 +38603,14 @@ interface paths {
|
|
|
38593
38603
|
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
38594
38604
|
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
38595
38605
|
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
38606
|
+
* "print_missing_fields": [
|
|
38607
|
+
* {
|
|
38608
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
38609
|
+
* "label": "Domicilio del comprador",
|
|
38610
|
+
* "fix": "buyer_contact",
|
|
38611
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
38612
|
+
* }
|
|
38613
|
+
* ],
|
|
38596
38614
|
* "payments": [
|
|
38597
38615
|
* {
|
|
38598
38616
|
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
@@ -73807,6 +73825,227 @@ interface paths {
|
|
|
73807
73825
|
patch?: never;
|
|
73808
73826
|
trace?: never;
|
|
73809
73827
|
};
|
|
73828
|
+
"/finanzas/connections/sync": {
|
|
73829
|
+
parameters: {
|
|
73830
|
+
query?: never;
|
|
73831
|
+
header?: never;
|
|
73832
|
+
path?: never;
|
|
73833
|
+
cookie?: never;
|
|
73834
|
+
};
|
|
73835
|
+
/**
|
|
73836
|
+
* Freshness of the bank movements
|
|
73837
|
+
* @description When each bank link was last pulled, and whether a pull is queued. A read: it queues nothing. Poll it after `POST /finanzas/connections/sync` until `queued` is false, then reload. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
|
|
73838
|
+
*/
|
|
73839
|
+
get: {
|
|
73840
|
+
parameters: {
|
|
73841
|
+
query?: never;
|
|
73842
|
+
header?: never;
|
|
73843
|
+
path?: never;
|
|
73844
|
+
cookie?: never;
|
|
73845
|
+
};
|
|
73846
|
+
requestBody?: never;
|
|
73847
|
+
responses: {
|
|
73848
|
+
/** @description The freshness */
|
|
73849
|
+
200: {
|
|
73850
|
+
headers: {
|
|
73851
|
+
[name: string]: unknown;
|
|
73852
|
+
};
|
|
73853
|
+
content: {
|
|
73854
|
+
/**
|
|
73855
|
+
* @example {
|
|
73856
|
+
* "data": {
|
|
73857
|
+
* "last_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73858
|
+
* "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73859
|
+
* "queued": true,
|
|
73860
|
+
* "enqueued": 0,
|
|
73861
|
+
* "links": [
|
|
73862
|
+
* {
|
|
73863
|
+
* "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
|
|
73864
|
+
* "institution_name": "Banco de Chile",
|
|
73865
|
+
* "last_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73866
|
+
* "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73867
|
+
* "queued": true,
|
|
73868
|
+
* "next_refresh_at": "2026-10-30T09:15:00.000Z",
|
|
73869
|
+
* "skipped": null
|
|
73870
|
+
* }
|
|
73871
|
+
* ],
|
|
73872
|
+
* "min_interval_minutes": 15
|
|
73873
|
+
* }
|
|
73874
|
+
* }
|
|
73875
|
+
*/
|
|
73876
|
+
"application/json": {
|
|
73877
|
+
data: components["schemas"]["FinanzasBankPull"];
|
|
73878
|
+
};
|
|
73879
|
+
};
|
|
73880
|
+
};
|
|
73881
|
+
/** @description Validation error */
|
|
73882
|
+
400: {
|
|
73883
|
+
headers: {
|
|
73884
|
+
[name: string]: unknown;
|
|
73885
|
+
};
|
|
73886
|
+
content: {
|
|
73887
|
+
"application/json": components["schemas"]["Error"];
|
|
73888
|
+
};
|
|
73889
|
+
};
|
|
73890
|
+
/** @description Unauthorized */
|
|
73891
|
+
401: {
|
|
73892
|
+
headers: {
|
|
73893
|
+
[name: string]: unknown;
|
|
73894
|
+
};
|
|
73895
|
+
content: {
|
|
73896
|
+
"application/json": components["schemas"]["Error"];
|
|
73897
|
+
};
|
|
73898
|
+
};
|
|
73899
|
+
/** @description Forbidden */
|
|
73900
|
+
403: {
|
|
73901
|
+
headers: {
|
|
73902
|
+
[name: string]: unknown;
|
|
73903
|
+
};
|
|
73904
|
+
content: {
|
|
73905
|
+
"application/json": components["schemas"]["Error"];
|
|
73906
|
+
};
|
|
73907
|
+
};
|
|
73908
|
+
/** @description Not found */
|
|
73909
|
+
404: {
|
|
73910
|
+
headers: {
|
|
73911
|
+
[name: string]: unknown;
|
|
73912
|
+
};
|
|
73913
|
+
content: {
|
|
73914
|
+
"application/json": components["schemas"]["Error"];
|
|
73915
|
+
};
|
|
73916
|
+
};
|
|
73917
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
73918
|
+
409: {
|
|
73919
|
+
headers: {
|
|
73920
|
+
[name: string]: unknown;
|
|
73921
|
+
};
|
|
73922
|
+
content: {
|
|
73923
|
+
"application/json": components["schemas"]["Error"];
|
|
73924
|
+
};
|
|
73925
|
+
};
|
|
73926
|
+
/** @description Rate limited */
|
|
73927
|
+
429: {
|
|
73928
|
+
headers: {
|
|
73929
|
+
[name: string]: unknown;
|
|
73930
|
+
};
|
|
73931
|
+
content: {
|
|
73932
|
+
"application/json": components["schemas"]["Error"];
|
|
73933
|
+
};
|
|
73934
|
+
};
|
|
73935
|
+
};
|
|
73936
|
+
};
|
|
73937
|
+
put?: never;
|
|
73938
|
+
/**
|
|
73939
|
+
* Sync every bank link
|
|
73940
|
+
* @description Sync on entry to Finanzas and «Sincronizar ahora» for every bank link. Idempotent, never throttled: each active link not pulled nor requested in the last `min_interval_minutes` (15) gets one pull, the others answer with their last pull (`enqueued` counts the pulls this call queued). A `login_required` or disconnected link is skipped and reported in `links[].skipped`. Movements land within a minute or two; poll `GET /finanzas/connections/sync` until `queued` is false. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
|
|
73941
|
+
*/
|
|
73942
|
+
post: {
|
|
73943
|
+
parameters: {
|
|
73944
|
+
query?: never;
|
|
73945
|
+
header?: {
|
|
73946
|
+
/** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
|
|
73947
|
+
"Idempotency-Key"?: string;
|
|
73948
|
+
};
|
|
73949
|
+
path?: never;
|
|
73950
|
+
cookie?: never;
|
|
73951
|
+
};
|
|
73952
|
+
requestBody?: never;
|
|
73953
|
+
responses: {
|
|
73954
|
+
/** @description The freshness after the request */
|
|
73955
|
+
200: {
|
|
73956
|
+
headers: {
|
|
73957
|
+
[name: string]: unknown;
|
|
73958
|
+
};
|
|
73959
|
+
content: {
|
|
73960
|
+
/**
|
|
73961
|
+
* @example {
|
|
73962
|
+
* "data": {
|
|
73963
|
+
* "last_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73964
|
+
* "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73965
|
+
* "queued": true,
|
|
73966
|
+
* "enqueued": 1,
|
|
73967
|
+
* "links": [
|
|
73968
|
+
* {
|
|
73969
|
+
* "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
|
|
73970
|
+
* "institution_name": "Banco de Chile",
|
|
73971
|
+
* "last_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73972
|
+
* "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73973
|
+
* "queued": true,
|
|
73974
|
+
* "next_refresh_at": "2026-10-30T09:15:00.000Z",
|
|
73975
|
+
* "skipped": null
|
|
73976
|
+
* }
|
|
73977
|
+
* ],
|
|
73978
|
+
* "min_interval_minutes": 15
|
|
73979
|
+
* }
|
|
73980
|
+
* }
|
|
73981
|
+
*/
|
|
73982
|
+
"application/json": {
|
|
73983
|
+
data: components["schemas"]["FinanzasBankPull"];
|
|
73984
|
+
};
|
|
73985
|
+
};
|
|
73986
|
+
};
|
|
73987
|
+
/** @description Validation error */
|
|
73988
|
+
400: {
|
|
73989
|
+
headers: {
|
|
73990
|
+
[name: string]: unknown;
|
|
73991
|
+
};
|
|
73992
|
+
content: {
|
|
73993
|
+
"application/json": components["schemas"]["Error"];
|
|
73994
|
+
};
|
|
73995
|
+
};
|
|
73996
|
+
/** @description Unauthorized */
|
|
73997
|
+
401: {
|
|
73998
|
+
headers: {
|
|
73999
|
+
[name: string]: unknown;
|
|
74000
|
+
};
|
|
74001
|
+
content: {
|
|
74002
|
+
"application/json": components["schemas"]["Error"];
|
|
74003
|
+
};
|
|
74004
|
+
};
|
|
74005
|
+
/** @description Forbidden */
|
|
74006
|
+
403: {
|
|
74007
|
+
headers: {
|
|
74008
|
+
[name: string]: unknown;
|
|
74009
|
+
};
|
|
74010
|
+
content: {
|
|
74011
|
+
"application/json": components["schemas"]["Error"];
|
|
74012
|
+
};
|
|
74013
|
+
};
|
|
74014
|
+
/** @description Not found */
|
|
74015
|
+
404: {
|
|
74016
|
+
headers: {
|
|
74017
|
+
[name: string]: unknown;
|
|
74018
|
+
};
|
|
74019
|
+
content: {
|
|
74020
|
+
"application/json": components["schemas"]["Error"];
|
|
74021
|
+
};
|
|
74022
|
+
};
|
|
74023
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
74024
|
+
409: {
|
|
74025
|
+
headers: {
|
|
74026
|
+
[name: string]: unknown;
|
|
74027
|
+
};
|
|
74028
|
+
content: {
|
|
74029
|
+
"application/json": components["schemas"]["Error"];
|
|
74030
|
+
};
|
|
74031
|
+
};
|
|
74032
|
+
/** @description Rate limited */
|
|
74033
|
+
429: {
|
|
74034
|
+
headers: {
|
|
74035
|
+
[name: string]: unknown;
|
|
74036
|
+
};
|
|
74037
|
+
content: {
|
|
74038
|
+
"application/json": components["schemas"]["Error"];
|
|
74039
|
+
};
|
|
74040
|
+
};
|
|
74041
|
+
};
|
|
74042
|
+
};
|
|
74043
|
+
delete?: never;
|
|
74044
|
+
options?: never;
|
|
74045
|
+
head?: never;
|
|
74046
|
+
patch?: never;
|
|
74047
|
+
trace?: never;
|
|
74048
|
+
};
|
|
73810
74049
|
"/finanzas/connections/{id}/sync": {
|
|
73811
74050
|
parameters: {
|
|
73812
74051
|
query?: never;
|
|
@@ -95040,7 +95279,8 @@ interface paths {
|
|
|
95040
95279
|
* "label": "septiembre 2026",
|
|
95041
95280
|
* "equilibrio_clp": 44600000,
|
|
95042
95281
|
* "sin_calculo": null,
|
|
95043
|
-
* "produccion": null
|
|
95282
|
+
* "produccion": null,
|
|
95283
|
+
* "skipped_incompleto": null
|
|
95044
95284
|
* },
|
|
95045
95285
|
* "target_clp": 44600000,
|
|
95046
95286
|
* "cobertura_pct": 92.4,
|
|
@@ -282032,6 +282272,25 @@ interface components {
|
|
|
282032
282272
|
exchange_token?: string;
|
|
282033
282273
|
link_token?: string;
|
|
282034
282274
|
};
|
|
282275
|
+
FinanzasBankPullLink: {
|
|
282276
|
+
/** Format: uuid */
|
|
282277
|
+
id: string;
|
|
282278
|
+
institution_name: string | null;
|
|
282279
|
+
last_sync_at: string | null;
|
|
282280
|
+
last_successful_sync_at: string | null;
|
|
282281
|
+
queued: boolean;
|
|
282282
|
+
next_refresh_at: string | null;
|
|
282283
|
+
/** @enum {string|null} */
|
|
282284
|
+
skipped: "login_required" | "disconnected" | null;
|
|
282285
|
+
};
|
|
282286
|
+
FinanzasBankPull: {
|
|
282287
|
+
last_sync_at: string | null;
|
|
282288
|
+
last_successful_sync_at: string | null;
|
|
282289
|
+
queued: boolean;
|
|
282290
|
+
enqueued: number;
|
|
282291
|
+
links: components["schemas"]["FinanzasBankPullLink"][];
|
|
282292
|
+
min_interval_minutes: number;
|
|
282293
|
+
};
|
|
282035
282294
|
FinanzasSyncResult: {
|
|
282036
282295
|
/** @enum {boolean} */
|
|
282037
282296
|
enqueued: true;
|
|
@@ -282427,7 +282686,7 @@ interface components {
|
|
|
282427
282686
|
* @description Finanzas 36: set when the bank text names nobody and the movement has no Contraparte: show it as the title with the sub-line «Sin contraparte».
|
|
282428
282687
|
* @enum {string|null}
|
|
282429
282688
|
*/
|
|
282430
|
-
generic_label: "Depósito en efectivo" | "Pago recibido" | "Depósito con cheque" | null;
|
|
282689
|
+
generic_label: "Depósito en efectivo" | "Pago recibido" | "Depósito con cheque" | "Pago de tarjeta de crédito" | null;
|
|
282431
282690
|
created_at: string;
|
|
282432
282691
|
};
|
|
282433
282692
|
FinanzasDocument: {
|
|
@@ -285704,6 +285963,13 @@ interface components {
|
|
|
285704
285963
|
equilibrio_clp: number;
|
|
285705
285964
|
}[];
|
|
285706
285965
|
produccion: components["schemas"]["FinanzasEquilibrioProduccion"];
|
|
285966
|
+
/** @description The newest «Mes incompleto» the bar skipped, so the card can flag it like Resultado and Costos do. Null when no month was skipped. */
|
|
285967
|
+
skipped_incompleto: {
|
|
285968
|
+
month: string;
|
|
285969
|
+
label: string;
|
|
285970
|
+
/** @description Spanish, ready for the tooltip. */
|
|
285971
|
+
message: string;
|
|
285972
|
+
} | null;
|
|
285707
285973
|
} | null;
|
|
285708
285974
|
/** @description The break-even on the same terms as `basis`: `equilibrio.produccion.equilibrio_clp` when `basis` is `produccion` and a ratio exists, else `equilibrio.equilibrio_clp`. Null without a break-even. */
|
|
285709
285975
|
target_clp: number | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -18303,7 +18303,7 @@ interface paths {
|
|
|
18303
18303
|
*
|
|
18304
18304
|
* SIN COSTO (ADR 0114 §8). A car that entered without a compra (nota de compra), a consignación (contrato) or a parte de pago (nota de venta) has no acquisition, so nothing records what it cost. Every row carries `sin_costo: true` for such a unit (any status), and `view=sin_costo` lists the pile still on the floor — active, not vendido, no acquisition; the SAME predicate as the `sin_costo` count on `GET /vehicles/stats` and the `stock_without_cost` dealer alert. It is never a gate: bulk imports and migrations land cars here on purpose. `sin_costo` is a statement about the cost basis and follows the cost omission above: ABSENT without `dealership_economics:read`.
|
|
18305
18305
|
*
|
|
18306
|
-
* MANDATO SIN FIRMAR (ADR 0114 §5). `view=mandato_sin_firmar` lists the cars whose consignación (activa or vendida) has an emitted mandato and no signed copy filed in the expediente — the SAME predicate as the `mandato_sin_firmar` count on `GET /vehicles/stats
|
|
18306
|
+
* MANDATO SIN FIRMAR (ADR 0114 §5). `view=mandato_sin_firmar` lists the cars whose consignación (activa or vendida) has an emitted mandato and no signed copy filed in the expediente — the SAME predicate as the `mandato_sin_firmar` count on `GET /vehicles/stats`. Never a gate, and no longer a dealer alert (retired 2026-11-10: it is a filter you open, not a to-do).
|
|
18307
18307
|
*/
|
|
18308
18308
|
get: {
|
|
18309
18309
|
parameters: {
|
|
@@ -38329,6 +38329,8 @@ interface paths {
|
|
|
38329
38329
|
*
|
|
38330
38330
|
* **`receivable_obligation_id`** is the open ledger receivable this note settles — pass it as `obligation_id` to `POST /payments` to apply a payment to this note. `null` once the note is voided (the void releases its money) or when it has no receivable.
|
|
38331
38331
|
*
|
|
38332
|
+
* **`print_missing_fields`** is what `GET /sale-notes/{id}/pdf` would refuse with right now — the SAME `{ variable, label, fix, contact_id? }` list as its 409 `details.missing_fields` — so a screen can ask for the buyer’s domicilio while the buyer is still at the counter. `[]` when the note prints, and always `[]` on a voided note.
|
|
38333
|
+
*
|
|
38332
38334
|
* **`trade_ins` names the cars taken in part-exchange** (ERP S9-6) — one entry per car with the line’s own id (never the vehicle’s: BR-457), the `vehicle_id`, the `precio_toma_clp` allowed for it, and the `acquisition_id` of the `vehicle_acquisition` that arrival created. That is the SALE → UNIT direction; the UNIT → SALE direction needs no surface here, because `vehicle_acquisition.sale_note_id` is projected on every read of `GET /vehicle-acquisitions?vehicle_id=`. `acquisition_id` is `null` once the document has been VOIDED — a void retracts the arrival and keeps the line, so the null says exactly what happened: this credit was agreed, and the arrival it caused has been withdrawn.
|
|
38333
38335
|
*
|
|
38334
38336
|
* **`credit` is the LIVE brokered credit, or `null`** (ERP S9-7) — the `institution` that is lending (BR-464 makes the financiera the credit’s identity on the document), the `amount_clp`, and its OWN `state`: `committed` (the bank has promised) or `disbursed` (the money has arrived, with `disbursed_at` / `disbursed_by` beside it). ⚠ **Both count the same in `funding`** (BR-463), so never read `funded` as "the cash is in" — read `credit.state` for that. The committed-vs-collected gap is exactly this pair of fields read side by side. ⚠ **The credit’s state is INDEPENDENT of the document’s `status`**: a voided nota de venta keeps its credit row untouched, and a disbursed credit does not make the document anything. Credits that were REPLACED or REMOVED are tombstoned and are deliberately not served here — they are history, not funding, and listing them beside the live one would invite a client to add them up.
|
|
@@ -38379,6 +38381,14 @@ interface paths {
|
|
|
38379
38381
|
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
38380
38382
|
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
38381
38383
|
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
38384
|
+
* "print_missing_fields": [
|
|
38385
|
+
* {
|
|
38386
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
38387
|
+
* "label": "Domicilio del comprador",
|
|
38388
|
+
* "fix": "buyer_contact",
|
|
38389
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
38390
|
+
* }
|
|
38391
|
+
* ],
|
|
38382
38392
|
* "payments": [
|
|
38383
38393
|
* {
|
|
38384
38394
|
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
@@ -38593,6 +38603,14 @@ interface paths {
|
|
|
38593
38603
|
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
38594
38604
|
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
38595
38605
|
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
38606
|
+
* "print_missing_fields": [
|
|
38607
|
+
* {
|
|
38608
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
38609
|
+
* "label": "Domicilio del comprador",
|
|
38610
|
+
* "fix": "buyer_contact",
|
|
38611
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
38612
|
+
* }
|
|
38613
|
+
* ],
|
|
38596
38614
|
* "payments": [
|
|
38597
38615
|
* {
|
|
38598
38616
|
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
@@ -73807,6 +73825,227 @@ interface paths {
|
|
|
73807
73825
|
patch?: never;
|
|
73808
73826
|
trace?: never;
|
|
73809
73827
|
};
|
|
73828
|
+
"/finanzas/connections/sync": {
|
|
73829
|
+
parameters: {
|
|
73830
|
+
query?: never;
|
|
73831
|
+
header?: never;
|
|
73832
|
+
path?: never;
|
|
73833
|
+
cookie?: never;
|
|
73834
|
+
};
|
|
73835
|
+
/**
|
|
73836
|
+
* Freshness of the bank movements
|
|
73837
|
+
* @description When each bank link was last pulled, and whether a pull is queued. A read: it queues nothing. Poll it after `POST /finanzas/connections/sync` until `queued` is false, then reload. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
|
|
73838
|
+
*/
|
|
73839
|
+
get: {
|
|
73840
|
+
parameters: {
|
|
73841
|
+
query?: never;
|
|
73842
|
+
header?: never;
|
|
73843
|
+
path?: never;
|
|
73844
|
+
cookie?: never;
|
|
73845
|
+
};
|
|
73846
|
+
requestBody?: never;
|
|
73847
|
+
responses: {
|
|
73848
|
+
/** @description The freshness */
|
|
73849
|
+
200: {
|
|
73850
|
+
headers: {
|
|
73851
|
+
[name: string]: unknown;
|
|
73852
|
+
};
|
|
73853
|
+
content: {
|
|
73854
|
+
/**
|
|
73855
|
+
* @example {
|
|
73856
|
+
* "data": {
|
|
73857
|
+
* "last_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73858
|
+
* "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73859
|
+
* "queued": true,
|
|
73860
|
+
* "enqueued": 0,
|
|
73861
|
+
* "links": [
|
|
73862
|
+
* {
|
|
73863
|
+
* "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
|
|
73864
|
+
* "institution_name": "Banco de Chile",
|
|
73865
|
+
* "last_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73866
|
+
* "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73867
|
+
* "queued": true,
|
|
73868
|
+
* "next_refresh_at": "2026-10-30T09:15:00.000Z",
|
|
73869
|
+
* "skipped": null
|
|
73870
|
+
* }
|
|
73871
|
+
* ],
|
|
73872
|
+
* "min_interval_minutes": 15
|
|
73873
|
+
* }
|
|
73874
|
+
* }
|
|
73875
|
+
*/
|
|
73876
|
+
"application/json": {
|
|
73877
|
+
data: components["schemas"]["FinanzasBankPull"];
|
|
73878
|
+
};
|
|
73879
|
+
};
|
|
73880
|
+
};
|
|
73881
|
+
/** @description Validation error */
|
|
73882
|
+
400: {
|
|
73883
|
+
headers: {
|
|
73884
|
+
[name: string]: unknown;
|
|
73885
|
+
};
|
|
73886
|
+
content: {
|
|
73887
|
+
"application/json": components["schemas"]["Error"];
|
|
73888
|
+
};
|
|
73889
|
+
};
|
|
73890
|
+
/** @description Unauthorized */
|
|
73891
|
+
401: {
|
|
73892
|
+
headers: {
|
|
73893
|
+
[name: string]: unknown;
|
|
73894
|
+
};
|
|
73895
|
+
content: {
|
|
73896
|
+
"application/json": components["schemas"]["Error"];
|
|
73897
|
+
};
|
|
73898
|
+
};
|
|
73899
|
+
/** @description Forbidden */
|
|
73900
|
+
403: {
|
|
73901
|
+
headers: {
|
|
73902
|
+
[name: string]: unknown;
|
|
73903
|
+
};
|
|
73904
|
+
content: {
|
|
73905
|
+
"application/json": components["schemas"]["Error"];
|
|
73906
|
+
};
|
|
73907
|
+
};
|
|
73908
|
+
/** @description Not found */
|
|
73909
|
+
404: {
|
|
73910
|
+
headers: {
|
|
73911
|
+
[name: string]: unknown;
|
|
73912
|
+
};
|
|
73913
|
+
content: {
|
|
73914
|
+
"application/json": components["schemas"]["Error"];
|
|
73915
|
+
};
|
|
73916
|
+
};
|
|
73917
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
73918
|
+
409: {
|
|
73919
|
+
headers: {
|
|
73920
|
+
[name: string]: unknown;
|
|
73921
|
+
};
|
|
73922
|
+
content: {
|
|
73923
|
+
"application/json": components["schemas"]["Error"];
|
|
73924
|
+
};
|
|
73925
|
+
};
|
|
73926
|
+
/** @description Rate limited */
|
|
73927
|
+
429: {
|
|
73928
|
+
headers: {
|
|
73929
|
+
[name: string]: unknown;
|
|
73930
|
+
};
|
|
73931
|
+
content: {
|
|
73932
|
+
"application/json": components["schemas"]["Error"];
|
|
73933
|
+
};
|
|
73934
|
+
};
|
|
73935
|
+
};
|
|
73936
|
+
};
|
|
73937
|
+
put?: never;
|
|
73938
|
+
/**
|
|
73939
|
+
* Sync every bank link
|
|
73940
|
+
* @description Sync on entry to Finanzas and «Sincronizar ahora» for every bank link. Idempotent, never throttled: each active link not pulled nor requested in the last `min_interval_minutes` (15) gets one pull, the others answer with their last pull (`enqueued` counts the pulls this call queued). A `login_required` or disconnected link is skipped and reported in `links[].skipped`. Movements land within a minute or two; poll `GET /finanzas/connections/sync` until `queued` is false. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
|
|
73941
|
+
*/
|
|
73942
|
+
post: {
|
|
73943
|
+
parameters: {
|
|
73944
|
+
query?: never;
|
|
73945
|
+
header?: {
|
|
73946
|
+
/** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
|
|
73947
|
+
"Idempotency-Key"?: string;
|
|
73948
|
+
};
|
|
73949
|
+
path?: never;
|
|
73950
|
+
cookie?: never;
|
|
73951
|
+
};
|
|
73952
|
+
requestBody?: never;
|
|
73953
|
+
responses: {
|
|
73954
|
+
/** @description The freshness after the request */
|
|
73955
|
+
200: {
|
|
73956
|
+
headers: {
|
|
73957
|
+
[name: string]: unknown;
|
|
73958
|
+
};
|
|
73959
|
+
content: {
|
|
73960
|
+
/**
|
|
73961
|
+
* @example {
|
|
73962
|
+
* "data": {
|
|
73963
|
+
* "last_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73964
|
+
* "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73965
|
+
* "queued": true,
|
|
73966
|
+
* "enqueued": 1,
|
|
73967
|
+
* "links": [
|
|
73968
|
+
* {
|
|
73969
|
+
* "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
|
|
73970
|
+
* "institution_name": "Banco de Chile",
|
|
73971
|
+
* "last_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73972
|
+
* "last_successful_sync_at": "2026-10-30T08:00:00.000Z",
|
|
73973
|
+
* "queued": true,
|
|
73974
|
+
* "next_refresh_at": "2026-10-30T09:15:00.000Z",
|
|
73975
|
+
* "skipped": null
|
|
73976
|
+
* }
|
|
73977
|
+
* ],
|
|
73978
|
+
* "min_interval_minutes": 15
|
|
73979
|
+
* }
|
|
73980
|
+
* }
|
|
73981
|
+
*/
|
|
73982
|
+
"application/json": {
|
|
73983
|
+
data: components["schemas"]["FinanzasBankPull"];
|
|
73984
|
+
};
|
|
73985
|
+
};
|
|
73986
|
+
};
|
|
73987
|
+
/** @description Validation error */
|
|
73988
|
+
400: {
|
|
73989
|
+
headers: {
|
|
73990
|
+
[name: string]: unknown;
|
|
73991
|
+
};
|
|
73992
|
+
content: {
|
|
73993
|
+
"application/json": components["schemas"]["Error"];
|
|
73994
|
+
};
|
|
73995
|
+
};
|
|
73996
|
+
/** @description Unauthorized */
|
|
73997
|
+
401: {
|
|
73998
|
+
headers: {
|
|
73999
|
+
[name: string]: unknown;
|
|
74000
|
+
};
|
|
74001
|
+
content: {
|
|
74002
|
+
"application/json": components["schemas"]["Error"];
|
|
74003
|
+
};
|
|
74004
|
+
};
|
|
74005
|
+
/** @description Forbidden */
|
|
74006
|
+
403: {
|
|
74007
|
+
headers: {
|
|
74008
|
+
[name: string]: unknown;
|
|
74009
|
+
};
|
|
74010
|
+
content: {
|
|
74011
|
+
"application/json": components["schemas"]["Error"];
|
|
74012
|
+
};
|
|
74013
|
+
};
|
|
74014
|
+
/** @description Not found */
|
|
74015
|
+
404: {
|
|
74016
|
+
headers: {
|
|
74017
|
+
[name: string]: unknown;
|
|
74018
|
+
};
|
|
74019
|
+
content: {
|
|
74020
|
+
"application/json": components["schemas"]["Error"];
|
|
74021
|
+
};
|
|
74022
|
+
};
|
|
74023
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
74024
|
+
409: {
|
|
74025
|
+
headers: {
|
|
74026
|
+
[name: string]: unknown;
|
|
74027
|
+
};
|
|
74028
|
+
content: {
|
|
74029
|
+
"application/json": components["schemas"]["Error"];
|
|
74030
|
+
};
|
|
74031
|
+
};
|
|
74032
|
+
/** @description Rate limited */
|
|
74033
|
+
429: {
|
|
74034
|
+
headers: {
|
|
74035
|
+
[name: string]: unknown;
|
|
74036
|
+
};
|
|
74037
|
+
content: {
|
|
74038
|
+
"application/json": components["schemas"]["Error"];
|
|
74039
|
+
};
|
|
74040
|
+
};
|
|
74041
|
+
};
|
|
74042
|
+
};
|
|
74043
|
+
delete?: never;
|
|
74044
|
+
options?: never;
|
|
74045
|
+
head?: never;
|
|
74046
|
+
patch?: never;
|
|
74047
|
+
trace?: never;
|
|
74048
|
+
};
|
|
73810
74049
|
"/finanzas/connections/{id}/sync": {
|
|
73811
74050
|
parameters: {
|
|
73812
74051
|
query?: never;
|
|
@@ -95040,7 +95279,8 @@ interface paths {
|
|
|
95040
95279
|
* "label": "septiembre 2026",
|
|
95041
95280
|
* "equilibrio_clp": 44600000,
|
|
95042
95281
|
* "sin_calculo": null,
|
|
95043
|
-
* "produccion": null
|
|
95282
|
+
* "produccion": null,
|
|
95283
|
+
* "skipped_incompleto": null
|
|
95044
95284
|
* },
|
|
95045
95285
|
* "target_clp": 44600000,
|
|
95046
95286
|
* "cobertura_pct": 92.4,
|
|
@@ -282032,6 +282272,25 @@ interface components {
|
|
|
282032
282272
|
exchange_token?: string;
|
|
282033
282273
|
link_token?: string;
|
|
282034
282274
|
};
|
|
282275
|
+
FinanzasBankPullLink: {
|
|
282276
|
+
/** Format: uuid */
|
|
282277
|
+
id: string;
|
|
282278
|
+
institution_name: string | null;
|
|
282279
|
+
last_sync_at: string | null;
|
|
282280
|
+
last_successful_sync_at: string | null;
|
|
282281
|
+
queued: boolean;
|
|
282282
|
+
next_refresh_at: string | null;
|
|
282283
|
+
/** @enum {string|null} */
|
|
282284
|
+
skipped: "login_required" | "disconnected" | null;
|
|
282285
|
+
};
|
|
282286
|
+
FinanzasBankPull: {
|
|
282287
|
+
last_sync_at: string | null;
|
|
282288
|
+
last_successful_sync_at: string | null;
|
|
282289
|
+
queued: boolean;
|
|
282290
|
+
enqueued: number;
|
|
282291
|
+
links: components["schemas"]["FinanzasBankPullLink"][];
|
|
282292
|
+
min_interval_minutes: number;
|
|
282293
|
+
};
|
|
282035
282294
|
FinanzasSyncResult: {
|
|
282036
282295
|
/** @enum {boolean} */
|
|
282037
282296
|
enqueued: true;
|
|
@@ -282427,7 +282686,7 @@ interface components {
|
|
|
282427
282686
|
* @description Finanzas 36: set when the bank text names nobody and the movement has no Contraparte: show it as the title with the sub-line «Sin contraparte».
|
|
282428
282687
|
* @enum {string|null}
|
|
282429
282688
|
*/
|
|
282430
|
-
generic_label: "Depósito en efectivo" | "Pago recibido" | "Depósito con cheque" | null;
|
|
282689
|
+
generic_label: "Depósito en efectivo" | "Pago recibido" | "Depósito con cheque" | "Pago de tarjeta de crédito" | null;
|
|
282431
282690
|
created_at: string;
|
|
282432
282691
|
};
|
|
282433
282692
|
FinanzasDocument: {
|
|
@@ -285704,6 +285963,13 @@ interface components {
|
|
|
285704
285963
|
equilibrio_clp: number;
|
|
285705
285964
|
}[];
|
|
285706
285965
|
produccion: components["schemas"]["FinanzasEquilibrioProduccion"];
|
|
285966
|
+
/** @description The newest «Mes incompleto» the bar skipped, so the card can flag it like Resultado and Costos do. Null when no month was skipped. */
|
|
285967
|
+
skipped_incompleto: {
|
|
285968
|
+
month: string;
|
|
285969
|
+
label: string;
|
|
285970
|
+
/** @description Spanish, ready for the tooltip. */
|
|
285971
|
+
message: string;
|
|
285972
|
+
} | null;
|
|
285707
285973
|
} | null;
|
|
285708
285974
|
/** @description The break-even on the same terms as `basis`: `equilibrio.produccion.equilibrio_clp` when `basis` is `produccion` and a ratio exists, else `equilibrio.equilibrio_clp`. Null without a break-even. */
|
|
285709
285975
|
target_clp: number | null;
|
package/package.json
CHANGED