@vitrina/api 15.32.0 → 15.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -74224,13 +74224,13 @@ interface paths {
74224
74224
  * "at": "2026-10-30T12:00:04.000Z"
74225
74225
  * },
74226
74226
  * "consent": {
74227
- * "version": "mandato-2.2#6.5",
74227
+ * "version": "vitrina-mandato-1.0#6.5",
74228
74228
  * "accepted_at": "2026-10-30T12:00:00.000Z",
74229
74229
  * "current": true
74230
74230
  * },
74231
74231
  * "consent_required": false,
74232
74232
  * "consent_text": {
74233
- * "version": "mandato-2.2#6.5",
74233
+ * "version": "vitrina-mandato-1.0#6.5",
74234
74234
  * "title": "Conectar boletas de honorarios",
74235
74235
  * "points": [
74236
74236
  * "Guardamos la Clave Tributaria de la empresa para leer sus boletas de honorarios desde el SII."
@@ -82775,7 +82775,7 @@ interface paths {
82775
82775
  };
82776
82776
  /**
82777
82777
  * The «Por resolver» inbox: open cases, biggest first
82778
- * @description A case is the open money of one Contraparte that Vitrina could not resolve on its own: bank movements nothing explains, cost documents with no account, and money out classified with no document («Falta documento»). Cases are recomputed after every bank, Mercado Pago and SII sync and before every read; only cases whose inputs changed are rewritten. Sorted by the money at stake. `kind` filters; `total` and `amount_at_stake_clp` cover every open case of that filter. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
82778
+ * @description A case is the open money of one Contraparte that Vitrina could not resolve on its own: bank movements nothing explains, cost documents with no account, and money out classified with no document («Falta documento»). Cases are recomputed after every bank, Mercado Pago and SII sync and before every read; only cases whose inputs changed are rewritten. Sorted by the money at stake (`order=needs_person`: the cases a person must answer first). `kind` and `period` (`recent` = this month and last month, `history` = older) filter; `total` and `amount_at_stake_clp` cover every open case of that filter, `counts` splits them (recent / history, needs_person / ready) and `waiting` lists the payments «esperando factura» (no case yet). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
82779
82779
  */
82780
82780
  get: {
82781
82781
  parameters: {
@@ -82783,6 +82783,8 @@ interface paths {
82783
82783
  kind?: "reconcile" | "transfer" | "classify" | "missing_document" | "unknown" | "ads_charge";
82784
82784
  limit?: number;
82785
82785
  offset?: number | null;
82786
+ period?: "recent" | "history" | "all";
82787
+ order?: "amount" | "needs_person";
82786
82788
  };
82787
82789
  header?: never;
82788
82790
  path?: never;
@@ -82815,7 +82817,9 @@ interface paths {
82815
82817
  * "movement_count": 1,
82816
82818
  * "document_count": 2,
82817
82819
  * "ready": true,
82818
- * "opened_at": "2026-10-22T09:00:00.000Z"
82820
+ * "opened_at": "2026-10-22T09:00:00.000Z",
82821
+ * "latest_day": "2026-10-21",
82822
+ * "fingerprint": "9c1e4b7a2f0d5c8e1b3a6f9d2c5e8b1a4d7f0c3e"
82819
82823
  * },
82820
82824
  * {
82821
82825
  * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4c02",
@@ -82828,11 +82832,25 @@ interface paths {
82828
82832
  * "movement_count": 1,
82829
82833
  * "document_count": 0,
82830
82834
  * "ready": true,
82831
- * "opened_at": "2026-10-23T09:00:00.000Z"
82835
+ * "opened_at": "2026-10-23T09:00:00.000Z",
82836
+ * "latest_day": "2026-10-20",
82837
+ * "fingerprint": "9c1e4b7a2f0d5c8e1b3a6f9d2c5e8b1a4d7f0c3e"
82832
82838
  * }
82833
82839
  * ],
82834
82840
  * "total": 2,
82835
- * "amount_at_stake_clp": 855290
82841
+ * "amount_at_stake_clp": 855290,
82842
+ * "since": "2026-09-01",
82843
+ * "counts": {
82844
+ * "recent": 2,
82845
+ * "history": 0,
82846
+ * "needs_person": 0,
82847
+ * "ready": 2
82848
+ * },
82849
+ * "waiting": {
82850
+ * "count": 0,
82851
+ * "amount_clp": 0,
82852
+ * "items": []
82853
+ * }
82836
82854
  * }
82837
82855
  * }
82838
82856
  */
@@ -83211,6 +83229,137 @@ interface paths {
83211
83229
  patch?: never;
83212
83230
  trace?: never;
83213
83231
  };
83232
+ "/finanzas/cases/confirm-bulk": {
83233
+ parameters: {
83234
+ query?: never;
83235
+ header?: never;
83236
+ path?: never;
83237
+ cookie?: never;
83238
+ };
83239
+ get?: never;
83240
+ put?: never;
83241
+ /**
83242
+ * «Confirmar en bloque»: several ready cases at once
83243
+ * @description Confirms each case’s own proposal (every case must be `ready`), with the fingerprint the screen read it with. Each case is its own transaction: a changed, resolved, incomplete or refused case stays open and is listed in `failed` with its reason; the rest are confirmed. At most 100 per call. Audited. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
83244
+ */
83245
+ post: {
83246
+ parameters: {
83247
+ query?: {
83248
+ adjustment_reason?: string;
83249
+ };
83250
+ header?: {
83251
+ /** @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. */
83252
+ "Idempotency-Key"?: string;
83253
+ };
83254
+ path?: never;
83255
+ cookie?: never;
83256
+ };
83257
+ requestBody?: {
83258
+ content: {
83259
+ /**
83260
+ * @example {
83261
+ * "cases": [
83262
+ * {
83263
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4c01",
83264
+ * "fingerprint": "9c1e4b7a2f0d5c8e1b3a6f9d2c5e8b1a4d7f0c3e"
83265
+ * }
83266
+ * ]
83267
+ * }
83268
+ */
83269
+ "application/json": components["schemas"]["FinanzasCasesBulkConfirmBody"];
83270
+ };
83271
+ };
83272
+ responses: {
83273
+ /** @description Confirmed and refused cases */
83274
+ 200: {
83275
+ headers: {
83276
+ [name: string]: unknown;
83277
+ };
83278
+ content: {
83279
+ /**
83280
+ * @example {
83281
+ * "data": {
83282
+ * "confirmed": [
83283
+ * {
83284
+ * "case_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4c01",
83285
+ * "applied": {
83286
+ * "links": 1,
83287
+ * "classifications": 0,
83288
+ * "accepted": 0
83289
+ * }
83290
+ * }
83291
+ * ],
83292
+ * "failed": []
83293
+ * }
83294
+ * }
83295
+ */
83296
+ "application/json": {
83297
+ data: components["schemas"]["FinanzasCasesBulkConfirmResult"];
83298
+ };
83299
+ };
83300
+ };
83301
+ /** @description Validation error */
83302
+ 400: {
83303
+ headers: {
83304
+ [name: string]: unknown;
83305
+ };
83306
+ content: {
83307
+ "application/json": components["schemas"]["Error"];
83308
+ };
83309
+ };
83310
+ /** @description Unauthorized */
83311
+ 401: {
83312
+ headers: {
83313
+ [name: string]: unknown;
83314
+ };
83315
+ content: {
83316
+ "application/json": components["schemas"]["Error"];
83317
+ };
83318
+ };
83319
+ /** @description Forbidden */
83320
+ 403: {
83321
+ headers: {
83322
+ [name: string]: unknown;
83323
+ };
83324
+ content: {
83325
+ "application/json": components["schemas"]["Error"];
83326
+ };
83327
+ };
83328
+ /** @description Not found */
83329
+ 404: {
83330
+ headers: {
83331
+ [name: string]: unknown;
83332
+ };
83333
+ content: {
83334
+ "application/json": components["schemas"]["Error"];
83335
+ };
83336
+ };
83337
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
83338
+ 409: {
83339
+ headers: {
83340
+ [name: string]: unknown;
83341
+ };
83342
+ content: {
83343
+ "application/json": components["schemas"]["Error"];
83344
+ };
83345
+ };
83346
+ /** @description Rate limited */
83347
+ 429: {
83348
+ headers: {
83349
+ [name: string]: unknown;
83350
+ };
83351
+ content: {
83352
+ "application/json": components["schemas"]["Error"];
83353
+ };
83354
+ };
83355
+ };
83356
+ };
83357
+ delete?: never;
83358
+ options?: never;
83359
+ head?: never;
83360
+ patch?: never;
83361
+ trace?: never;
83362
+ };
83214
83363
  "/finanzas/cases/{id}/confirm": {
83215
83364
  parameters: {
83216
83365
  query?: never;
@@ -89869,6 +90018,7 @@ interface paths {
89869
90018
  state: "todo" | "waiting" | "done" | "problem" | "skipped";
89870
90019
  reason: string | null;
89871
90020
  }[];
90021
+ mandato?: components["schemas"]["FinanzasMandatoSignature"];
89872
90022
  /** @enum {string|null} */
89873
90023
  next_step: "razon_social" | "certificate" | "mandato" | "honorarios" | null;
89874
90024
  complete: boolean;
@@ -90255,8 +90405,8 @@ interface paths {
90255
90405
  get?: never;
90256
90406
  put?: never;
90257
90407
  /**
90258
- * A mandato signing link for the representante legal (step 3)
90259
- * @description The link the representante legal opens to sign the mandato. It is returned ONCE; asking again replaces the previous link. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
90408
+ * Vitrina's mandato for the representante legal to sign (step 3)
90409
+ * @description Renders Vitrina's mandato (`GET /legal/documents/sii_mandato`, version + SHA-256) for this razón social and opens it in Vitrina's signing service. Returns the representante legal's `signing_url` (also mailed to them unless `send_email: false`). A new request replaces an unsigned one; a signed mandato cannot be replaced. Once signed it is registered at the SII automatically (`sii.mandato.phase`: `connecting` → `connected`). Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
90260
90410
  */
90261
90411
  post: {
90262
90412
  parameters: {
@@ -90270,9 +90420,23 @@ interface paths {
90270
90420
  };
90271
90421
  cookie?: never;
90272
90422
  };
90273
- requestBody?: never;
90423
+ requestBody?: {
90424
+ content: {
90425
+ "application/json": {
90426
+ /** @description Who signs. Name and RUT default to the razón social's representante legal; the email is required (here or on file). */
90427
+ signer?: {
90428
+ name?: string;
90429
+ rut?: string;
90430
+ /** Format: email */
90431
+ email?: string;
90432
+ };
90433
+ /** @description Mail the signing link to the signer (default true). */
90434
+ send_email?: boolean;
90435
+ };
90436
+ };
90437
+ };
90274
90438
  responses: {
90275
- /** @description The signing link */
90439
+ /** @description The signing request */
90276
90440
  200: {
90277
90441
  headers: {
90278
90442
  [name: string]: unknown;
@@ -90281,8 +90445,27 @@ interface paths {
90281
90445
  /**
90282
90446
  * @example {
90283
90447
  * "data": {
90284
- * "signing_url": "https://example.invalid/mandato/abc",
90285
- * "status": "pending"
90448
+ * "signing_url": "https://sign.example.invalid/sign/abc",
90449
+ * "status": "pending",
90450
+ * "signature": {
90451
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5b09",
90452
+ * "phase": "pending_signature",
90453
+ * "status": "pending_signature",
90454
+ * "terms_version": "vitrina-mandato-1.0",
90455
+ * "terms_sha256": "4398b7f80be1fd551c62325241e39c9e14138a63860f0cb4dcdc5be175f981b4",
90456
+ * "signer": {
90457
+ * "name": "María Pérez Soto",
90458
+ * "rut": "12.345.678-5",
90459
+ * "email": "maria@empresa.cl"
90460
+ * },
90461
+ * "signing_url": "https://sign.example.invalid/sign/abc",
90462
+ * "signed_at": null,
90463
+ * "attested_at": null,
90464
+ * "problem": null,
90465
+ * "document_available": false,
90466
+ * "created_at": "2026-11-02T15:00:00.000Z"
90467
+ * },
90468
+ * "email_sent": true
90286
90469
  * }
90287
90470
  * }
90288
90471
  */
@@ -90290,6 +90473,340 @@ interface paths {
90290
90473
  data: {
90291
90474
  signing_url: string | null;
90292
90475
  status: string | null;
90476
+ signature?: components["schemas"]["FinanzasMandatoSignature"] & Record<string, never>;
90477
+ email_sent?: boolean;
90478
+ };
90479
+ };
90480
+ };
90481
+ };
90482
+ /** @description Validation error */
90483
+ 400: {
90484
+ headers: {
90485
+ [name: string]: unknown;
90486
+ };
90487
+ content: {
90488
+ "application/json": components["schemas"]["Error"];
90489
+ };
90490
+ };
90491
+ /** @description Unauthorized */
90492
+ 401: {
90493
+ headers: {
90494
+ [name: string]: unknown;
90495
+ };
90496
+ content: {
90497
+ "application/json": components["schemas"]["Error"];
90498
+ };
90499
+ };
90500
+ /** @description Forbidden */
90501
+ 403: {
90502
+ headers: {
90503
+ [name: string]: unknown;
90504
+ };
90505
+ content: {
90506
+ "application/json": components["schemas"]["Error"];
90507
+ };
90508
+ };
90509
+ /** @description Not found */
90510
+ 404: {
90511
+ headers: {
90512
+ [name: string]: unknown;
90513
+ };
90514
+ content: {
90515
+ "application/json": components["schemas"]["Error"];
90516
+ };
90517
+ };
90518
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
90519
+ 409: {
90520
+ headers: {
90521
+ [name: string]: unknown;
90522
+ };
90523
+ content: {
90524
+ "application/json": components["schemas"]["Error"];
90525
+ };
90526
+ };
90527
+ /** @description Rate limited */
90528
+ 429: {
90529
+ headers: {
90530
+ [name: string]: unknown;
90531
+ };
90532
+ content: {
90533
+ "application/json": components["schemas"]["Error"];
90534
+ };
90535
+ };
90536
+ };
90537
+ };
90538
+ delete?: never;
90539
+ options?: never;
90540
+ head?: never;
90541
+ patch?: never;
90542
+ trace?: never;
90543
+ };
90544
+ "/finanzas/connect-setup/sii/{id}/mandato/document": {
90545
+ parameters: {
90546
+ query?: never;
90547
+ header?: never;
90548
+ path?: never;
90549
+ cookie?: never;
90550
+ };
90551
+ /**
90552
+ * The signed mandato PDF
90553
+ * @description The signed mandato of this razón social (`file=signed`, default) or the signing service's certificate (`file=certificate`). 404 until it is signed. Requires `finanzas:read`.
90554
+ */
90555
+ get: {
90556
+ parameters: {
90557
+ query?: {
90558
+ file?: "signed" | "certificate";
90559
+ };
90560
+ header?: never;
90561
+ path: {
90562
+ id: string;
90563
+ };
90564
+ cookie?: never;
90565
+ };
90566
+ requestBody?: never;
90567
+ responses: {
90568
+ /** @description The PDF */
90569
+ 200: {
90570
+ headers: {
90571
+ [name: string]: unknown;
90572
+ };
90573
+ content: {
90574
+ "application/pdf": string;
90575
+ };
90576
+ };
90577
+ /** @description Validation error */
90578
+ 400: {
90579
+ headers: {
90580
+ [name: string]: unknown;
90581
+ };
90582
+ content: {
90583
+ "application/json": components["schemas"]["Error"];
90584
+ };
90585
+ };
90586
+ /** @description Unauthorized */
90587
+ 401: {
90588
+ headers: {
90589
+ [name: string]: unknown;
90590
+ };
90591
+ content: {
90592
+ "application/json": components["schemas"]["Error"];
90593
+ };
90594
+ };
90595
+ /** @description Forbidden */
90596
+ 403: {
90597
+ headers: {
90598
+ [name: string]: unknown;
90599
+ };
90600
+ content: {
90601
+ "application/json": components["schemas"]["Error"];
90602
+ };
90603
+ };
90604
+ /** @description Not found */
90605
+ 404: {
90606
+ headers: {
90607
+ [name: string]: unknown;
90608
+ };
90609
+ content: {
90610
+ "application/json": components["schemas"]["Error"];
90611
+ };
90612
+ };
90613
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
90614
+ 409: {
90615
+ headers: {
90616
+ [name: string]: unknown;
90617
+ };
90618
+ content: {
90619
+ "application/json": components["schemas"]["Error"];
90620
+ };
90621
+ };
90622
+ /** @description Rate limited */
90623
+ 429: {
90624
+ headers: {
90625
+ [name: string]: unknown;
90626
+ };
90627
+ content: {
90628
+ "application/json": components["schemas"]["Error"];
90629
+ };
90630
+ };
90631
+ };
90632
+ };
90633
+ put?: never;
90634
+ post?: never;
90635
+ delete?: never;
90636
+ options?: never;
90637
+ head?: never;
90638
+ patch?: never;
90639
+ trace?: never;
90640
+ };
90641
+ "/finanzas/connect-setup/sii/{id}/mandato/revoke": {
90642
+ parameters: {
90643
+ query?: never;
90644
+ header?: never;
90645
+ path?: never;
90646
+ cookie?: never;
90647
+ };
90648
+ get?: never;
90649
+ put?: never;
90650
+ /**
90651
+ * Revoke the mandato (cláusula 7.1)
90652
+ * @description Revokes the signed mandato at the SII and here, with immediate effect: the SII connection stops acting for the empresa until a new mandato is signed. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
90653
+ */
90654
+ post: {
90655
+ parameters: {
90656
+ query?: never;
90657
+ header?: {
90658
+ /** @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. */
90659
+ "Idempotency-Key"?: string;
90660
+ };
90661
+ path: {
90662
+ id: string;
90663
+ };
90664
+ cookie?: never;
90665
+ };
90666
+ requestBody?: never;
90667
+ responses: {
90668
+ /** @description The setup after the revocation */
90669
+ 200: {
90670
+ headers: {
90671
+ [name: string]: unknown;
90672
+ };
90673
+ content: {
90674
+ /**
90675
+ * @example {
90676
+ * "data": {
90677
+ * "bank": {
90678
+ * "state": "done",
90679
+ * "connected": 1,
90680
+ * "has_movements": true
90681
+ * },
90682
+ * "sii": {
90683
+ * "connection": {
90684
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5b01",
90685
+ * "legal_entity_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5b02",
90686
+ * "legal_name": "Clínica Ejemplo SpA",
90687
+ * "rut": "76123456-7",
90688
+ * "emission_on": false
90689
+ * },
90690
+ * "steps": [
90691
+ * {
90692
+ * "key": "razon_social",
90693
+ * "state": "done",
90694
+ * "reason": null
90695
+ * },
90696
+ * {
90697
+ * "key": "certificate",
90698
+ * "state": "done",
90699
+ * "reason": null
90700
+ * },
90701
+ * {
90702
+ * "key": "mandato",
90703
+ * "state": "waiting",
90704
+ * "reason": null
90705
+ * },
90706
+ * {
90707
+ * "key": "honorarios",
90708
+ * "state": "todo",
90709
+ * "reason": null
90710
+ * }
90711
+ * ],
90712
+ * "next_step": "honorarios",
90713
+ * "complete": false,
90714
+ * "honorarios": {
90715
+ * "evidence": false,
90716
+ * "declared_none_at": null,
90717
+ * "can_skip": true
90718
+ * },
90719
+ * "sociedades": [
90720
+ * {
90721
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5b02",
90722
+ * "legal_name": "Clínica Ejemplo SpA",
90723
+ * "tax_id": "76123456-7",
90724
+ * "connected": true
90725
+ * }
90726
+ * ],
90727
+ * "suggestion": null,
90728
+ * "live": false
90729
+ * },
90730
+ * "onboarding": {
90731
+ * "mode": "guided",
90732
+ * "started_at": "2026-11-02T13:00:00.000Z",
90733
+ * "deferred_at": null
90734
+ * }
90735
+ * }
90736
+ * }
90737
+ */
90738
+ "application/json": {
90739
+ data: {
90740
+ bank: {
90741
+ /** @enum {string} */
90742
+ state: "todo" | "done";
90743
+ connected: number;
90744
+ has_movements: boolean;
90745
+ /** @description Live direct bank links (Fintoc / bank API); Mercado Pago is not counted. */
90746
+ direct: number;
90747
+ /**
90748
+ * @description `direct` = a live bank link reads the bank; `email` = movements arrive as bank notification e-mails (with some delay); `statement` = only imported statements (cartola, Chipax); `none` = nothing yet.
90749
+ * @enum {string}
90750
+ */
90751
+ feed: "direct" | "email" | "statement" | "none";
90752
+ };
90753
+ sii: {
90754
+ connection: {
90755
+ /** Format: uuid */
90756
+ id: string;
90757
+ /** Format: uuid */
90758
+ legal_entity_id: string;
90759
+ legal_name: string | null;
90760
+ rut: string;
90761
+ emission_on: boolean;
90762
+ } | null;
90763
+ steps: {
90764
+ /** @enum {string} */
90765
+ key: "razon_social" | "certificate" | "mandato" | "honorarios";
90766
+ /** @enum {string} */
90767
+ state: "todo" | "waiting" | "done" | "problem" | "skipped";
90768
+ reason: string | null;
90769
+ }[];
90770
+ mandato?: components["schemas"]["FinanzasMandatoSignature"];
90771
+ /** @enum {string|null} */
90772
+ next_step: "razon_social" | "certificate" | "mandato" | "honorarios" | null;
90773
+ complete: boolean;
90774
+ honorarios: {
90775
+ evidence: boolean;
90776
+ declared_none_at: string | null;
90777
+ can_skip: boolean;
90778
+ };
90779
+ sociedades: {
90780
+ /** Format: uuid */
90781
+ id: string;
90782
+ legal_name: string;
90783
+ tax_id: string;
90784
+ connected: boolean;
90785
+ }[];
90786
+ suggestion: {
90787
+ /** @enum {string} */
90788
+ source: "billing" | "sii";
90789
+ rut: string | null;
90790
+ legal_name: string | null;
90791
+ giro: string | null;
90792
+ address_street: string | null;
90793
+ /** @description The house number, split off a billing street that carried it («Av. 21 de Mayo 1126» → street «Av. 21 de Mayo», number «1126»). */
90794
+ address_number: string | null;
90795
+ /** @description The billing comuna, else the one the workspace's branch addresses name after the street; null when none resolves to exactly one. */
90796
+ comuna_code: string | null;
90797
+ comuna_name: string | null;
90798
+ } | null;
90799
+ live: boolean;
90800
+ };
90801
+ onboarding: {
90802
+ /**
90803
+ * @description `guided` = the full-page start, only for a workspace with no Finanzas documents and no bank movements; `checklist` = the «Conecta tus cuentas» card on Resumen; `done` = bank and SII connected.
90804
+ * @enum {string}
90805
+ */
90806
+ mode: "guided" | "checklist" | "done";
90807
+ started_at: string | null;
90808
+ deferred_at: string | null;
90809
+ };
90293
90810
  };
90294
90811
  };
90295
90812
  };
@@ -90495,6 +91012,7 @@ interface paths {
90495
91012
  state: "todo" | "waiting" | "done" | "problem" | "skipped";
90496
91013
  reason: string | null;
90497
91014
  }[];
91015
+ mandato?: components["schemas"]["FinanzasMandatoSignature"];
90498
91016
  /** @enum {string|null} */
90499
91017
  next_step: "razon_social" | "certificate" | "mandato" | "honorarios" | null;
90500
91018
  complete: boolean;
@@ -260868,10 +261386,20 @@ interface components {
260868
261386
  /** @enum {string} */
260869
261387
  status: "active" | "paused" | "archived";
260870
261388
  /**
260871
- * @description person = created by a person; vitrina = Vitrina created it after a person confirmed the same classification twice for this Contraparte (announced in «Hecho por Vitrina»).
261389
+ * @description person = created by a person; vitrina = Vitrina created it, after a person confirmed the same classification twice for this Contraparte or from a consistent history (≥3 items, ≥90 % on one account), announced in «Hecho por Vitrina». Archive it to say no: Vitrina never proposes it again.
260872
261390
  * @enum {string}
260873
261391
  */
260874
261392
  origin: "person" | "vitrina";
261393
+ /**
261394
+ * @description The month the rule books a document in: issue_month, or previous_month («mes anterior»).
261395
+ * @enum {string}
261396
+ */
261397
+ accrual: "issue_month" | "previous_month";
261398
+ /**
261399
+ * @description Who chose `accrual`: default, vitrina (learned from where this supplier's documents were booked before) or person.
261400
+ * @enum {string}
261401
+ */
261402
+ accrual_set_by: "default" | "vitrina" | "person";
260875
261403
  run_count: number;
260876
261404
  last_applied_at: string | null;
260877
261405
  created_at: string;
@@ -261729,6 +262257,11 @@ interface components {
261729
262257
  account_id?: string | null;
261730
262258
  /** @description Plain-language alternative to `account_id`: the account name or path («Laboratorio», «Gastos de administración › Arriendo»), matched without case or accents. Ambiguous → 422 `account_ambiguous` with `details.candidates`. */
261731
262259
  account_name?: string | null;
262260
+ /**
262261
+ * @description The month the rule books a document in: `issue_month` (its issue date, the default) or `previous_month` («mes anterior»: a supplier that bills month M early in M+1). Vitrina learns it from history; a person setting it here wins for good.
262262
+ * @enum {string}
262263
+ */
262264
+ accrual?: "issue_month" | "previous_month";
261732
262265
  /**
261733
262266
  * @description Default `document` (or the type of `from_item`).
261734
262267
  * @enum {string}
@@ -261765,6 +262298,11 @@ interface components {
261765
262298
  account_id?: string | null;
261766
262299
  /** @description Plain-language alternative to `account_id`: the account name or path («Laboratorio», «Gastos de administración › Arriendo»), matched without case or accents. Ambiguous → 422 `account_ambiguous` with `details.candidates`. */
261767
262300
  account_name?: string | null;
262301
+ /**
262302
+ * @description The month the rule books a document in: `issue_month` (its issue date, the default) or `previous_month` («mes anterior»: a supplier that bills month M early in M+1). Vitrina learns it from history; a person setting it here wins for good.
262303
+ * @enum {string}
262304
+ */
262305
+ accrual?: "issue_month" | "previous_month";
261768
262306
  /**
261769
262307
  * @description `document`: classifies documents. `movement`: classifies bank movements that have no document (a gardener paid by transfer).
261770
262308
  * @enum {string}
@@ -262041,9 +262579,38 @@ interface components {
262041
262579
  document_count: number;
262042
262580
  ready: boolean;
262043
262581
  opened_at: string;
262582
+ /** @description The newest day the case touches (a movement, or a document it needs classified). */
262583
+ latest_day: string | null;
262584
+ /** @description The case as listed; «Confirmar en bloque» sends it back (a changed case is refused). */
262585
+ fingerprint: string;
262044
262586
  }[];
262045
262587
  total: number;
262046
262588
  amount_at_stake_clp: number;
262589
+ /** @description First day of last month: `period=recent` keeps the cases touching it or later; older ones are «Historial». */
262590
+ since: string;
262591
+ /** @description Open cases by period (every period) and, within the `period` asked, how many need a person vs are ready to confirm. */
262592
+ counts: {
262593
+ recent: number;
262594
+ history: number;
262595
+ needs_person: number;
262596
+ ready: number;
262597
+ };
262598
+ /** @description «Esperando factura»: payments to a supplier that always invoices, inside its usual wait for the document. No case and no classification until then (the factura links instead); after `wait_until` the payment opens a case asking for it. */
262599
+ waiting: {
262600
+ count: number;
262601
+ amount_clp: number;
262602
+ items: {
262603
+ movement_id: string;
262604
+ day: string;
262605
+ amount_clp: number;
262606
+ contraparte: {
262607
+ id: string;
262608
+ name: string | null;
262609
+ } | null;
262610
+ lag_days: number;
262611
+ wait_until: string | null;
262612
+ }[];
262613
+ };
262047
262614
  };
262048
262615
  FinanzasCaseCount: {
262049
262616
  open: number;
@@ -262178,6 +262745,8 @@ interface components {
262178
262745
  type: "document" | "movement";
262179
262746
  id: string;
262180
262747
  }[];
262748
+ /** @description Movement ids of payments to a supplier that always invoices, past its usual wait: the factura is missing. Never classified on their own nor asked to the IA. */
262749
+ awaiting_document?: string[];
262181
262750
  /** @description Finanzas 30, `ads_charge` cases only: the matcher's verdict per movement and the Meta charges / ad accounts that could be it. Amounts in the smallest unit of `currency`. */
262182
262751
  ads?: {
262183
262752
  /** @enum {string} */
@@ -262209,6 +262778,30 @@ interface components {
262209
262778
  opened_at: string;
262210
262779
  computed_at: string;
262211
262780
  };
262781
+ FinanzasCasesBulkConfirmResult: {
262782
+ confirmed: {
262783
+ case_id: string;
262784
+ applied: {
262785
+ links: number;
262786
+ classifications: number;
262787
+ accepted: number;
262788
+ };
262789
+ }[];
262790
+ failed: {
262791
+ case_id: string;
262792
+ /** @description resolved | fingerprint_mismatch | proposal_incomplete | refused */
262793
+ reason: string;
262794
+ message: string;
262795
+ }[];
262796
+ };
262797
+ FinanzasCasesBulkConfirmBody: {
262798
+ /** @description The ready cases to confirm with their own proposals, with the fingerprint each was read with. */
262799
+ cases: {
262800
+ /** Format: uuid */
262801
+ id: string;
262802
+ fingerprint: string;
262803
+ }[];
262804
+ };
262212
262805
  FinanzasCaseConfirmResult: {
262213
262806
  case_id: string;
262214
262807
  applied: {
@@ -263432,6 +264025,31 @@ interface components {
263432
264025
  };
263433
264026
  };
263434
264027
  FinanzasAlertList: components["schemas"]["FinanzasAlert"][];
264028
+ FinanzasMandatoSignature: {
264029
+ /** Format: uuid */
264030
+ id: string;
264031
+ /**
264032
+ * @description `pending_signature` = the representante legal has the link; `connecting` = signed, being registered at the SII («Firmado, conectando con el SII…»); `connected` = registered; `failed` = signed but the SII registration keeps failing (retried automatically); `declined` = the signer rejected; `revoked` = revoked in Bancos y SII.
264033
+ * @enum {string}
264034
+ */
264035
+ phase: "none" | "pending_signature" | "connecting" | "connected" | "failed" | "declined" | "revoked";
264036
+ status: string;
264037
+ terms_version: string;
264038
+ terms_sha256: string;
264039
+ signer: {
264040
+ name: string;
264041
+ rut: string;
264042
+ email: string;
264043
+ };
264044
+ /** @description The representante legal's signing link while the signature is pending; null afterwards. */
264045
+ signing_url: string | null;
264046
+ signed_at: string | null;
264047
+ attested_at: string | null;
264048
+ problem: string | null;
264049
+ /** @description The signed PDF can be downloaded (`GET …/sii/{id}/mandato/document`). */
264050
+ document_available: boolean;
264051
+ created_at: string;
264052
+ } | null;
263435
264053
  FinanzasDigestPreview: {
263436
264054
  /** @description Monday of this week (YYYY-MM-DD, workspace time). */
263437
264055
  week_start: string;