@vitrina/api 17.25.1 → 17.27.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.
Files changed (3) hide show
  1. package/dist/index.d.cts +852 -119
  2. package/dist/index.d.ts +852 -119
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -38152,7 +38152,7 @@ interface paths {
38152
38152
  buyer_contact_id?: string | null;
38153
38153
  lead_id?: string | null;
38154
38154
  /** @enum {string} */
38155
- seller_of_record: "consignante" | "retoma" | "automotora";
38155
+ seller_of_record?: "consignante" | "retoma" | "automotora";
38156
38156
  /** Format: uuid */
38157
38157
  salesperson_id?: string | null;
38158
38158
  participations?: {
@@ -38327,6 +38327,8 @@ interface paths {
38327
38327
  *
38328
38328
  * **`timeline` says who did what, by name** (ADR 0114 §4): one entry per step that happened, in the order the document lives them — `emitted` (`issued_at`, `emitted_by`), `approved`, `printed` (the compraventa in force) and `voided` — each with its instant and its `actor` (`{ id, name, kind }`, `kind` = `member` or `api_key`). `actor` is `null` when the document does not record who did it (a note emitted before `emitted_by` existed); `actor.name` is `null` when that person has no name on file. Show either in words — never as an anonymous teammate. Approval is a separate step under `sale_notes:write`, so the emitter and the approver are often different people.
38329
38329
  *
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
+ *
38330
38332
  * **`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.
38331
38333
  *
38332
38334
  * **`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.
@@ -38376,6 +38378,7 @@ interface paths {
38376
38378
  * "voided_by": null,
38377
38379
  * "created_at": "2026-09-19T13:00:00.000Z",
38378
38380
  * "updated_at": "2026-09-19T13:00:00.000Z",
38381
+ * "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
38379
38382
  * "payments": [
38380
38383
  * {
38381
38384
  * "id": "d6d6d6d6-0000-4000-8000-000000000002",
@@ -38589,6 +38592,7 @@ interface paths {
38589
38592
  * "voided_by": null,
38590
38593
  * "created_at": "2026-09-19T13:00:00.000Z",
38591
38594
  * "updated_at": "2026-09-19T13:00:00.000Z",
38595
+ * "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
38592
38596
  * "payments": [
38593
38597
  * {
38594
38598
  * "id": "d6d6d6d6-0000-4000-8000-000000000002",
@@ -45719,7 +45723,7 @@ interface paths {
45719
45723
  */
45720
45724
  "application/json": {
45721
45725
  /** @enum {string} */
45722
- seller_of_record: "consignante" | "retoma" | "automotora";
45726
+ seller_of_record?: "consignante" | "retoma" | "automotora";
45723
45727
  /** @enum {string} */
45724
45728
  tax_treatment: "afecto" | "exento" | "no_gravado" | "pass_through";
45725
45729
  tax_clp?: number | null;
@@ -77539,7 +77543,8 @@ interface paths {
77539
77543
  * "holder_name": "Clínica Ejemplo SpA",
77540
77544
  * "holder_rut": "76123456-7",
77541
77545
  * "holder_email": null,
77542
- * "account_type": "corriente"
77546
+ * "account_type": "corriente",
77547
+ * "holder_not_company": false
77543
77548
  * },
77544
77549
  * "can_share_with_agent": true
77545
77550
  * }
@@ -77808,7 +77813,8 @@ interface paths {
77808
77813
  * "holder_name": "Clínica Ejemplo SpA",
77809
77814
  * "holder_rut": "76123456-7",
77810
77815
  * "holder_email": null,
77811
- * "account_type": "corriente"
77816
+ * "account_type": "corriente",
77817
+ * "holder_not_company": false
77812
77818
  * },
77813
77819
  * "can_share_with_agent": true
77814
77820
  * }
@@ -77887,7 +77893,7 @@ interface paths {
77887
77893
  get?: never;
77888
77894
  /**
77889
77895
  * Share a bank account with the AI agent (or stop)
77890
- * @description One bank-account registry (Finanzas 33): the Finanzas bank accounts are the workspace's accounts, and «el agente comparte esta cuenta» is a flag on one of them. `shared: true` makes the AI agent dictate this account for transfers and matches abonos into it (the same registry `GET /tenant-bank-accounts` lists); `false` stops it, keeping the row. The first share needs `holder_name` (400 `VALIDATION_ERROR`, `details.reason = agent_sharing_holder_required`); `holder_rut` defaults to the workspace's SII RUT. 409 `CONFLICT` with `details.reason = agent_sharing_not_supported` for a card, a credit line, a USD account or a number known only by its last digits. Audited. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
77896
+ * @description One bank-account registry (Finanzas 33): the Finanzas bank accounts are the workspace's accounts, and «el agente comparte esta cuenta» is a flag on one of them. `shared: true` makes the AI agent dictate this account for transfers and matches abonos into it (the same registry `GET /tenant-bank-accounts` lists); `false` stops it, keeping the row. The first share needs `holder_name` (400 `VALIDATION_ERROR`, `details.reason = agent_sharing_holder_required`); `holder_rut` defaults to the workspace's SII RUT. 409 `CONFLICT` with `details.reason = agent_sharing_not_supported` for a card, a credit line, a USD account or a number known only by its last digits. Turning sharing on for a holder whose RUT is not the company's needs `confirm_holder_not_company: true` (409 `CONFLICT`, `details.reason = agent_sharing_holder_not_company`, naming the holder); only send the flag after the human has explicitly agreed to share an account held by someone other than the company, and never retry the call with it on your own; an account already shared is never blocked or unshared. Audited. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
77891
77897
  *
77892
77898
  * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
77893
77899
  */
@@ -77945,7 +77951,8 @@ interface paths {
77945
77951
  * "holder_name": "Clínica Ejemplo SpA",
77946
77952
  * "holder_rut": "76123456-7",
77947
77953
  * "holder_email": null,
77948
- * "account_type": "corriente"
77954
+ * "account_type": "corriente",
77955
+ * "holder_not_company": false
77949
77956
  * },
77950
77957
  * "can_share_with_agent": true
77951
77958
  * }
@@ -78028,7 +78035,7 @@ interface paths {
78028
78035
  };
78029
78036
  /**
78030
78037
  * List documents (compras, ventas, honorarios, gastos, F29)
78031
- * @description The Documentos register: every document the workspace has money on, one list filtered by `kind` — `purchase` (Compras, from the SII registro de compras), `sale` (Ventas: the SII registro de ventas and what was emitted through Vitrina), `honorario`, `manual_expense`, `tax` (F29). Each carries its Contraparte, DTE type, folio, issue date, net / IVA / exempt / total in whole CLP, due date and payment state; a nota de crédito or débito carries the document it adjusts. Filter by `period` (`YYYY-MM`) or `from`/`to`, Contraparte, payment state, DTE type, source, or `q` (a folio, a name or a RUT). Newest first, offset-paginated; `meta.counts_by_kind` counts the same filters per kind. The SII documents sync daily in the background. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
78038
+ * @description The Documentos register: every document the workspace has money on, one list filtered by `kind` — `purchase` (Compras, from the SII registro de compras), `sale` (Ventas: the SII registro de ventas and what was emitted through Vitrina), `honorario`, `manual_expense`, `tax` (F29). Each carries its Contraparte, DTE type, folio, issue date, net / IVA / exempt / total in whole CLP, due date and payment state; a nota de crédito or débito carries the document it adjusts. Filter by `period` (`YYYY-MM`) or `from`/`to`, Contraparte, payment state, DTE type, source, or `q` (a folio, a name or a RUT); `paid_before_vitrina=true` is the «Heredado» filter (Finanzas 50). Newest first, offset-paginated; `meta.counts_by_kind` counts the same filters per kind. The SII documents sync daily in the background. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
78032
78039
  */
78033
78040
  get: {
78034
78041
  parameters: {
@@ -78041,6 +78048,7 @@ interface paths {
78041
78048
  to?: string;
78042
78049
  contraparte_id?: string;
78043
78050
  payment_state?: "por_pagar" | "parcial" | "pagado" | "vencido_heredado";
78051
+ paid_before_vitrina?: "true" | "false";
78044
78052
  dte_type?: number;
78045
78053
  q?: string;
78046
78054
  limit?: number;
@@ -78089,6 +78097,7 @@ interface paths {
78089
78097
  * },
78090
78098
  * "due_date": null,
78091
78099
  * "payment_state": "por_pagar",
78100
+ * "settlement": null,
78092
78101
  * "sii_estado_contable": "REGISTRO",
78093
78102
  * "missing_at_sii": false,
78094
78103
  * "voided": false,
@@ -78262,6 +78271,7 @@ interface paths {
78262
78271
  * },
78263
78272
  * "due_date": "2026-10-20",
78264
78273
  * "payment_state": "por_pagar",
78274
+ * "settlement": null,
78265
78275
  * "sii_estado_contable": null,
78266
78276
  * "missing_at_sii": false,
78267
78277
  * "voided": false,
@@ -78795,6 +78805,7 @@ interface paths {
78795
78805
  * },
78796
78806
  * "due_date": null,
78797
78807
  * "payment_state": "por_pagar",
78808
+ * "settlement": null,
78798
78809
  * "sii_estado_contable": "REGISTRO",
78799
78810
  * "missing_at_sii": false,
78800
78811
  * "voided": false,
@@ -78953,6 +78964,7 @@ interface paths {
78953
78964
  * },
78954
78965
  * "due_date": null,
78955
78966
  * "payment_state": "por_pagar",
78967
+ * "settlement": null,
78956
78968
  * "sii_estado_contable": null,
78957
78969
  * "missing_at_sii": false,
78958
78970
  * "voided": false,
@@ -79688,6 +79700,7 @@ interface paths {
79688
79700
  * },
79689
79701
  * "due_date": null,
79690
79702
  * "payment_state": "por_pagar",
79703
+ * "settlement": null,
79691
79704
  * "sii_estado_contable": null,
79692
79705
  * "missing_at_sii": false,
79693
79706
  * "voided": false,
@@ -79835,6 +79848,154 @@ interface paths {
79835
79848
  patch?: never;
79836
79849
  trace?: never;
79837
79850
  };
79851
+ "/finanzas/documents/{id}/reopen": {
79852
+ parameters: {
79853
+ query?: never;
79854
+ header?: never;
79855
+ path?: never;
79856
+ cookie?: never;
79857
+ };
79858
+ get?: never;
79859
+ put?: never;
79860
+ /**
79861
+ * Reopen a settled document («Reabrir»)
79862
+ * @description Undoes what settled a document without a bank link (`settlement`): «Pagado antes de Vitrina» (a document from a period closed before Vitrina, still open there) or a person's «Marcar pagada». From then on it is an open document like any other: its state follows its reconciliation links, it enters the cash projection or «Vencidas sin pago visto», and the import never settles it again. Resultado and the Contador do not move (they never read the payment state). Idempotent: an open document answers `reopened: false`. Reopening a document a person marked anulado in a closed month needs `?adjustment_reason=` (else 409 `FINANZAS_PERIOD_CLOSED`). Audited. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
79863
+ */
79864
+ post: {
79865
+ parameters: {
79866
+ query?: {
79867
+ adjustment_reason?: string;
79868
+ };
79869
+ header?: {
79870
+ /** @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. */
79871
+ "Idempotency-Key"?: string;
79872
+ };
79873
+ path: {
79874
+ id: string;
79875
+ };
79876
+ cookie?: never;
79877
+ };
79878
+ requestBody?: never;
79879
+ responses: {
79880
+ /** @description Reopened (or already open) */
79881
+ 200: {
79882
+ headers: {
79883
+ [name: string]: unknown;
79884
+ };
79885
+ content: {
79886
+ /**
79887
+ * @example {
79888
+ * "data": {
79889
+ * "reopened": true,
79890
+ * "document": {
79891
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4a5b",
79892
+ * "kind": "purchase",
79893
+ * "source": "sii",
79894
+ * "dte_type": 33,
79895
+ * "dte_type_label": "Factura electrónica",
79896
+ * "is_credit_note": false,
79897
+ * "folio": "45",
79898
+ * "issue_date": "2026-10-10",
79899
+ * "period": "2026-10",
79900
+ * "received_on": "2026-10-11",
79901
+ * "issuer_rut_formatted": "76.086.428-5",
79902
+ * "receiver_rut_formatted": "76.543.219-4",
79903
+ * "counterparty_name": "Laboratorio Andes SpA",
79904
+ * "contraparte": {
79905
+ * "id": "0190a3c2-6a2b-7c3d-8e4f-5a6b7c8d9e0f",
79906
+ * "name": "Laboratorio Andes SpA",
79907
+ * "rut_formatted": "76.086.428-5"
79908
+ * },
79909
+ * "amounts": {
79910
+ * "net": 10000,
79911
+ * "exempt": 0,
79912
+ * "iva": 1900,
79913
+ * "other_taxes": 0,
79914
+ * "total": 11900
79915
+ * },
79916
+ * "due_date": null,
79917
+ * "payment_state": "por_pagar",
79918
+ * "settlement": null,
79919
+ * "sii_estado_contable": "REGISTRO",
79920
+ * "missing_at_sii": false,
79921
+ * "voided": false,
79922
+ * "adjusts": null,
79923
+ * "f29": null,
79924
+ * "honorario": null,
79925
+ * "created_at": "2026-10-30T05:31:12.000Z",
79926
+ * "updated_at": "2026-10-30T05:31:12.000Z",
79927
+ * "adjusted_by": []
79928
+ * }
79929
+ * }
79930
+ * }
79931
+ */
79932
+ "application/json": {
79933
+ data: components["schemas"]["FinanzasDocumentReopenResult"];
79934
+ };
79935
+ };
79936
+ };
79937
+ /** @description Validation error */
79938
+ 400: {
79939
+ headers: {
79940
+ [name: string]: unknown;
79941
+ };
79942
+ content: {
79943
+ "application/json": components["schemas"]["Error"];
79944
+ };
79945
+ };
79946
+ /** @description Unauthorized */
79947
+ 401: {
79948
+ headers: {
79949
+ [name: string]: unknown;
79950
+ };
79951
+ content: {
79952
+ "application/json": components["schemas"]["Error"];
79953
+ };
79954
+ };
79955
+ /** @description Forbidden */
79956
+ 403: {
79957
+ headers: {
79958
+ [name: string]: unknown;
79959
+ };
79960
+ content: {
79961
+ "application/json": components["schemas"]["Error"];
79962
+ };
79963
+ };
79964
+ /** @description Not found */
79965
+ 404: {
79966
+ headers: {
79967
+ [name: string]: unknown;
79968
+ };
79969
+ content: {
79970
+ "application/json": components["schemas"]["Error"];
79971
+ };
79972
+ };
79973
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
79974
+ 409: {
79975
+ headers: {
79976
+ [name: string]: unknown;
79977
+ };
79978
+ content: {
79979
+ "application/json": components["schemas"]["Error"];
79980
+ };
79981
+ };
79982
+ /** @description Rate limited */
79983
+ 429: {
79984
+ headers: {
79985
+ [name: string]: unknown;
79986
+ };
79987
+ content: {
79988
+ "application/json": components["schemas"]["Error"];
79989
+ };
79990
+ };
79991
+ };
79992
+ };
79993
+ delete?: never;
79994
+ options?: never;
79995
+ head?: never;
79996
+ patch?: never;
79997
+ trace?: never;
79998
+ };
79838
79999
  "/finanzas/inbox": {
79839
80000
  parameters: {
79840
80001
  query?: never;
@@ -84051,7 +84212,7 @@ interface paths {
84051
84212
  get: {
84052
84213
  parameters: {
84053
84214
  query?: {
84054
- kind?: "reconcile" | "transfer" | "classify" | "missing_document" | "unknown" | "ads_charge";
84215
+ kind?: "reconcile" | "transfer" | "classify" | "missing_document" | "unknown" | "ads_charge" | "merge";
84055
84216
  limit?: number;
84056
84217
  offset?: number | null;
84057
84218
  period?: "recent" | "history" | "all";
@@ -84211,11 +84372,13 @@ interface paths {
84211
84372
  };
84212
84373
  /**
84213
84374
  * «Te necesita»: how many cases are open
84214
- * @description The Resumen’s third answer: open cases, the money at stake and the count per kind. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
84375
+ * @description The one count of open work (Finanzas 47): open cases, the money at stake and the count per kind. Resumen, Por resolver, Movimientos, Cierre de mes and the weekly digest show this same number for the same scope. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
84215
84376
  */
84216
84377
  get: {
84217
84378
  parameters: {
84218
- query?: never;
84379
+ query?: {
84380
+ month?: string;
84381
+ };
84219
84382
  header?: never;
84220
84383
  path?: never;
84221
84384
  cookie?: never;
@@ -84386,6 +84549,7 @@ interface paths {
84386
84549
  * "issue_date": "2026-09-12",
84387
84550
  * "due_date": "2026-10-12",
84388
84551
  * "total_clp": 412690,
84552
+ * "gross_clp": 412690,
84389
84553
  * "outstanding_clp": 412690,
84390
84554
  * "counterparty_name": "Laboratorio Dental Andes Ltda",
84391
84555
  * "role": "candidate",
@@ -84399,6 +84563,7 @@ interface paths {
84399
84563
  * "issue_date": "2026-09-26",
84400
84564
  * "due_date": "2026-10-26",
84401
84565
  * "total_clp": 362600,
84566
+ * "gross_clp": 362600,
84402
84567
  * "outstanding_clp": 362600,
84403
84568
  * "counterparty_name": "Laboratorio Dental Andes Ltda",
84404
84569
  * "role": "candidate",
@@ -84986,6 +85151,116 @@ interface paths {
84986
85151
  patch?: never;
84987
85152
  trace?: never;
84988
85153
  };
85154
+ "/finanzas/cases/{id}/dismiss": {
85155
+ parameters: {
85156
+ query?: never;
85157
+ header?: never;
85158
+ path?: never;
85159
+ cookie?: never;
85160
+ };
85161
+ get?: never;
85162
+ put?: never;
85163
+ /**
85164
+ * Dismiss a «unir» case («No son la misma»)
85165
+ * @description Finanzas 58, `merge` cases only (422 `not_a_merge_case` otherwise): the two Contrapartes are not the same. The pair is never proposed or merged again and the case closes. To merge them instead, use the confirm route. Audited. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
85166
+ */
85167
+ post: {
85168
+ parameters: {
85169
+ query?: {
85170
+ adjustment_reason?: string;
85171
+ };
85172
+ header?: {
85173
+ /** @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. */
85174
+ "Idempotency-Key"?: string;
85175
+ };
85176
+ path: {
85177
+ id: string;
85178
+ };
85179
+ cookie?: never;
85180
+ };
85181
+ requestBody?: never;
85182
+ responses: {
85183
+ /** @description Dismissed */
85184
+ 200: {
85185
+ headers: {
85186
+ [name: string]: unknown;
85187
+ };
85188
+ content: {
85189
+ /**
85190
+ * @example {
85191
+ * "data": {
85192
+ * "case_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4c01",
85193
+ * "next_case_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4c02"
85194
+ * }
85195
+ * }
85196
+ */
85197
+ "application/json": {
85198
+ data: components["schemas"]["FinanzasCaseDismissResult"];
85199
+ };
85200
+ };
85201
+ };
85202
+ /** @description Validation error */
85203
+ 400: {
85204
+ headers: {
85205
+ [name: string]: unknown;
85206
+ };
85207
+ content: {
85208
+ "application/json": components["schemas"]["Error"];
85209
+ };
85210
+ };
85211
+ /** @description Unauthorized */
85212
+ 401: {
85213
+ headers: {
85214
+ [name: string]: unknown;
85215
+ };
85216
+ content: {
85217
+ "application/json": components["schemas"]["Error"];
85218
+ };
85219
+ };
85220
+ /** @description Forbidden */
85221
+ 403: {
85222
+ headers: {
85223
+ [name: string]: unknown;
85224
+ };
85225
+ content: {
85226
+ "application/json": components["schemas"]["Error"];
85227
+ };
85228
+ };
85229
+ /** @description Not found */
85230
+ 404: {
85231
+ headers: {
85232
+ [name: string]: unknown;
85233
+ };
85234
+ content: {
85235
+ "application/json": components["schemas"]["Error"];
85236
+ };
85237
+ };
85238
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
85239
+ 409: {
85240
+ headers: {
85241
+ [name: string]: unknown;
85242
+ };
85243
+ content: {
85244
+ "application/json": components["schemas"]["Error"];
85245
+ };
85246
+ };
85247
+ /** @description Rate limited */
85248
+ 429: {
85249
+ headers: {
85250
+ [name: string]: unknown;
85251
+ };
85252
+ content: {
85253
+ "application/json": components["schemas"]["Error"];
85254
+ };
85255
+ };
85256
+ };
85257
+ };
85258
+ delete?: never;
85259
+ options?: never;
85260
+ head?: never;
85261
+ patch?: never;
85262
+ trace?: never;
85263
+ };
84989
85264
  "/finanzas/cases/no-document/{movement_id}": {
84990
85265
  parameters: {
84991
85266
  query?: never;
@@ -85936,6 +86211,7 @@ interface paths {
85936
86211
  * "state": "open",
85937
86212
  * "ended": false,
85938
86213
  * "open_cases": 7,
86214
+ * "open_cases_amount_clp": 2418300,
85939
86215
  * "closed_at": null,
85940
86216
  * "closed_by": null,
85941
86217
  * "closed_source": null,
@@ -85948,6 +86224,7 @@ interface paths {
85948
86224
  * "state": "closed",
85949
86225
  * "ended": true,
85950
86226
  * "open_cases": 0,
86227
+ * "open_cases_amount_clp": 0,
85951
86228
  * "closed_at": "2026-10-03T14:20:00.000Z",
85952
86229
  * "closed_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
85953
86230
  * "closed_source": "person",
@@ -85960,6 +86237,7 @@ interface paths {
85960
86237
  * "state": "ready_to_close",
85961
86238
  * "ended": true,
85962
86239
  * "open_cases": 0,
86240
+ * "open_cases_amount_clp": 0,
85963
86241
  * "closed_at": null,
85964
86242
  * "closed_by": null,
85965
86243
  * "closed_source": null,
@@ -86077,6 +86355,7 @@ interface paths {
86077
86355
  * "state": "closed",
86078
86356
  * "ended": true,
86079
86357
  * "open_cases": 0,
86358
+ * "open_cases_amount_clp": 0,
86080
86359
  * "closed_at": "2026-10-03T14:20:00.000Z",
86081
86360
  * "closed_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
86082
86361
  * "closed_source": "person",
@@ -86087,6 +86366,9 @@ interface paths {
86087
86366
  * "blocking_reason": "already_closed",
86088
86367
  * "checklist": {
86089
86368
  * "open_cases": 0,
86369
+ * "open_cases_amount_clp": 0,
86370
+ * "open_case_movements_count": 0,
86371
+ * "open_case_documents_count": 0,
86090
86372
  * "unreviewed_count": 4,
86091
86373
  * "unclassified_count": 0,
86092
86374
  * "unmatched_count": 0,
@@ -86282,6 +86564,7 @@ interface paths {
86282
86564
  * "state": "closed",
86283
86565
  * "ended": true,
86284
86566
  * "open_cases": 0,
86567
+ * "open_cases_amount_clp": 0,
86285
86568
  * "closed_at": "2026-10-03T14:20:00.000Z",
86286
86569
  * "closed_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
86287
86570
  * "closed_source": "person",
@@ -86292,6 +86575,9 @@ interface paths {
86292
86575
  * "blocking_reason": "already_closed",
86293
86576
  * "checklist": {
86294
86577
  * "open_cases": 0,
86578
+ * "open_cases_amount_clp": 0,
86579
+ * "open_case_movements_count": 0,
86580
+ * "open_case_documents_count": 0,
86295
86581
  * "unreviewed_count": 4,
86296
86582
  * "unclassified_count": 0,
86297
86583
  * "unmatched_count": 0,
@@ -86861,7 +87147,7 @@ interface paths {
86861
87147
  };
86862
87148
  /**
86863
87149
  * Mes en paralelo: the diff against Chipax for a month
86864
- * @description Balances (per bank account, at month end), payables (per Contraparte, open at month end) and costs (per costo / gasto account, NET as the Resultado counts) must match to the peso. Income is a bridge: Chipax counts it when cashed, Vitrina the documents issued in the month, so the gap is explained line by line. Vitrina's side is computed live; Chipax's side is the newest finished read. `clean` = all three match and the bridge is explained (the exit criterion). Each row's `key` drills down to its items. Rows list the differences first; `difference_count` of each section counts its rows that are not «Cuadra», and the headline `difference_count` is the sum of the sections with `in_headline` (the two reviews, `inherited_overdue` and `possible_duplicates`, are listed beside them and never counted in it). Before a finished read: `status` not_read / reading / failed and null dimensions. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» with no RUT and no glosa, on both sides; Chipax boletas carry neither RUT nor name. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read` and `finanzas_reports:read` (the Contador seat, owners and admins).
87150
+ * @description Balances (per bank account, at month end), payables (per Contraparte, open at month end) and costs (per costo / gasto account, NET as the Resultado counts) must match to the peso. Income is a bridge: Chipax counts it when cashed, Vitrina the documents issued in the month, so the gap is explained line by line. Vitrina's side is computed live; Chipax's side is the newest finished read. `clean` = all three match and the bridge is explained (the exit criterion). Each row's `key` drills down to its items. Rows list the differences first; `difference_count` of each section counts its rows that are not «Cuadra», and the headline `difference_count` is the sum of the sections with `in_headline` (the review `possible_duplicates` is listed beside them and never counted in it; `inherited_overdue` is retired, Finanzas 50, and no longer listed). Before a finished read: `status` not_read / reading / failed and null dimensions. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» with no RUT and no glosa, on both sides; Chipax boletas carry neither RUT nor name. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read` and `finanzas_reports:read` (the Contador seat, owners and admins).
86865
87151
  */
86866
87152
  get: {
86867
87153
  parameters: {
@@ -86925,11 +87211,6 @@ interface paths {
86925
87211
  * "in_headline": true
86926
87212
  * },
86927
87213
  * {
86928
- * "key": "inherited_overdue",
86929
- * "difference_count": 1135,
86930
- * "in_headline": false
86931
- * },
86932
- * {
86933
87214
  * "key": "possible_duplicates",
86934
87215
  * "difference_count": 2,
86935
87216
  * "in_headline": false
@@ -87091,7 +87372,7 @@ interface paths {
87091
87372
  /** @enum {string} */
87092
87373
  key: "balances" | "payables" | "costs" | "income" | "inherited_overdue" | "possible_duplicates";
87093
87374
  difference_count: number;
87094
- /** @description true for the four comparisons of Chipax against Vitrina; false for the two reviews (`inherited_overdue`: payables to resolve, see GET /finanzas/inherited-overdue; `possible_duplicates`: groups of repeated bank lines, see GET /finanzas/possible-duplicates), which are a to-do list. */
87375
+ /** @description true for the four comparisons of Chipax against Vitrina; false for the review `possible_duplicates` (groups of repeated bank lines, see GET /finanzas/possible-duplicates), which is a to-do list. `inherited_overdue` is retired (Finanzas 50: those payables are «Pagado antes de Vitrina») and never listed. */
87095
87376
  in_headline: boolean;
87096
87377
  }[];
87097
87378
  balances: {
@@ -87668,8 +87949,9 @@ interface paths {
87668
87949
  cookie?: never;
87669
87950
  };
87670
87951
  /**
87671
- * Vencido heredado: the payables to review
87672
- * @description The payables that arrived already more than 90 days overdue (`payment_state = vencido_heredado`): they are out of the cash-flow projection and the balances until someone marks them pagado or anulado. Each carries the open bank payment that most likely settled it (`suggested_match`: exact amount, a payment is suggested to one document only; `signal` says why). `summary` counts the whole filter, `items` is one page. Filter by Contraparte with `contraparte`. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» and no glosa on money in. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
87952
+ * Vencido heredado (retired): the payables to review
87953
+ * @deprecated
87954
+ * @description Retired (Finanzas 50): nothing writes «vencido heredado» any more; the payables it held are «Pagado antes de Vitrina» (GET /finanzas/documents?paid_before_vitrina=true), and only rows written before it in a workspace outside that backfill still show here. It listed the payables that arrived already more than 90 days overdue (`payment_state = vencido_heredado`): they are out of the cash-flow projection and the balances until someone marks them pagado or anulado. Each carries the open bank payment that most likely settled it (`suggested_match`: exact amount, a payment is suggested to one document only; `signal` says why). `summary` counts the whole filter, `items` is one page. Filter by Contraparte with `contraparte`. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» and no glosa on money in. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
87673
87955
  */
87674
87956
  get: {
87675
87957
  parameters: {
@@ -87875,8 +88157,9 @@ interface paths {
87875
88157
  get?: never;
87876
88158
  put?: never;
87877
88159
  /**
87878
- * Vencido heredado: mark pagado or anulado in bulk
87879
- * @description Resolves up to 500 inherited payables at once. `pagado`: it was settled; the document leaves the review as paid (no bank link is invented). `anulado`: it never has to be paid; the document is voided, so no report counts it. A document that is no longer inherited is skipped (`not_inherited`), never overwritten. One batch, one `batch_id`: it lands in the audit log (`finanzas.inherited_overdue.pagado` / `.anulado`) and `POST /finanzas/inherited-overdue/batches/{batchId}/undo` puts it back. «anulado» in a closed month needs `?adjustment_reason=` (409 `FINANZAS_PERIOD_CLOSED` otherwise). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
88160
+ * Vencido heredado (retired): mark pagado or anulado in bulk
88161
+ * @deprecated
88162
+ * @description Retired (Finanzas 50): only rows still «vencido heredado» (written before it, outside the Finanzas 50 backfill) can be resolved; anything else comes back skipped (`not_inherited`). It resolved up to 500 inherited payables at once. `pagado`: it was settled; the document leaves the review as paid (no bank link is invented). `anulado`: it never has to be paid; the document is voided, so no report counts it. A document that is no longer inherited is skipped (`not_inherited`), never overwritten. One batch, one `batch_id`: it lands in the audit log (`finanzas.inherited_overdue.pagado` / `.anulado`) and `POST /finanzas/inherited-overdue/batches/{batchId}/undo` puts it back. «anulado» in a closed month needs `?adjustment_reason=` (409 `FINANZAS_PERIOD_CLOSED` otherwise). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
87880
88163
  */
87881
88164
  post: {
87882
88165
  parameters: {
@@ -88035,8 +88318,8 @@ interface paths {
88035
88318
  get?: never;
88036
88319
  put?: never;
88037
88320
  /**
88038
- * Vencido heredado: undo a batch («Deshacer»)
88039
- * @description Puts the documents of a batch back to «vencido heredado» (a payment linked in the meantime wins and the state follows it). Pass `document_ids` to undo only some. Idempotent: what was already undone comes back in `skipped`. Audited as `finanzas.inherited_overdue.undo`. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
88321
+ * Undo a settle batch («Deshacer»)
88322
+ * @description Puts the documents of a settle batch (a person's «Marcar pagada», or a Mes en paralelo review) back as they were (a payment linked in the meantime wins and the state follows it). To reopen one document, POST /finanzas/documents/{id}/reopen. Pass `document_ids` to undo only some. Idempotent: what was already undone comes back in `skipped`. Audited as `finanzas.inherited_overdue.undo`. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
88040
88323
  */
88041
88324
  post: {
88042
88325
  parameters: {
@@ -88169,8 +88452,8 @@ interface paths {
88169
88452
  cookie?: never;
88170
88453
  };
88171
88454
  /**
88172
- * Vencido heredado: the batches already resolved
88173
- * @description Each bulk action, newest first, with how many of its documents are still resolved (`live_count`). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
88455
+ * Settle batches a person made
88456
+ * @description Each bulk action a person made («Marcar pagada», Mes en paralelo), newest first; «Pagado antes de Vitrina» is the import's, never listed here, with how many of its documents are still resolved (`live_count`). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
88174
88457
  */
88175
88458
  get: {
88176
88459
  parameters: {
@@ -90504,7 +90787,7 @@ interface paths {
90504
90787
  };
90505
90788
  /**
90506
90789
  * Flujo de caja: actual, projection, band and lowest point
90507
- * @description Per day (or ISO week): what came in and went out (actual, before today) and what is expected (projected, today on), with the closing balance of each period. The projection starts from today's balance of the operating accounts (every bank account except savings accounts) and adds known items on their dates: open payables and receivables by due date (outstanding = total − retención − live reconciliation links), the retención of honorarios received (due with the F29 on the 20th of the next month), recurring items, patient cuotas, booked appointments with a price, the efectivo por depositar (`cash_pending`, spread over its expected deposit days) and planned rescues. An overdue payable due in the last 90 days is placed today; older ones, the «vencido heredado» ones (`inherited_overdue`) and overdue receivables stay out (`overdue`). The lowest point (`lowest`) includes today's balance and is never above it (`lowest.is_today`). From tomorrow each day also earns its typical income: the median of that weekday's bank income over the last 90 days, counted only above the day's known income; `band` uses the weekday minimum and maximum instead. Past days are actual bank movements; transfers between operating accounts are neither in nor out. `lowest` is the lowest projected balance in the range (its `cause` = the biggest payment that day); `month_end` is the projected balance at the end of the current month («¿cuánto me queda a fin de mes?»), computed even when `to` is earlier. Range: up to a year back and a year ahead, at most 366 days. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_reports:read`.
90790
+ * @description Per day (or ISO week): what came in and went out (actual, before today) and what is expected (projected, today on), with the closing balance of each period. The projection starts from today's balance of the operating accounts (every bank account except savings accounts) and adds known items on their dates: open payables and receivables by due date (outstanding = total − retención − live reconciliation links), the retención of honorarios received (due with the F29 on the 20th of the next month), recurring items, patient cuotas, booked appointments with a price, the efectivo por depositar (`cash_pending`, spread over its expected deposit days) and planned rescues. That is the CONFIRMED balance (`closing_balance_clp`), the one every headline reads. A payable past its due date with no matching payment in the data is a «Vencida sin pago visto»: it stays out (`overdue_no_payment_seen`, the list at GET /finanzas/cash-flow/overdue-no-payment-seen) unless it was given a date with «Mover pagos»; overdue receivables stay out too (`overdue`). A document «Pagado antes de Vitrina» is settled and never projected (`inherited_overdue` is retired, always zero). The lowest point (`lowest`) includes today's balance and is never above it (`lowest.is_today`). `expected_balance_clp` («con cobros esperados», the dashed line) adds, from tomorrow, each day's typical income: the median of that weekday's bank income over the last 90 days, counted only above the day's known income. `band` is retired and always null. Past days are actual bank movements; transfers between operating accounts are neither in nor out. `lowest` is the lowest confirmed balance in the range (its `cause` = the payment at which the confirmed balance first goes below zero, else the biggest payment of that day); `month_end` is the projected balance at the end of the current month («¿cuánto me queda a fin de mes?»), computed even when `to` is earlier. Range: up to a year back and a year ahead, at most 366 days. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_reports:read`.
90508
90791
  */
90509
90792
  get: {
90510
90793
  parameters: {
@@ -90557,6 +90840,7 @@ interface paths {
90557
90840
  * "typical_inflow_clp": 0,
90558
90841
  * "outflow_clp": 698400,
90559
90842
  * "closing_balance_clp": 4617109,
90843
+ * "expected_balance_clp": 4617109,
90560
90844
  * "band": null,
90561
90845
  * "items_count": 0
90562
90846
  * },
@@ -90568,10 +90852,8 @@ interface paths {
90568
90852
  * "typical_inflow_clp": 0,
90569
90853
  * "outflow_clp": 412690,
90570
90854
  * "closing_balance_clp": 4624419,
90571
- * "band": {
90572
- * "low_clp": 4624419,
90573
- * "high_clp": 4624419
90574
- * },
90855
+ * "expected_balance_clp": 4624419,
90856
+ * "band": null,
90575
90857
  * "items_count": 2
90576
90858
  * },
90577
90859
  * {
@@ -90581,11 +90863,9 @@ interface paths {
90581
90863
  * "inflow_clp": 0,
90582
90864
  * "typical_inflow_clp": 1150000,
90583
90865
  * "outflow_clp": 0,
90584
- * "closing_balance_clp": 5774419,
90585
- * "band": {
90586
- * "low_clp": 5294419,
90587
- * "high_clp": 6104419
90588
- * },
90866
+ * "closing_balance_clp": 4624419,
90867
+ * "expected_balance_clp": 5774419,
90868
+ * "band": null,
90589
90869
  * "items_count": 0
90590
90870
  * },
90591
90871
  * {
@@ -90595,11 +90875,9 @@ interface paths {
90595
90875
  * "inflow_clp": 0,
90596
90876
  * "typical_inflow_clp": 0,
90597
90877
  * "outflow_clp": 0,
90598
- * "closing_balance_clp": 5774419,
90599
- * "band": {
90600
- * "low_clp": 5294419,
90601
- * "high_clp": 6104419
90602
- * },
90878
+ * "closing_balance_clp": 4624419,
90879
+ * "expected_balance_clp": 5774419,
90880
+ * "band": null,
90603
90881
  * "items_count": 0
90604
90882
  * }
90605
90883
  * ],
@@ -90608,15 +90886,14 @@ interface paths {
90608
90886
  * "balance_clp": 4624419,
90609
90887
  * "negative": false,
90610
90888
  * "is_today": false,
90611
- * "cause": null
90889
+ * "cause": null,
90890
+ * "cause_balance_after_clp": null
90612
90891
  * },
90613
90892
  * "month_end": {
90614
90893
  * "date": "2026-11-30",
90615
90894
  * "balance_clp": 2310000,
90616
- * "band": {
90617
- * "low_clp": 640000,
90618
- * "high_clp": 4020000
90619
- * }
90895
+ * "expected_balance_clp": 9410000,
90896
+ * "band": null
90620
90897
  * },
90621
90898
  * "totals": {
90622
90899
  * "actual_inflow_clp": 2412000,
@@ -90643,9 +90920,13 @@ interface paths {
90643
90920
  * "receivables_clp": 0,
90644
90921
  * "receivables_count": 0
90645
90922
  * },
90923
+ * "overdue_no_payment_seen": {
90924
+ * "count": 1,
90925
+ * "amount_clp": 412690
90926
+ * },
90646
90927
  * "inherited_overdue": {
90647
- * "count": 468,
90648
- * "amount_clp": 59722052
90928
+ * "count": 0,
90929
+ * "amount_clp": 0
90649
90930
  * },
90650
90931
  * "cash_pending": {
90651
90932
  * "amount_clp": 11648107,
@@ -90797,7 +91078,7 @@ interface paths {
90797
91078
  };
90798
91079
  /**
90799
91080
  * Payments calendar: what is due each day, balance after each
90800
- * @description The projected items from today, grouped by day, each with the expected balance right after it (money in first, then the biggest payments). The day's typical income lands after its items. `direction` keeps only money in or only payments (balances still count everything). The projection starts from today's balance of the operating accounts (every bank account except savings accounts) and adds known items on their dates: open payables and receivables by due date (outstanding = total − retención − live reconciliation links), the retención of honorarios received (due with the F29 on the 20th of the next month), recurring items, patient cuotas, booked appointments with a price, the efectivo por depositar (`cash_pending`, spread over its expected deposit days) and planned rescues. An overdue payable due in the last 90 days is placed today; older ones, the «vencido heredado» ones (`inherited_overdue`) and overdue receivables stay out (`overdue`). The lowest point (`lowest`) includes today's balance and is never above it (`lowest.is_today`). From tomorrow each day also earns its typical income: the median of that weekday's bank income over the last 90 days, counted only above the day's known income; `band` uses the weekday minimum and maximum instead. Past days are actual bank movements; transfers between operating accounts are neither in nor out. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_reports:read`.
91081
+ * @description The projected items from today, grouped by day, each with the expected balance right after it (money in first, then the biggest payments). The day's typical income lands after its items. `direction` keeps only money in or only payments (balances still count everything). The projection starts from today's balance of the operating accounts (every bank account except savings accounts) and adds known items on their dates: open payables and receivables by due date (outstanding = total − retención − live reconciliation links), the retención of honorarios received (due with the F29 on the 20th of the next month), recurring items, patient cuotas, booked appointments with a price, the efectivo por depositar (`cash_pending`, spread over its expected deposit days) and planned rescues. That is the CONFIRMED balance (`closing_balance_clp`), the one every headline reads. A payable past its due date with no matching payment in the data is a «Vencida sin pago visto»: it stays out (`overdue_no_payment_seen`, the list at GET /finanzas/cash-flow/overdue-no-payment-seen) unless it was given a date with «Mover pagos»; overdue receivables stay out too (`overdue`). A document «Pagado antes de Vitrina» is settled and never projected (`inherited_overdue` is retired, always zero). The lowest point (`lowest`) includes today's balance and is never above it (`lowest.is_today`). `expected_balance_clp` («con cobros esperados», the dashed line) adds, from tomorrow, each day's typical income: the median of that weekday's bank income over the last 90 days, counted only above the day's known income. `band` is retired and always null. Past days are actual bank movements; transfers between operating accounts are neither in nor out. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_reports:read`.
90801
91082
  */
90802
91083
  get: {
90803
91084
  parameters: {
@@ -90912,7 +91193,8 @@ interface paths {
90912
91193
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
90913
91194
  * "rescue_id": null,
90914
91195
  * "count": null
90915
- * }
91196
+ * },
91197
+ * "cause_balance_after_clp": -1840000
90916
91198
  * }
90917
91199
  * }
90918
91200
  * }
@@ -91073,15 +91355,14 @@ interface paths {
91073
91355
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
91074
91356
  * "rescue_id": null,
91075
91357
  * "count": null
91076
- * }
91358
+ * },
91359
+ * "cause_balance_after_clp": -1840000
91077
91360
  * },
91078
91361
  * "month_end": {
91079
91362
  * "date": "2026-11-30",
91080
91363
  * "balance_clp": 2310000,
91081
- * "band": {
91082
- * "low_clp": 640000,
91083
- * "high_clp": 4020000
91084
- * }
91364
+ * "expected_balance_clp": 9410000,
91365
+ * "band": null
91085
91366
  * }
91086
91367
  * },
91087
91368
  * "after": {
@@ -91106,15 +91387,14 @@ interface paths {
91106
91387
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
91107
91388
  * "rescue_id": null,
91108
91389
  * "count": null
91109
- * }
91390
+ * },
91391
+ * "cause_balance_after_clp": -1840000
91110
91392
  * },
91111
91393
  * "month_end": {
91112
91394
  * "date": "2026-11-30",
91113
91395
  * "balance_clp": 7410000,
91114
- * "band": {
91115
- * "low_clp": 640000,
91116
- * "high_clp": 4020000
91117
- * }
91396
+ * "expected_balance_clp": 9410000,
91397
+ * "band": null
91118
91398
  * }
91119
91399
  * },
91120
91400
  * "horizon": {
@@ -91259,15 +91539,14 @@ interface paths {
91259
91539
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
91260
91540
  * "rescue_id": null,
91261
91541
  * "count": null
91262
- * }
91542
+ * },
91543
+ * "cause_balance_after_clp": -1840000
91263
91544
  * },
91264
91545
  * "month_end": {
91265
91546
  * "date": "2026-11-30",
91266
91547
  * "balance_clp": 7410000,
91267
- * "band": {
91268
- * "low_clp": 640000,
91269
- * "high_clp": 4020000
91270
- * }
91548
+ * "expected_balance_clp": 9410000,
91549
+ * "band": null
91271
91550
  * }
91272
91551
  * },
91273
91552
  * "after": {
@@ -91292,15 +91571,14 @@ interface paths {
91292
91571
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
91293
91572
  * "rescue_id": null,
91294
91573
  * "count": null
91295
- * }
91574
+ * },
91575
+ * "cause_balance_after_clp": -1840000
91296
91576
  * },
91297
91577
  * "month_end": {
91298
91578
  * "date": "2026-11-30",
91299
91579
  * "balance_clp": 2310000,
91300
- * "band": {
91301
- * "low_clp": 640000,
91302
- * "high_clp": 4020000
91303
- * }
91580
+ * "expected_balance_clp": 9410000,
91581
+ * "band": null
91304
91582
  * }
91305
91583
  * },
91306
91584
  * "horizon": {
@@ -91450,15 +91728,14 @@ interface paths {
91450
91728
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
91451
91729
  * "rescue_id": null,
91452
91730
  * "count": null
91453
- * }
91731
+ * },
91732
+ * "cause_balance_after_clp": -1840000
91454
91733
  * },
91455
91734
  * "month_end": {
91456
91735
  * "date": "2026-11-30",
91457
91736
  * "balance_clp": 2310000,
91458
- * "band": {
91459
- * "low_clp": 640000,
91460
- * "high_clp": 4020000
91461
- * }
91737
+ * "expected_balance_clp": 9410000,
91738
+ * "band": null
91462
91739
  * }
91463
91740
  * },
91464
91741
  * "after": {
@@ -91483,15 +91760,14 @@ interface paths {
91483
91760
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
91484
91761
  * "rescue_id": null,
91485
91762
  * "count": null
91486
- * }
91763
+ * },
91764
+ * "cause_balance_after_clp": -1840000
91487
91765
  * },
91488
91766
  * "month_end": {
91489
91767
  * "date": "2026-11-30",
91490
91768
  * "balance_clp": 7410000,
91491
- * "band": {
91492
- * "low_clp": 640000,
91493
- * "high_clp": 4020000
91494
- * }
91769
+ * "expected_balance_clp": 9410000,
91770
+ * "band": null
91495
91771
  * }
91496
91772
  * },
91497
91773
  * "horizon": {
@@ -91549,15 +91825,14 @@ interface paths {
91549
91825
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
91550
91826
  * "rescue_id": null,
91551
91827
  * "count": null
91552
- * }
91828
+ * },
91829
+ * "cause_balance_after_clp": -1840000
91553
91830
  * },
91554
91831
  * "month_end": {
91555
91832
  * "date": "2026-11-30",
91556
91833
  * "balance_clp": 2310000,
91557
- * "band": {
91558
- * "low_clp": 640000,
91559
- * "high_clp": 4020000
91560
- * }
91834
+ * "expected_balance_clp": 9410000,
91835
+ * "band": null
91561
91836
  * }
91562
91837
  * },
91563
91838
  * "after": {
@@ -91582,15 +91857,14 @@ interface paths {
91582
91857
  * "recurring_item_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7b01",
91583
91858
  * "rescue_id": null,
91584
91859
  * "count": null
91585
- * }
91860
+ * },
91861
+ * "cause_balance_after_clp": -1840000
91586
91862
  * },
91587
91863
  * "month_end": {
91588
91864
  * "date": "2026-11-30",
91589
91865
  * "balance_clp": 7410000,
91590
- * "band": {
91591
- * "low_clp": 640000,
91592
- * "high_clp": 4020000
91593
- * }
91866
+ * "expected_balance_clp": 9410000,
91867
+ * "band": null
91594
91868
  * }
91595
91869
  * },
91596
91870
  * "horizon": {
@@ -92292,6 +92566,260 @@ interface paths {
92292
92566
  patch?: never;
92293
92567
  trace?: never;
92294
92568
  };
92569
+ "/finanzas/cash-flow/overdue-no-payment-seen": {
92570
+ parameters: {
92571
+ query?: never;
92572
+ header?: never;
92573
+ path?: never;
92574
+ cookie?: never;
92575
+ };
92576
+ /**
92577
+ * «Vencidas sin pago visto»: overdue payables kept out of the plan
92578
+ * @description Payables past their due date with no matching payment in the data Vitrina has (it does not claim they are unpaid: a card whose data stops earlier may have paid them), and no date given with «Mover pagos». They stay out of the projection and every headline. Each can be matched to a payment (Conciliación), marked paid (POST /finanzas/cash-flow/overdue-no-payment-seen/resolve) or given a date (POST /finanzas/cash-flow/moves with its `key`). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_reports:read`.
92579
+ */
92580
+ get: {
92581
+ parameters: {
92582
+ query?: never;
92583
+ header?: never;
92584
+ path?: never;
92585
+ cookie?: never;
92586
+ };
92587
+ requestBody?: never;
92588
+ responses: {
92589
+ /** @description The list */
92590
+ 200: {
92591
+ headers: {
92592
+ [name: string]: unknown;
92593
+ };
92594
+ content: {
92595
+ /**
92596
+ * @example {
92597
+ * "data": {
92598
+ * "as_of": "2026-11-09",
92599
+ * "count": 1,
92600
+ * "amount_clp": 405369,
92601
+ * "items": [
92602
+ * {
92603
+ * "key": "document:0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7a01",
92604
+ * "source": "payable",
92605
+ * "direction": "outflow",
92606
+ * "label": "Factura 21619609 · Empresa Nacional de Telecomunicaciones S.A.",
92607
+ * "amount_clp": 405369,
92608
+ * "date": "2026-08-31",
92609
+ * "due_date": "2026-08-31",
92610
+ * "overdue": true,
92611
+ * "movable": true,
92612
+ * "move": null,
92613
+ * "document": {
92614
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7a01",
92615
+ * "kind": "purchase",
92616
+ * "dte_type": 33,
92617
+ * "folio": "21619609"
92618
+ * },
92619
+ * "contraparte": null,
92620
+ * "recurring_item_id": null,
92621
+ * "rescue_id": null,
92622
+ * "count": null
92623
+ * }
92624
+ * ]
92625
+ * }
92626
+ * }
92627
+ */
92628
+ "application/json": {
92629
+ data: components["schemas"]["FinanzasCashFlowOverdueNoPaymentSeenList"];
92630
+ };
92631
+ };
92632
+ };
92633
+ /** @description Validation error */
92634
+ 400: {
92635
+ headers: {
92636
+ [name: string]: unknown;
92637
+ };
92638
+ content: {
92639
+ "application/json": components["schemas"]["Error"];
92640
+ };
92641
+ };
92642
+ /** @description Unauthorized */
92643
+ 401: {
92644
+ headers: {
92645
+ [name: string]: unknown;
92646
+ };
92647
+ content: {
92648
+ "application/json": components["schemas"]["Error"];
92649
+ };
92650
+ };
92651
+ /** @description Forbidden */
92652
+ 403: {
92653
+ headers: {
92654
+ [name: string]: unknown;
92655
+ };
92656
+ content: {
92657
+ "application/json": components["schemas"]["Error"];
92658
+ };
92659
+ };
92660
+ /** @description Not found */
92661
+ 404: {
92662
+ headers: {
92663
+ [name: string]: unknown;
92664
+ };
92665
+ content: {
92666
+ "application/json": components["schemas"]["Error"];
92667
+ };
92668
+ };
92669
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
92670
+ 409: {
92671
+ headers: {
92672
+ [name: string]: unknown;
92673
+ };
92674
+ content: {
92675
+ "application/json": components["schemas"]["Error"];
92676
+ };
92677
+ };
92678
+ /** @description Rate limited */
92679
+ 429: {
92680
+ headers: {
92681
+ [name: string]: unknown;
92682
+ };
92683
+ content: {
92684
+ "application/json": components["schemas"]["Error"];
92685
+ };
92686
+ };
92687
+ };
92688
+ };
92689
+ put?: never;
92690
+ post?: never;
92691
+ delete?: never;
92692
+ options?: never;
92693
+ head?: never;
92694
+ patch?: never;
92695
+ trace?: never;
92696
+ };
92697
+ "/finanzas/cash-flow/overdue-no-payment-seen/resolve": {
92698
+ parameters: {
92699
+ query?: never;
92700
+ header?: never;
92701
+ path?: never;
92702
+ cookie?: never;
92703
+ };
92704
+ get?: never;
92705
+ put?: never;
92706
+ /**
92707
+ * Mark «Vencidas sin pago visto» as paid
92708
+ * @description The person knows these were paid (by card, cash, outside the banks Vitrina reads): each document leaves the list as paid. No bank link is invented. A document that is no longer an overdue open payable is skipped (`not_eligible`), never overwritten. One batch, one `batch_id`, audited as `finanzas.overdue_no_payment_seen.pagado`; POST /finanzas/inherited-overdue/batches/{batchId}/undo puts the batch back; POST /finanzas/documents/{id}/reopen reopens one. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_reports:read` and `finanzas:write` (the Contador seat reads, never writes).
92709
+ */
92710
+ post: {
92711
+ parameters: {
92712
+ query?: never;
92713
+ header?: {
92714
+ /** @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. */
92715
+ "Idempotency-Key"?: string;
92716
+ };
92717
+ path?: never;
92718
+ cookie?: never;
92719
+ };
92720
+ requestBody?: {
92721
+ content: {
92722
+ /**
92723
+ * @example {
92724
+ * "document_ids": [
92725
+ * "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7a01"
92726
+ * ],
92727
+ * "note": "Pagada con la tarjeta Itaú"
92728
+ * }
92729
+ */
92730
+ "application/json": components["schemas"]["FinanzasCashFlowOverdueResolveBody"];
92731
+ };
92732
+ };
92733
+ responses: {
92734
+ /** @description Marked paid */
92735
+ 200: {
92736
+ headers: {
92737
+ [name: string]: unknown;
92738
+ };
92739
+ content: {
92740
+ /**
92741
+ * @example {
92742
+ * "data": {
92743
+ * "batch_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7e01",
92744
+ * "resolved": [
92745
+ * "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7a01"
92746
+ * ],
92747
+ * "skipped": [],
92748
+ * "amount_clp": 405369,
92749
+ * "remaining": {
92750
+ * "count": 0,
92751
+ * "amount_clp": 0
92752
+ * }
92753
+ * }
92754
+ * }
92755
+ */
92756
+ "application/json": {
92757
+ data: components["schemas"]["FinanzasCashFlowOverdueResolveResult"];
92758
+ };
92759
+ };
92760
+ };
92761
+ /** @description Validation error */
92762
+ 400: {
92763
+ headers: {
92764
+ [name: string]: unknown;
92765
+ };
92766
+ content: {
92767
+ "application/json": components["schemas"]["Error"];
92768
+ };
92769
+ };
92770
+ /** @description Unauthorized */
92771
+ 401: {
92772
+ headers: {
92773
+ [name: string]: unknown;
92774
+ };
92775
+ content: {
92776
+ "application/json": components["schemas"]["Error"];
92777
+ };
92778
+ };
92779
+ /** @description Forbidden */
92780
+ 403: {
92781
+ headers: {
92782
+ [name: string]: unknown;
92783
+ };
92784
+ content: {
92785
+ "application/json": components["schemas"]["Error"];
92786
+ };
92787
+ };
92788
+ /** @description Not found */
92789
+ 404: {
92790
+ headers: {
92791
+ [name: string]: unknown;
92792
+ };
92793
+ content: {
92794
+ "application/json": components["schemas"]["Error"];
92795
+ };
92796
+ };
92797
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
92798
+ 409: {
92799
+ headers: {
92800
+ [name: string]: unknown;
92801
+ };
92802
+ content: {
92803
+ "application/json": components["schemas"]["Error"];
92804
+ };
92805
+ };
92806
+ /** @description Rate limited */
92807
+ 429: {
92808
+ headers: {
92809
+ [name: string]: unknown;
92810
+ };
92811
+ content: {
92812
+ "application/json": components["schemas"]["Error"];
92813
+ };
92814
+ };
92815
+ };
92816
+ };
92817
+ delete?: never;
92818
+ options?: never;
92819
+ head?: never;
92820
+ patch?: never;
92821
+ trace?: never;
92822
+ };
92295
92823
  "/finanzas/alerts": {
92296
92824
  parameters: {
92297
92825
  query?: never;
@@ -94511,8 +95039,10 @@ interface paths {
94511
95039
  * "month": "2026-09",
94512
95040
  * "label": "septiembre 2026",
94513
95041
  * "equilibrio_clp": 44600000,
94514
- * "sin_calculo": null
95042
+ * "sin_calculo": null,
95043
+ * "produccion": null
94515
95044
  * },
95045
+ * "target_clp": 44600000,
94516
95046
  * "cobertura_pct": 92.4,
94517
95047
  * "brecha_clp": -3400000
94518
95048
  * },
@@ -94570,7 +95100,10 @@ interface paths {
94570
95100
  * "rule": null,
94571
95101
  * "reviewed_at": null,
94572
95102
  * "reviewed_by": null,
94573
- * "group_name": "Laboratorio Andes SpA"
95103
+ * "group_name": "Laboratorio Andes SpA",
95104
+ * "group_key": "contraparte:3f6c1d2e-5b7a-4c1e-9d0f-2a8b6c4e1f70",
95105
+ * "group_count": 1,
95106
+ * "group_total_clp": 1240000
94574
95107
  * }
94575
95108
  * ]
94576
95109
  * },
@@ -141799,9 +142332,7 @@ interface paths {
141799
142332
  * },
141800
142333
  * {
141801
142334
  * "instrument": "transferencia",
141802
- * "required_fields": [
141803
- * "bank"
141804
- * ]
142335
+ * "required_fields": []
141805
142336
  * },
141806
142337
  * {
141807
142338
  * "instrument": "cheque",
@@ -141813,10 +142344,7 @@ interface paths {
141813
142344
  * },
141814
142345
  * {
141815
142346
  * "instrument": "vale_vista",
141816
- * "required_fields": [
141817
- * "bank",
141818
- * "document_number"
141819
- * ]
142347
+ * "required_fields": []
141820
142348
  * },
141821
142349
  * {
141822
142350
  * "instrument": "tarjeta",
@@ -281891,7 +282419,7 @@ interface components {
281891
282419
  /** @description Finanzas 36: set when this is a known card processor's payout («Cobro con tarjeta»: PNOL / PAGOS Y SERVICIOS, Transbank, Getnet, Mercado Pago). It settles the month's boleta summary and never adds income. Null for any other movement and for money out. */
281892
282420
  card_processor: {
281893
282421
  /** @enum {string} */
281894
- key: "pagos_y_servicios" | "transbank" | "getnet" | "mercado_pago";
282422
+ key: "pagos_y_servicios" | "transbank" | "getnet" | "mercado_pago" | "healthatom";
281895
282423
  name: string;
281896
282424
  rut_formatted: string | null;
281897
282425
  } | null;
@@ -281940,10 +282468,22 @@ interface components {
281940
282468
  };
281941
282469
  due_date: string | null;
281942
282470
  /**
281943
- * @description por_pagar (a sale: por cobrar) | parcial | pagado | vencido_heredado. Derived from reconciliation; vencido_heredado = a payable imported more than 90 days overdue (Finanzas 39): out of the cash-flow projection, the Contraparte balances and «Le debemos» until someone marks it pagado or anulado.
282471
+ * @description por_pagar (a sale: por cobrar) | parcial | pagado. Derived from reconciliation; a document settled without a bank link (`settlement`) is pagado. `vencido_heredado` is retired (Finanzas 50): nothing writes it; only rows written before it, outside that backfill, still carry it, and they count like a paid document.
281944
282472
  * @enum {string}
281945
282473
  */
281946
282474
  payment_state: "por_pagar" | "parcial" | "pagado" | "vencido_heredado";
282475
+ /** @description Settled without a bank link (Finanzas 50); null when the state comes from reconciliation alone. POST /finanzas/documents/{id}/reopen undoes it. */
282476
+ settlement: {
282477
+ /**
282478
+ * @description paid_before_vitrina = «Pagado antes de Vitrina»: from a period closed before Vitrina, still open there, so treated as settled (out of the cash projection and the balances). person = someone marked it pagado («Marcar pagada»).
282479
+ * @enum {string}
282480
+ */
282481
+ reason: "person" | "paid_before_vitrina";
282482
+ /** Format: uuid */
282483
+ batch_id: string;
282484
+ /** Format: date-time */
282485
+ settled_at: string;
282486
+ } | null;
281947
282487
  /** @description REGISTRO | PENDIENTE | NO_INCLUIR | RECLAMADO (purchases). */
281948
282488
  sii_estado_contable: string | null;
281949
282489
  /** @description The SII register no longer lists it; out of the libro. */
@@ -282151,6 +282691,10 @@ interface components {
282151
282691
  } | null;
282152
282692
  opening_balance_editable: boolean;
282153
282693
  movement_count: number;
282694
+ /** @description Date of the account's newest movement (YYYY-MM-DD). */
282695
+ data_through: string | null;
282696
+ /** @description true = no connection feeds the account and its newest movement is older than 37 days: its cartola is late (warning, never sent as an email or WhatsApp). */
282697
+ stale: boolean;
282154
282698
  /** @description Finanzas 33: «el agente comparte esta cuenta», with the holder details the agent dictates. Null = never shared. */
282155
282699
  agent_sharing: {
282156
282700
  /** @description true = the AI agent dictates this account for transfers and abonos into it are matched; false = it stopped sharing it. */
@@ -282161,6 +282705,8 @@ interface components {
282161
282705
  holder_email: string | null;
282162
282706
  /** @enum {string} */
282163
282707
  account_type: "corriente" | "vista" | "ahorro";
282708
+ /** @description true = the holder RUT differs from the company RUT (the workspace's SII RUTs): the account card shows «El titular no es la empresa». Always false when the company RUT is not known. */
282709
+ holder_not_company: boolean;
282164
282710
  } | null;
282165
282711
  /** @description Whether the agent can share it: a CLP corriente / vista / ahorro / Mercado Pago account with its full number (not a card, a credit line, a USD account or a last-4 number). */
282166
282712
  can_share_with_agent: boolean;
@@ -282179,6 +282725,8 @@ interface components {
282179
282725
  FinanzasAgentSharingBody: {
282180
282726
  /** @description true = the AI agent shares this account for transfers (and abonos into it are matched); false = stop sharing it (the row is kept, never deleted). */
282181
282727
  shared: boolean;
282728
+ /** @description Required (true) to turn sharing on when the holder RUT is not the company's; without it the call answers 409 `agent_sharing_holder_not_company` naming the holder. Never needed to keep an already-shared account or to stop sharing. Set it only after the human has explicitly agreed; an agent must not add it by itself to get past the 409. */
282729
+ confirm_holder_not_company?: boolean;
282182
282730
  /** @description The label the agent and Ajustes show. Default «‹banco› ··‹últimos 4›». */
282183
282731
  alias?: string;
282184
282732
  /** @description Account holder as the bank shows it. Required the first time the account is shared. */
@@ -282350,6 +282898,11 @@ interface components {
282350
282898
  };
282351
282899
  };
282352
282900
  };
282901
+ FinanzasDocumentReopenResult: {
282902
+ /** @description false when nothing settled the document (already open): idempotent. */
282903
+ reopened: boolean;
282904
+ document: components["schemas"]["FinanzasDocumentDetail"];
282905
+ };
282353
282906
  FinanzasInbox: {
282354
282907
  /** @example finanzas+k7m2q9xw4pha@vitrinadev.com */
282355
282908
  address: string;
@@ -282968,7 +283521,10 @@ interface components {
282968
283521
  total_clp: number;
282969
283522
  paid_clp: number;
282970
283523
  outstanding_clp: number;
282971
- /** @enum {string} */
283524
+ /**
283525
+ * @description `vencido_heredado` is retired (Finanzas 50): only rows written before it, outside that backfill, still carry it.
283526
+ * @enum {string}
283527
+ */
282972
283528
  payment_state: "por_pagar" | "parcial" | "pagado" | "vencido_heredado";
282973
283529
  };
282974
283530
  links: components["schemas"]["FinanzasLink"][];
@@ -283037,10 +283593,10 @@ interface components {
283037
283593
  items: {
283038
283594
  id: string;
283039
283595
  /**
283040
- * @description reconcile = movements ↔ documents; transfer = between own accounts; classify = to an account; missing_document = «Falta documento» (money out classified with no document); unknown = no proposal yet; ads_charge = a Meta / Google card charge Vitrina could not confirm («Cargo de publicidad sin confirmar» / «Sin conexión de publicidad», Finanzas 30): the proposal links each movement to its own ads document.
283596
+ * @description reconcile = movements ↔ documents; transfer = between own accounts; classify = to an account; missing_document = «Falta documento» (money out classified with no document); unknown = no proposal yet; ads_charge = a Meta / Google card charge Vitrina could not confirm («Cargo de publicidad sin confirmar» / «Sin conexión de publicidad», Finanzas 30): the proposal links each movement to its own ads document; merge = a «unir» Caso (Finanzas 58): two Contrapartes with similar names and no shared RUT, proposed to be merged (`merge` holds the pair; it has no movements or documents and moves no money).
283041
283597
  * @enum {string}
283042
283598
  */
283043
- kind: "reconcile" | "transfer" | "classify" | "missing_document" | "unknown" | "ads_charge";
283599
+ kind: "reconcile" | "transfer" | "classify" | "missing_document" | "unknown" | "ads_charge" | "merge";
283044
283600
  title: string;
283045
283601
  summary: string;
283046
283602
  contraparte: {
@@ -283104,16 +283660,17 @@ interface components {
283104
283660
  missing_document: number;
283105
283661
  unknown: number;
283106
283662
  ads_charge: number;
283663
+ merge: number;
283107
283664
  };
283108
283665
  };
283109
283666
  FinanzasCase: {
283110
283667
  id: string;
283111
283668
  key: string;
283112
283669
  /**
283113
- * @description reconcile = movements ↔ documents; transfer = between own accounts; classify = to an account; missing_document = «Falta documento» (money out classified with no document); unknown = no proposal yet; ads_charge = a Meta / Google card charge Vitrina could not confirm («Cargo de publicidad sin confirmar» / «Sin conexión de publicidad», Finanzas 30): the proposal links each movement to its own ads document.
283670
+ * @description reconcile = movements ↔ documents; transfer = between own accounts; classify = to an account; missing_document = «Falta documento» (money out classified with no document); unknown = no proposal yet; ads_charge = a Meta / Google card charge Vitrina could not confirm («Cargo de publicidad sin confirmar» / «Sin conexión de publicidad», Finanzas 30): the proposal links each movement to its own ads document; merge = a «unir» Caso (Finanzas 58): two Contrapartes with similar names and no shared RUT, proposed to be merged (`merge` holds the pair; it has no movements or documents and moves no money).
283114
283671
  * @enum {string}
283115
283672
  */
283116
- kind: "reconcile" | "transfer" | "classify" | "missing_document" | "unknown" | "ads_charge";
283673
+ kind: "reconcile" | "transfer" | "classify" | "missing_document" | "unknown" | "ads_charge" | "merge";
283117
283674
  /** @enum {string} */
283118
283675
  status: "open" | "resolved";
283119
283676
  /** @enum {string|null} */
@@ -283162,7 +283719,10 @@ interface components {
283162
283719
  folio: string | null;
283163
283720
  issue_date: string;
283164
283721
  due_date: string | null;
283722
+ /** @description What is paid: the líquido on a boleta de honorarios, the total otherwise. */
283165
283723
  total_clp: number;
283724
+ /** @description What the document costs: the gross total. Differs from total_clp only on a boleta de honorarios. */
283725
+ gross_clp: number;
283166
283726
  outstanding_clp: number;
283167
283727
  counterparty_name: string | null;
283168
283728
  /** @enum {string} */
@@ -283257,6 +283817,30 @@ interface components {
283257
283817
  candidate_accounts: string[];
283258
283818
  }[];
283259
283819
  } | null;
283820
+ /** @description Finanzas 58, `merge` («unir») cases only: the pair. `keep` stays, `merge` is merged into it; `moves` is what passes to `keep`. Resolve with the confirm route (merge, undoable in «Hecho por Vitrina») or the dismiss route («No son la misma»). */
283821
+ merge?: {
283822
+ keep: {
283823
+ /** Format: uuid */
283824
+ id: string;
283825
+ name: string;
283826
+ rut: string | null;
283827
+ movement_count: number;
283828
+ document_count: number;
283829
+ };
283830
+ merge: {
283831
+ /** Format: uuid */
283832
+ id: string;
283833
+ name: string;
283834
+ rut: string | null;
283835
+ movement_count: number;
283836
+ document_count: number;
283837
+ };
283838
+ score: number;
283839
+ moves: {
283840
+ movements: number;
283841
+ documents: number;
283842
+ };
283843
+ } | null;
283260
283844
  opened_at: string;
283261
283845
  computed_at: string;
283262
283846
  };
@@ -283293,6 +283877,12 @@ interface components {
283293
283877
  };
283294
283878
  remaining_case: components["schemas"]["FinanzasCase"] & (Record<string, never> | null);
283295
283879
  next_case_id: string | null;
283880
+ /** @description Finanzas 58, `merge` («unir») cases only: the merge the confirm made. `merge_id` is the «Deshacer» id in «Hecho por Vitrina». */
283881
+ merged?: {
283882
+ merge_id: string;
283883
+ survivor_id: string;
283884
+ merged_id: string;
283885
+ };
283296
283886
  /** @description Card / automatic-debit descriptors this confirm tied to a Contraparte (`learned`: a movement that named no RUT or account was confirmed against documents of one Contraparte; from now on the engine knows the supplier, shown once as «Desde ahora reconocemos “MERPAGO*MERCADOL” como …»), or untied (`forgotten`: confirmed for a second Contraparte, so it names neither). Listed and removable as the Contraparte's aliases (kind `descriptor`). */
283297
283887
  descriptors: {
283298
283888
  descriptor: string;
@@ -283301,6 +283891,10 @@ interface components {
283301
283891
  status: "learned" | "forgotten";
283302
283892
  }[];
283303
283893
  };
283894
+ FinanzasCaseDismissResult: {
283895
+ case_id: string;
283896
+ next_case_id: string | null;
283897
+ };
283304
283898
  FinanzasNoDocumentUndo: {
283305
283899
  movement_id: string;
283306
283900
  case_id: string | null;
@@ -283480,7 +284074,10 @@ interface components {
283480
284074
  */
283481
284075
  state: "open" | "ready_to_close" | "closed" | "closed_imported";
283482
284076
  ended: boolean;
284077
+ /** @description Open «Por resolver» cases of the month (the month of each case’s oldest item): the one count of open work. */
283483
284078
  open_cases: number;
284079
+ /** @description The money at stake in those cases, whole CLP: the same amount as «Por resolver» with `month`. */
284080
+ open_cases_amount_clp: number;
283484
284081
  closed_at: string | null;
283485
284082
  closed_by: string | null;
283486
284083
  /**
@@ -283507,7 +284104,10 @@ interface components {
283507
284104
  */
283508
284105
  state: "open" | "ready_to_close" | "closed" | "closed_imported";
283509
284106
  ended: boolean;
284107
+ /** @description Open «Por resolver» cases of the month (the month of each case’s oldest item): the one count of open work. */
283510
284108
  open_cases: number;
284109
+ /** @description The money at stake in those cases, whole CLP: the same amount as «Por resolver» with `month`. */
284110
+ open_cases_amount_clp: number;
283511
284111
  closed_at: string | null;
283512
284112
  closed_by: string | null;
283513
284113
  /**
@@ -283526,11 +284126,18 @@ interface components {
283526
284126
  /** @enum {string|null} */
283527
284127
  blocking_reason: "open_cases" | "not_ended" | "already_closed" | null;
283528
284128
  checklist: {
284129
+ /** @description The headline of «Antes de cerrar» (Finanzas 47): the month’s open Casos. Movements and documents are their detail, never a separate count. */
283529
284130
  open_cases: number;
284131
+ /** @description The money at stake in those cases, whole CLP (= «Por resolver» `?mes=`). */
284132
+ open_cases_amount_clp: number;
284133
+ /** @description Movements behind the month’s open cases. */
284134
+ open_case_movements_count: number;
284135
+ /** @description Documents to classify behind the month’s open cases. */
284136
+ open_case_documents_count: number;
283530
284137
  /** @description Automatic actions of the month nobody reviewed in «Hecho por Vitrina». The close confirms this number. */
283531
284138
  unreviewed_count: number;
283532
284139
  unclassified_count: number;
283533
- /** @description Still to reconcile in the month: bank movements not fully matched plus income documents (boletas, facturas) issued in the month still «Por conciliar» (the same definition as Resultado). */
284140
+ /** @description Still to reconcile in the month: bank movements not fully matched plus income documents (boletas, facturas) issued in the month still «Por conciliar» (the same definition as Resultado). Detail, not a headline: what counts as open work is `open_cases`. */
283534
284141
  unmatched_count: number;
283535
284142
  /** @description Bank movements of the month not fully matched. */
283536
284143
  unmatched_movements_count: number;
@@ -284139,6 +284746,15 @@ interface components {
284139
284746
  proforma: boolean;
284140
284747
  closed: boolean;
284141
284748
  post_close: components["schemas"]["FinanzasResultadoPostClose"];
284749
+ /** @description «Mes incompleto»: a closed month whose dentist cost is $0 or that misses a large recurring cost. It never counts for an average, the `equilibrio` or the `hora_sillon.base`; Resultado and Costos flag the same months. Null otherwise; a proforma month is never tagged. */
284750
+ incompleto: {
284751
+ /** @enum {string} */
284752
+ reason: "dentist_cost_missing" | "recurring_cost_missing";
284753
+ /** @description Spanish, ready for the tooltip. */
284754
+ message: string;
284755
+ /** @description The missing recurring account (`recurring_cost_missing`), else null. */
284756
+ account_name: string | null;
284757
+ } | null;
284142
284758
  }[];
284143
284759
  rows: components["schemas"]["FinanzasResultadoRow"][];
284144
284760
  summary: {
@@ -284213,7 +284829,7 @@ interface components {
284213
284829
  } | null;
284214
284830
  }[];
284215
284831
  };
284216
- /** @description The biggest payment that day. */
284832
+ /** @description What «deja el saldo en …» names: the payment at which the confirmed balance first goes below zero; when it never does (or already starts below zero), the biggest payment of the lowest day. */
284217
284833
  FinanzasCashFlowItem: {
284218
284834
  /** @description Stable item key: document:<uuid>, recurring:<uuid>:<YYYY-MM-DD>, retention:<YYYY-MM>, rescue:<uuid>, cuotas:<day>, appointments:<day>, cash_pending. */
284219
284835
  key: string;
@@ -284230,7 +284846,7 @@ interface components {
284230
284846
  date: string;
284231
284847
  /** @description Where its source puts it (due date, occurrence). */
284232
284848
  due_date: string;
284233
- /** @description An overdue payable, placed today unless moved. */
284849
+ /** @description An overdue payable. In the plan only when moved to a date; otherwise it is a «Vencida sin pago visto» (GET /finanzas/cash-flow/overdue-no-payment-seen). */
284234
284850
  overdue: boolean;
284235
284851
  /** @description «Mover pagos» applies (documents, recurring items, retención). */
284236
284852
  movable: boolean;
@@ -284262,13 +284878,24 @@ interface components {
284262
284878
  /** @description True when the lowest point is today (today's real balance, or a projected today lower than it): the screen says «Hoy es el punto más bajo». The balance is never above «Caja hoy». */
284263
284879
  is_today: boolean;
284264
284880
  cause: components["schemas"]["FinanzasCashFlowItem"];
284881
+ /** @description The confirmed balance right after `cause` (null without a cause). */
284882
+ cause_balance_after_clp: number | null;
284265
284883
  } | null;
284266
- /** @description Payables imported more than 90 days overdue («Vencido heredado»): not in the projection nor in the balances; reviewed in bulk in Mes en paralelo. */
284267
- FinanzasInheritedOverdue: {
284884
+ /** @description «Vencidas sin pago visto»: payables past their due date with no matching payment in the data and no date given with «Mover pagos». Vitrina does not claim they are unpaid, so they stay out of the projection and every headline. Review them with GET /finanzas/cash-flow/overdue-no-payment-seen. */
284885
+ FinanzasCashFlowOverdueNoPaymentSeen: {
284268
284886
  count: number;
284269
284887
  /** @description What is still open on them (total − retención − links). */
284270
284888
  amount_clp: number;
284271
284889
  };
284890
+ /**
284891
+ * @deprecated
284892
+ * @description Retired (Finanzas 50): always zero. The payables it counted («Vencido heredado») are «Pagado antes de Vitrina» now, settled; list them with GET /finanzas/documents?paid_before_vitrina=true.
284893
+ */
284894
+ FinanzasInheritedOverdue: {
284895
+ count: number;
284896
+ /** @description Retired (Finanzas 50): always zero. */
284897
+ amount_clp: number;
284898
+ };
284272
284899
  FinanzasCashFlowRescue: {
284273
284900
  id: string;
284274
284901
  planned_on: string;
@@ -284310,8 +284937,11 @@ interface components {
284310
284937
  /** @description Projected: typical weekday income above the known income. */
284311
284938
  typical_inflow_clp: number;
284312
284939
  outflow_clp: number;
284940
+ /** @description The confirmed balance: bank balances plus known items only. */
284313
284941
  closing_balance_clp: number;
284314
- /** @description The balance if each coming day earns its weekday minimum (low) or maximum (high) income of the last 90 days. */
284942
+ /** @description «Con cobros esperados»: the confirmed balance plus the typical weekday income (median of the last 90 days) of every projected day so far: the dashed line. Never a headline. Actual days: the real balance. */
284943
+ expected_balance_clp: number;
284944
+ /** @description Retired with the uncertainty band (#6993): always null. The dashed line is `expected_balance_clp`. */
284315
284945
  band: {
284316
284946
  low_clp: number;
284317
284947
  high_clp: number;
@@ -284322,8 +284952,11 @@ interface components {
284322
284952
  /** @description The projected balance at the end of the current month. */
284323
284953
  month_end: {
284324
284954
  date: string;
284955
+ /** @description The confirmed balance. */
284325
284956
  balance_clp: number;
284326
- /** @description The balance if each coming day earns its weekday minimum (low) or maximum (high) income of the last 90 days. */
284957
+ /** @description «Con cobros esperados»: the confirmed balance plus the typical weekday income (median of the last 90 days) of every projected day so far: the dashed line. Never a headline. Actual days: the real balance. */
284958
+ expected_balance_clp: number;
284959
+ /** @description Retired with the uncertainty band (#6993): always null. The dashed line is `expected_balance_clp`. */
284327
284960
  band: {
284328
284961
  low_clp: number;
284329
284962
  high_clp: number;
@@ -284340,6 +284973,7 @@ interface components {
284340
284973
  };
284341
284974
  };
284342
284975
  overdue: {
284976
+ /** @description Payables overdue up to 90 days with no payment seen: out of the projection (part of `overdue_no_payment_seen`). */
284343
284977
  payables_clp: number;
284344
284978
  payables_count: number;
284345
284979
  stale_payables_clp: number;
@@ -284347,6 +284981,7 @@ interface components {
284347
284981
  receivables_clp: number;
284348
284982
  receivables_count: number;
284349
284983
  };
284984
+ overdue_no_payment_seen: components["schemas"]["FinanzasCashFlowOverdueNoPaymentSeen"];
284350
284985
  inherited_overdue: components["schemas"]["FinanzasInheritedOverdue"];
284351
284986
  cash_pending: components["schemas"]["FinanzasCashPendingSummary"];
284352
284987
  /** @description What the typical weekday income stands on. `insufficient_history` = fewer than 4 weeks of bank history: no typical income is projected (every `typical_inflow_clp` is 0 and there is no band) and the page should say so. */
@@ -284402,8 +285037,11 @@ interface components {
284402
285037
  lowest: components["schemas"]["FinanzasCashFlowLowest"];
284403
285038
  month_end: {
284404
285039
  date: string;
285040
+ /** @description The confirmed balance. */
284405
285041
  balance_clp: number;
284406
- /** @description The balance if each coming day earns its weekday minimum (low) or maximum (high) income of the last 90 days. */
285042
+ /** @description «Con cobros esperados»: the confirmed balance plus the typical weekday income (median of the last 90 days) of every projected day so far: the dashed line. Never a headline. Actual days: the real balance. */
285043
+ expected_balance_clp: number;
285044
+ /** @description Retired with the uncertainty band (#6993): always null. The dashed line is `expected_balance_clp`. */
284407
285045
  band: {
284408
285046
  low_clp: number;
284409
285047
  high_clp: number;
@@ -284414,8 +285052,11 @@ interface components {
284414
285052
  lowest: components["schemas"]["FinanzasCashFlowLowest"];
284415
285053
  month_end: {
284416
285054
  date: string;
285055
+ /** @description The confirmed balance. */
284417
285056
  balance_clp: number;
284418
- /** @description The balance if each coming day earns its weekday minimum (low) or maximum (high) income of the last 90 days. */
285057
+ /** @description «Con cobros esperados»: the confirmed balance plus the typical weekday income (median of the last 90 days) of every projected day so far: the dashed line. Never a headline. Actual days: the real balance. */
285058
+ expected_balance_clp: number;
285059
+ /** @description Retired with the uncertainty band (#6993): always null. The dashed line is `expected_balance_clp`. */
284419
285060
  band: {
284420
285061
  low_clp: number;
284421
285062
  high_clp: number;
@@ -284557,6 +285198,36 @@ interface components {
284557
285198
  /** @description The last day an occurrence may fall on. Default: today (the day before it starts, if it has not started). */
284558
285199
  ends_on?: string | null;
284559
285200
  };
285201
+ FinanzasCashFlowOverdueNoPaymentSeenList: {
285202
+ as_of: string;
285203
+ count: number;
285204
+ amount_clp: number;
285205
+ /** @description Newest due date first. `date` = `due_date`; each is movable («Mover pagos» puts it back in the plan on that day). */
285206
+ items: (components["schemas"]["FinanzasCashFlowItem"] & Record<string, never>)[];
285207
+ };
285208
+ FinanzasCashFlowOverdueResolveResult: {
285209
+ /**
285210
+ * Format: uuid
285211
+ * @description Pass it to POST /finanzas/inherited-overdue/batches/{batchId}/undo («Deshacer»).
285212
+ */
285213
+ batch_id: string;
285214
+ resolved: string[];
285215
+ skipped: {
285216
+ id: string;
285217
+ /**
285218
+ * @description not_eligible: not an overdue open payable any more (paid, linked, voided, or someone got there first).
285219
+ * @enum {string}
285220
+ */
285221
+ reason: "not_found" | "not_eligible";
285222
+ }[];
285223
+ /** @description What was open on the documents marked paid. */
285224
+ amount_clp: number;
285225
+ remaining: components["schemas"]["FinanzasCashFlowOverdueNoPaymentSeen"] & unknown;
285226
+ };
285227
+ FinanzasCashFlowOverdueResolveBody: {
285228
+ document_ids: string[];
285229
+ note?: string | null;
285230
+ };
284560
285231
  FinanzasAlert: {
284561
285232
  /** Format: uuid */
284562
285233
  id: string;
@@ -284649,6 +285320,15 @@ interface components {
284649
285320
  } | null;
284650
285321
  /** @description The rest: the month against the punto de equilibrio, the open cases, what Vitrina ordered. */
284651
285322
  lines: string[];
285323
+ /** @description «$X en facturas vencidas sin pago visto» with a link to review them; they are not in the cash forecast. Null when there are none or the caller cannot read reports. */
285324
+ overdue_unpaid: {
285325
+ text: string;
285326
+ link: {
285327
+ label: string;
285328
+ /** @description Workspace-relative screen (prefix `/w/<workspace>`). */
285329
+ path: string;
285330
+ };
285331
+ } | null;
284652
285332
  primary: {
284653
285333
  label: string;
284654
285334
  /** @description Workspace-relative screen (prefix `/w/<workspace>`). */
@@ -284675,6 +285355,19 @@ interface components {
284675
285355
  open_cases: number;
284676
285356
  };
284677
285357
  };
285358
+ FinanzasEquilibrioProduccion: {
285359
+ /** @description The average break-even converted to production terms: `equilibrio.equilibrio_clp` × `ratio`. */
285360
+ equilibrio_clp: number;
285361
+ /** @description Producción ÷ ventas netas over `months` (sums, not a mean of ratios), three decimals. */
285362
+ ratio: number;
285363
+ /** @description The bar months that have both figures, oldest first (at most 3). */
285364
+ months: {
285365
+ month: string;
285366
+ label: string;
285367
+ ingresos_clp: number;
285368
+ produccion_clp: number;
285369
+ }[];
285370
+ } | null;
284678
285371
  FinanzasCostos: {
284679
285372
  from: string;
284680
285373
  to: string;
@@ -284689,7 +285382,7 @@ interface components {
284689
285382
  month: string;
284690
285383
  label: string;
284691
285384
  proforma: boolean;
284692
- /** @description «Mes incompleto»: a closed month whose dentist cost is $0 or that misses a large recurring cost. It never counts for `equilibrio`. Null otherwise; a proforma month is never tagged. */
285385
+ /** @description «Mes incompleto»: a closed month whose dentist cost is $0 or that misses a large recurring cost. It never counts for an average, the `equilibrio` or the `hora_sillon.base`; Resultado and Costos flag the same months. Null otherwise; a proforma month is never tagged. */
284693
285386
  incompleto: {
284694
285387
  /** @enum {string} */
284695
285388
  reason: "dentist_cost_missing" | "recurring_cost_missing";
@@ -284747,6 +285440,7 @@ interface components {
284747
285440
  /** @description Distinct names of the accounts missing in any bar month, usual amount descending. */
284748
285441
  fijos_faltantes_accounts: string[];
284749
285442
  } | null;
285443
+ equilibrio_produccion: components["schemas"]["FinanzasEquilibrioProduccion"];
284750
285444
  /** @description Monthly averages over the range; equilibrio = average fijos ÷ the range’s margin %. */
284751
285445
  period: {
284752
285446
  /** @description The Resultado’s «Ingresos» (net). */
@@ -284815,6 +285509,21 @@ interface components {
284815
285509
  } | null;
284816
285510
  /** @description Costo hora sillón (clinics only): fijos ÷ available chair-hours (chairs × opening hours), all costs ÷ attended hours, occupancy and production per attended hour, per branch and total. */
284817
285511
  hora_sillon: {
285512
+ /** @description Base of the headline cost per hour (D12). Null when there is no complete month. */
285513
+ base: {
285514
+ /** @description The months behind the headline cost per hour, oldest first: the same last 3 complete months as `equilibrio`. */
285515
+ months: string[];
285516
+ /** @description Mean fijos of those months. */
285517
+ fijos_clp: number;
285518
+ /** @description Mean «fijos que aún no aparecen» of those months (also inside `equilibrio`). */
285519
+ fijos_faltantes_clp: number;
285520
+ /** @description Mean available chair-hours of those months. */
285521
+ available_hours: number;
285522
+ /** @description (fijos + fijos faltantes) ÷ available hours: the headline «Costo hora sillón». Null with no hours. */
285523
+ costo_hora_clp: number | null;
285524
+ /** @description The last complete month of the range: occupancy and attended hours are read from it. Null when the range has none. */
285525
+ occupancy_month: string | null;
285526
+ } | null;
284818
285527
  /** @description Total chairs counted (same as `chairs_source.count`). */
284819
285528
  chairs: number;
284820
285529
  /** @description Where the chair count comes from. */
@@ -284892,7 +285601,11 @@ interface components {
284892
285601
  /** @description Projected balance at the end of the month. */
284893
285602
  month_end: {
284894
285603
  date: string;
285604
+ /** @description The confirmed balance: bank balances plus known items only (no typical income, no «Vencidas sin pago visto»). */
284895
285605
  balance_clp: number;
285606
+ /** @description «Con cobros esperados»: the confirmed balance plus the typical weekday income of the last 90 days (the dashed line). Never a headline. */
285607
+ expected_balance_clp: number;
285608
+ /** @description Retired with the uncertainty band (#6993): always null. Read `expected_balance_clp`. */
284896
285609
  band: {
284897
285610
  low_clp: number;
284898
285611
  high_clp: number;
@@ -284901,14 +285614,18 @@ interface components {
284901
285614
  /** @description Projected balance 30 days from today. */
284902
285615
  in_30_days: {
284903
285616
  date: string;
285617
+ /** @description The confirmed balance: bank balances plus known items only (no typical income, no «Vencidas sin pago visto»). */
284904
285618
  balance_clp: number;
285619
+ /** @description «Con cobros esperados»: the confirmed balance plus the typical weekday income of the last 90 days (the dashed line). Never a headline. */
285620
+ expected_balance_clp: number;
285621
+ /** @description Retired with the uncertainty band (#6993): always null. Read `expected_balance_clp`. */
284905
285622
  band: {
284906
285623
  low_clp: number;
284907
285624
  high_clp: number;
284908
285625
  } | null;
284909
285626
  };
284910
285627
  lowest: components["schemas"]["FinanzasCashFlowLowest"] & unknown;
284911
- /** @description Null when cash stays ≥ 0 for 30 days. */
285628
+ /** @description Null when the confirmed balance stays ≥ 0 for 30 days. `cause` is the payment that takes it below zero (that day’s biggest payment when it already starts below zero). */
284912
285629
  runs_out: {
284913
285630
  /** @description The first projected day under zero. */
284914
285631
  date: string;
@@ -284925,11 +285642,16 @@ interface components {
284925
285642
  receivables_clp: number;
284926
285643
  receivables_count: number;
284927
285644
  };
285645
+ overdue_no_payment_seen: components["schemas"]["FinanzasCashFlowOverdueNoPaymentSeen"];
284928
285646
  inherited_overdue: components["schemas"]["FinanzasInheritedOverdue"];
284929
285647
  /** @description The runway: one point per day, today … today + 30. */
284930
285648
  points: {
284931
285649
  date: string;
285650
+ /** @description The confirmed balance: bank balances plus known items only (no typical income, no «Vencidas sin pago visto»). */
284932
285651
  balance_clp: number;
285652
+ /** @description «Con cobros esperados»: the confirmed balance plus the typical weekday income of the last 90 days (the dashed line). Never a headline. */
285653
+ expected_balance_clp: number;
285654
+ /** @description Retired with the uncertainty band (#6993): always null. Read `expected_balance_clp`. */
284933
285655
  band: {
284934
285656
  low_clp: number;
284935
285657
  high_clp: number;
@@ -284981,10 +285703,13 @@ interface components {
284981
285703
  label: string;
284982
285704
  equilibrio_clp: number;
284983
285705
  }[];
285706
+ produccion: components["schemas"]["FinanzasEquilibrioProduccion"];
284984
285707
  } | null;
284985
- /** @description `basis_clp` ÷ equilibrio, one decimal. */
285708
+ /** @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
+ target_clp: number | null;
285710
+ /** @description `basis_clp` ÷ `target_clp`, one decimal. */
284986
285711
  cobertura_pct: number | null;
284987
- /** @description `basis_clp` − equilibrio (negative: still short of it). */
285712
+ /** @description `basis_clp` − `target_clp` (negative: still short of it). */
284988
285713
  brecha_clp: number | null;
284989
285714
  } | null;
284990
285715
  FinanzasResumen: {
@@ -285034,9 +285759,14 @@ interface components {
285034
285759
  match: number;
285035
285760
  ai: number;
285036
285761
  };
285037
- /** @description The newest 3 automatic actions of the month; undo through POST /finanzas/automatic-actions/{kind}/{id}/undo. */
285762
+ /** @description The newest 3 groups of automatic actions of the month, one row each: the group's newest action plus the group's count and total. Undo an action through POST /finanzas/automatic-actions/{kind}/{id}/undo. */
285038
285763
  recent: (components["schemas"]["FinanzasAutomaticAction"] & {
285039
285764
  group_name: string;
285765
+ /** @description The Hecho por Vitrina group of the action: `own_transfers`, `cash_deposits`, `clinic_payments`, `contraparte:<id>` or, for the unassigned ones, `none:<accountId>`. */
285766
+ group_key: string;
285767
+ /** @description Actions in the whole group this month. */
285768
+ group_count: number;
285769
+ group_total_clp: number;
285040
285770
  })[];
285041
285771
  };
285042
285772
  accounts: {
@@ -285049,6 +285779,9 @@ interface components {
285049
285779
  currency: "CLP" | "USD";
285050
285780
  balance_clp: number | null;
285051
285781
  balance_as_of: string | null;
285782
+ data_through: string | null;
285783
+ /** @description true = no connection feeds the account and its newest movement is older than 37 days (D9): show «Datos hasta el …» as a warning with the cartola upload. */
285784
+ stale: boolean;
285052
285785
  /** @description False for savings accounts (not in «Caja hoy»). */
285053
285786
  in_cash: boolean;
285054
285787
  }[];