@vitrina/api 15.17.0 → 15.19.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
@@ -87872,6 +87872,126 @@ interface paths {
87872
87872
  patch?: never;
87873
87873
  trace?: never;
87874
87874
  };
87875
+ "/finanzas/alerts": {
87876
+ parameters: {
87877
+ query?: never;
87878
+ header?: never;
87879
+ path?: never;
87880
+ cookie?: never;
87881
+ };
87882
+ /**
87883
+ * Active Finanzas alerts
87884
+ * @description The alerts whose condition still holds: `cash_negative` (the Flujo de caja projection drops below zero in the next 30 days), `f29_due` (an F29 with something to pay is due within 5 days, unpaid) and `supplier_invoice_missing` (a Contraparte that invoiced each of the last 3 months has nothing this month, 3 days past its usual day). Evaluated hourly from 09:00 workspace time; each event is announced once to the owners and admins (bell and email by default; WhatsApp only on the opt-in `finanzas_whatsapp` rail) and leaves this list when its condition ends. Newest first. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise) and `finanzas:read`; the cash alert is listed only with `finanzas_reports:read` too.
87885
+ */
87886
+ get: {
87887
+ parameters: {
87888
+ query?: never;
87889
+ header?: never;
87890
+ path?: never;
87891
+ cookie?: never;
87892
+ };
87893
+ requestBody?: never;
87894
+ responses: {
87895
+ /** @description The active alerts */
87896
+ 200: {
87897
+ headers: {
87898
+ [name: string]: unknown;
87899
+ };
87900
+ content: {
87901
+ /**
87902
+ * @example {
87903
+ * "data": [
87904
+ * {
87905
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f8a01",
87906
+ * "kind": "f29_due",
87907
+ * "title": "El F29 de octubre vence el 20 de noviembre",
87908
+ * "body": "Hay que pagar $842.000 (monto estimado) al SII antes del 20 de noviembre. Cuando el pago aparezca en tus movimientos, el F29 queda como pagado.",
87909
+ * "cta_label": "Ver F29",
87910
+ * "path": "/finanzas/documentos?vista=f29",
87911
+ * "opened_on": "2026-11-15",
87912
+ * "notified_at": "2026-11-15T12:00:04.000Z",
87913
+ * "updated_at": "2026-11-16T12:00:03.000Z",
87914
+ * "data": {
87915
+ * "period": "2026-10",
87916
+ * "due_date": "2026-11-20",
87917
+ * "amount_clp": 842000,
87918
+ * "days_left": 4,
87919
+ * "amount_is_final": false,
87920
+ * "document_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7a01"
87921
+ * }
87922
+ * }
87923
+ * ]
87924
+ * }
87925
+ */
87926
+ "application/json": {
87927
+ data: components["schemas"]["FinanzasAlertList"];
87928
+ };
87929
+ };
87930
+ };
87931
+ /** @description Validation error */
87932
+ 400: {
87933
+ headers: {
87934
+ [name: string]: unknown;
87935
+ };
87936
+ content: {
87937
+ "application/json": components["schemas"]["Error"];
87938
+ };
87939
+ };
87940
+ /** @description Unauthorized */
87941
+ 401: {
87942
+ headers: {
87943
+ [name: string]: unknown;
87944
+ };
87945
+ content: {
87946
+ "application/json": components["schemas"]["Error"];
87947
+ };
87948
+ };
87949
+ /** @description Forbidden */
87950
+ 403: {
87951
+ headers: {
87952
+ [name: string]: unknown;
87953
+ };
87954
+ content: {
87955
+ "application/json": components["schemas"]["Error"];
87956
+ };
87957
+ };
87958
+ /** @description Not found */
87959
+ 404: {
87960
+ headers: {
87961
+ [name: string]: unknown;
87962
+ };
87963
+ content: {
87964
+ "application/json": components["schemas"]["Error"];
87965
+ };
87966
+ };
87967
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
87968
+ 409: {
87969
+ headers: {
87970
+ [name: string]: unknown;
87971
+ };
87972
+ content: {
87973
+ "application/json": components["schemas"]["Error"];
87974
+ };
87975
+ };
87976
+ /** @description Rate limited */
87977
+ 429: {
87978
+ headers: {
87979
+ [name: string]: unknown;
87980
+ };
87981
+ content: {
87982
+ "application/json": components["schemas"]["Error"];
87983
+ };
87984
+ };
87985
+ };
87986
+ };
87987
+ put?: never;
87988
+ post?: never;
87989
+ delete?: never;
87990
+ options?: never;
87991
+ head?: never;
87992
+ patch?: never;
87993
+ trace?: never;
87994
+ };
87875
87995
  "/finanzas/costos": {
87876
87996
  parameters: {
87877
87997
  query?: never;
@@ -88531,6 +88651,272 @@ interface paths {
88531
88651
  patch?: never;
88532
88652
  trace?: never;
88533
88653
  };
88654
+ "/finanzas/contador-export": {
88655
+ parameters: {
88656
+ query?: never;
88657
+ header?: never;
88658
+ path?: never;
88659
+ cookie?: never;
88660
+ };
88661
+ /**
88662
+ * Download the Contador package for a month (zip)
88663
+ * @description One zip, `paquete-contador-<period>.zip`, with seven xlsx: `01-libro-de-compras`, `02-libro-de-ventas`, `03-honorarios`, `04-movimientos-por-cuenta` (one sheet per bank account), `05-clasificaciones-por-cuenta` (net, as the Resultado counts), `06-resultado` and `07-ajustes-posteriores-al-cierre`, each `<name>-<period>.xlsx`, built by the same code as each screen and its export. Read-only. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» with no RUT; the libro de ventas keeps the patient RUT on facturas and on notas de crédito or débito that cite one, and 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`, `finanzas_reports:read` and `finanzas:export` (the Contador seat, owners and admins).
88664
+ */
88665
+ get: {
88666
+ parameters: {
88667
+ query?: {
88668
+ period?: string;
88669
+ };
88670
+ header?: never;
88671
+ path?: never;
88672
+ cookie?: never;
88673
+ };
88674
+ requestBody?: never;
88675
+ responses: {
88676
+ /** @description The package, as an attachment */
88677
+ 200: {
88678
+ headers: {
88679
+ [name: string]: unknown;
88680
+ };
88681
+ content: {
88682
+ "application/zip": string;
88683
+ };
88684
+ };
88685
+ /** @description Validation error */
88686
+ 400: {
88687
+ headers: {
88688
+ [name: string]: unknown;
88689
+ };
88690
+ content: {
88691
+ "application/json": components["schemas"]["Error"];
88692
+ };
88693
+ };
88694
+ /** @description Unauthorized */
88695
+ 401: {
88696
+ headers: {
88697
+ [name: string]: unknown;
88698
+ };
88699
+ content: {
88700
+ "application/json": components["schemas"]["Error"];
88701
+ };
88702
+ };
88703
+ /** @description Forbidden */
88704
+ 403: {
88705
+ headers: {
88706
+ [name: string]: unknown;
88707
+ };
88708
+ content: {
88709
+ "application/json": components["schemas"]["Error"];
88710
+ };
88711
+ };
88712
+ /** @description Not found */
88713
+ 404: {
88714
+ headers: {
88715
+ [name: string]: unknown;
88716
+ };
88717
+ content: {
88718
+ "application/json": components["schemas"]["Error"];
88719
+ };
88720
+ };
88721
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88722
+ 409: {
88723
+ headers: {
88724
+ [name: string]: unknown;
88725
+ };
88726
+ content: {
88727
+ "application/json": components["schemas"]["Error"];
88728
+ };
88729
+ };
88730
+ /** @description Rate limited */
88731
+ 429: {
88732
+ headers: {
88733
+ [name: string]: unknown;
88734
+ };
88735
+ content: {
88736
+ "application/json": components["schemas"]["Error"];
88737
+ };
88738
+ };
88739
+ };
88740
+ };
88741
+ put?: never;
88742
+ post?: never;
88743
+ delete?: never;
88744
+ options?: never;
88745
+ head?: never;
88746
+ patch?: never;
88747
+ trace?: never;
88748
+ };
88749
+ "/finanzas/contador-export/manifest": {
88750
+ parameters: {
88751
+ query?: never;
88752
+ header?: never;
88753
+ path?: never;
88754
+ cookie?: never;
88755
+ };
88756
+ /**
88757
+ * What the Contador package for a month holds
88758
+ * @description The same package as the download, without the bytes: the period, the zip name and each file (key, label, name, rows, size). Over MCP this is the read that generates and checks the package; the zip itself downloads over HTTPS. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» with no RUT; the libro de ventas keeps the patient RUT on facturas and on notas de crédito or débito that cite one, and 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`, `finanzas_reports:read` and `finanzas:export` (the Contador seat, owners and admins).
88759
+ */
88760
+ get: {
88761
+ parameters: {
88762
+ query?: {
88763
+ period?: string;
88764
+ };
88765
+ header?: never;
88766
+ path?: never;
88767
+ cookie?: never;
88768
+ };
88769
+ requestBody?: never;
88770
+ responses: {
88771
+ /** @description The manifest */
88772
+ 200: {
88773
+ headers: {
88774
+ [name: string]: unknown;
88775
+ };
88776
+ content: {
88777
+ /**
88778
+ * @example {
88779
+ * "data": {
88780
+ * "period": "2026-09",
88781
+ * "filename": "paquete-contador-2026-09.zip",
88782
+ * "files": [
88783
+ * {
88784
+ * "key": "libro_compras",
88785
+ * "label": "Libro de compras",
88786
+ * "filename": "01-libro-de-compras-2026-09.xlsx",
88787
+ * "rows": 84,
88788
+ * "size_bytes": 14210
88789
+ * },
88790
+ * {
88791
+ * "key": "libro_ventas",
88792
+ * "label": "Libro de ventas",
88793
+ * "filename": "02-libro-de-ventas-2026-09.xlsx",
88794
+ * "rows": 1312,
88795
+ * "size_bytes": 61904
88796
+ * },
88797
+ * {
88798
+ * "key": "honorarios",
88799
+ * "label": "Honorarios",
88800
+ * "filename": "03-honorarios-2026-09.xlsx",
88801
+ * "rows": 12,
88802
+ * "size_bytes": 7480
88803
+ * },
88804
+ * {
88805
+ * "key": "movimientos",
88806
+ * "label": "Movimientos por cuenta",
88807
+ * "filename": "04-movimientos-por-cuenta-2026-09.xlsx",
88808
+ * "rows": 640,
88809
+ * "size_bytes": 38112
88810
+ * },
88811
+ * {
88812
+ * "key": "clasificaciones",
88813
+ * "label": "Clasificaciones por cuenta",
88814
+ * "filename": "05-clasificaciones-por-cuenta-2026-09.xlsx",
88815
+ * "rows": 702,
88816
+ * "size_bytes": 40356
88817
+ * },
88818
+ * {
88819
+ * "key": "resultado",
88820
+ * "label": "Resultado",
88821
+ * "filename": "06-resultado-2026-09.xlsx",
88822
+ * "rows": 1398,
88823
+ * "size_bytes": 52018
88824
+ * },
88825
+ * {
88826
+ * "key": "ajustes",
88827
+ * "label": "Ajustes posteriores al cierre",
88828
+ * "filename": "07-ajustes-posteriores-al-cierre-2026-09.xlsx",
88829
+ * "rows": 3,
88830
+ * "size_bytes": 6920
88831
+ * }
88832
+ * ]
88833
+ * }
88834
+ * }
88835
+ */
88836
+ "application/json": {
88837
+ data: {
88838
+ /** @description The month, `YYYY-MM`. */
88839
+ period: string;
88840
+ /** @description The zip the download serves. */
88841
+ filename: string;
88842
+ files: {
88843
+ /** @enum {string} */
88844
+ key: "libro_compras" | "libro_ventas" | "honorarios" | "movimientos" | "clasificaciones" | "resultado" | "ajustes";
88845
+ label: string;
88846
+ /** @description The xlsx inside the zip. */
88847
+ filename: string;
88848
+ /** @description Rows of its «Detalle» sheet (documents, items) when it has one, else of its first sheet (movements, adjustments). */
88849
+ rows: number;
88850
+ size_bytes: number;
88851
+ }[];
88852
+ };
88853
+ };
88854
+ };
88855
+ };
88856
+ /** @description Validation error */
88857
+ 400: {
88858
+ headers: {
88859
+ [name: string]: unknown;
88860
+ };
88861
+ content: {
88862
+ "application/json": components["schemas"]["Error"];
88863
+ };
88864
+ };
88865
+ /** @description Unauthorized */
88866
+ 401: {
88867
+ headers: {
88868
+ [name: string]: unknown;
88869
+ };
88870
+ content: {
88871
+ "application/json": components["schemas"]["Error"];
88872
+ };
88873
+ };
88874
+ /** @description Forbidden */
88875
+ 403: {
88876
+ headers: {
88877
+ [name: string]: unknown;
88878
+ };
88879
+ content: {
88880
+ "application/json": components["schemas"]["Error"];
88881
+ };
88882
+ };
88883
+ /** @description Not found */
88884
+ 404: {
88885
+ headers: {
88886
+ [name: string]: unknown;
88887
+ };
88888
+ content: {
88889
+ "application/json": components["schemas"]["Error"];
88890
+ };
88891
+ };
88892
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88893
+ 409: {
88894
+ headers: {
88895
+ [name: string]: unknown;
88896
+ };
88897
+ content: {
88898
+ "application/json": components["schemas"]["Error"];
88899
+ };
88900
+ };
88901
+ /** @description Rate limited */
88902
+ 429: {
88903
+ headers: {
88904
+ [name: string]: unknown;
88905
+ };
88906
+ content: {
88907
+ "application/json": components["schemas"]["Error"];
88908
+ };
88909
+ };
88910
+ };
88911
+ };
88912
+ put?: never;
88913
+ post?: never;
88914
+ delete?: never;
88915
+ options?: never;
88916
+ head?: never;
88917
+ patch?: never;
88918
+ trace?: never;
88919
+ };
88534
88920
  "/clinic/evidence-cards": {
88535
88921
  parameters: {
88536
88922
  query?: never;
@@ -237700,6 +238086,8 @@ interface paths {
237700
238086
  * This car’s lead timeline
237701
238087
  * @description Every named lead that asked about this vehicle, merged with its anonymous Yapo phone-reveals, newest first. This is the car’s HISTORY, so unlike `/interest` a sold vehicle keeps its timeline.
237702
238088
  *
238089
+ * Each lead row carries `conversation_id`: the chat to open for that person (the lead's own conversation, else the contact's most recent one, e.g. the first-touch WhatsApp after a portal inquiry). Null when there is none.
238090
+ *
237703
238091
  * The Stock detail screen merges this with `/vehicles/{id}/history` (the change log) into one "Leads y cambios" feed — they are two endpoints because they are two different kinds of event. Automotive-vertical only: a workspace on another vertical gets 403 here however its scopes are set.
237704
238092
  */
237705
238093
  get: {
@@ -237728,6 +238116,7 @@ interface paths {
237728
238116
  * "kind": "lead",
237729
238117
  * "contact_id": "22222222-0000-4000-8000-000000000001",
237730
238118
  * "lead_id": "99999999-0000-4000-8000-000000000002",
238119
+ * "conversation_id": "99999999-0000-4000-8000-000000000003",
237731
238120
  * "portal": "website",
237732
238121
  * "at": "2026-09-19T15:30:00.000Z"
237733
238122
  * }
@@ -254428,7 +254817,7 @@ interface components {
254428
254817
  /** @enum {string} */
254429
254818
  kind: "page";
254430
254819
  /** @enum {string} */
254431
- page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254820
+ page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "finanzas.flujo_de_caja" | "finanzas.f29" | "finanzas.contraparte" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254432
254821
  params?: {
254433
254822
  [key: string]: string | number | boolean;
254434
254823
  };
@@ -254470,7 +254859,7 @@ interface components {
254470
254859
  /** @enum {string} */
254471
254860
  kind: "page";
254472
254861
  /** @enum {string} */
254473
- page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254862
+ page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "finanzas.flujo_de_caja" | "finanzas.f29" | "finanzas.contraparte" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254474
254863
  params?: {
254475
254864
  [key: string]: string | number | boolean;
254476
254865
  };
@@ -254497,7 +254886,7 @@ interface components {
254497
254886
  /** @enum {string} */
254498
254887
  kind: "page";
254499
254888
  /** @enum {string} */
254500
- page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254889
+ page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "finanzas.flujo_de_caja" | "finanzas.f29" | "finanzas.contraparte" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254501
254890
  params?: {
254502
254891
  [key: string]: string | number | boolean;
254503
254892
  };
@@ -254511,11 +254900,11 @@ interface components {
254511
254900
  /** @enum {string} */
254512
254901
  preset: "important" | "all" | "custom";
254513
254902
  push_enabled: boolean;
254514
- categories: ("inbox" | "agenda" | "sales" | "followups" | "approvals" | "payments" | "agents" | "integrations" | "safety" | "account")[];
254903
+ categories: ("inbox" | "agenda" | "sales" | "followups" | "approvals" | "payments" | "agents" | "integrations" | "finanzas" | "safety" | "account")[];
254515
254904
  types: {
254516
254905
  key: string;
254517
254906
  /** @enum {string} */
254518
- category: "inbox" | "agenda" | "sales" | "followups" | "approvals" | "payments" | "agents" | "integrations" | "safety" | "account";
254907
+ category: "inbox" | "agenda" | "sales" | "followups" | "approvals" | "payments" | "agents" | "integrations" | "finanzas" | "safety" | "account";
254519
254908
  /** @description i18n slug: the UI renders `notif.<slug>.title` / `.when`. */
254520
254909
  slug: string;
254521
254910
  mandatory: boolean;
@@ -254595,7 +254984,7 @@ interface components {
254595
254984
  perfect_battery_pct?: number;
254596
254985
  currency?: string;
254597
254986
  };
254598
- /** @description Workspace notification rails. The staff WhatsApp rails (`staff_whatsapp`, `unanswered_supervisor_whatsapp`, `booking_whatsapp`) are opt-in: arming one (`enabled: true` with an `account_id`) submits its template to Meta on that number and wires it on approval. Each rail sent replaces that rail whole; rails not sent are kept. */
254987
+ /** @description Workspace notification rails. The staff WhatsApp rails (`staff_whatsapp`, `unanswered_supervisor_whatsapp`, `booking_whatsapp`, `reminder_whatsapp`, `finanzas_whatsapp`) are opt-in: arming one (`enabled: true` with an `account_id`) submits its template to Meta on that number and wires it on approval. Each rail sent replaces that rail whole; rails not sent are kept. */
254599
254988
  notifications?: {
254600
254989
  staff_whatsapp?: {
254601
254990
  enabled?: boolean;
@@ -254611,6 +255000,16 @@ interface components {
254611
255000
  template_name?: string;
254612
255001
  template_language?: string;
254613
255002
  user_ids?: string[];
255003
+ /** @description Minutes of open time a conversation waits on the team before the supervisors get the WhatsApp, once per episode. Unset = 60. */
255004
+ delay_minutes?: number;
255005
+ };
255006
+ /** @description Staff WhatsApp on every «sin respuesta» reminder, to the assignee (template aviso_sigue_esperando_v1). Opt-in: each send costs a WhatsApp conversation. */
255007
+ reminder_whatsapp?: {
255008
+ enabled?: boolean;
255009
+ /** Format: uuid */
255010
+ account_id?: string;
255011
+ template_name?: string;
255012
+ template_language?: string;
254614
255013
  };
254615
255014
  booking_whatsapp?: {
254616
255015
  enabled?: boolean;
@@ -254620,6 +255019,13 @@ interface components {
254620
255019
  template_language?: string;
254621
255020
  change_template_name?: string;
254622
255021
  };
255022
+ finanzas_whatsapp?: {
255023
+ enabled?: boolean;
255024
+ /** Format: uuid */
255025
+ account_id?: string;
255026
+ template_name?: string;
255027
+ template_language?: string;
255028
+ };
254623
255029
  stock_alert?: {
254624
255030
  /** @description Lead stages that trigger the «Stock faltante» check when a lead moves into them. Empty turns it off. */
254625
255031
  stage_ids: string[];
@@ -254687,6 +255093,46 @@ interface components {
254687
255093
  rejection_reason: string | null;
254688
255094
  }[];
254689
255095
  };
255096
+ finanzas_whatsapp: {
255097
+ /** @description The rail is switched on (`enabled: true`). */
255098
+ armed: boolean;
255099
+ /**
255100
+ * @description Worst state across the rail templates (blocked, rejected, missing, pending, approved); `off` when not armed or nothing to provision; `no_number` when armed without a sending number.
255101
+ * @enum {string}
255102
+ */
255103
+ template_state: "off" | "no_number" | "missing" | "pending" | "approved" | "rejected" | "blocked";
255104
+ reason: string | null;
255105
+ /** @description The rail has its template name set (by an admin or on approval). */
255106
+ wired: boolean;
255107
+ templates: {
255108
+ key: string;
255109
+ name: string;
255110
+ language: string;
255111
+ /** @enum {string} */
255112
+ state: "missing" | "pending" | "approved" | "rejected" | "blocked";
255113
+ rejection_reason: string | null;
255114
+ }[];
255115
+ };
255116
+ reminder_whatsapp: {
255117
+ /** @description The rail is switched on (`enabled: true`). */
255118
+ armed: boolean;
255119
+ /**
255120
+ * @description Worst state across the rail templates (blocked, rejected, missing, pending, approved); `off` when not armed or nothing to provision; `no_number` when armed without a sending number.
255121
+ * @enum {string}
255122
+ */
255123
+ template_state: "off" | "no_number" | "missing" | "pending" | "approved" | "rejected" | "blocked";
255124
+ reason: string | null;
255125
+ /** @description The rail has its template name set (by an admin or on approval). */
255126
+ wired: boolean;
255127
+ templates: {
255128
+ key: string;
255129
+ name: string;
255130
+ language: string;
255131
+ /** @enum {string} */
255132
+ state: "missing" | "pending" | "approved" | "rejected" | "blocked";
255133
+ rejection_reason: string | null;
255134
+ }[];
255135
+ };
254690
255136
  };
254691
255137
  /** @description Workspace display name. */
254692
255138
  name?: string;
@@ -254899,6 +255345,16 @@ interface components {
254899
255345
  template_name?: string;
254900
255346
  template_language?: string;
254901
255347
  user_ids?: string[];
255348
+ /** @description Minutes of open time a conversation waits on the team before the supervisors get the WhatsApp, once per episode. Unset = 60. */
255349
+ delay_minutes?: number;
255350
+ };
255351
+ /** @description Staff WhatsApp on every «sin respuesta» reminder, to the assignee (template aviso_sigue_esperando_v1). Opt-in: each send costs a WhatsApp conversation. */
255352
+ reminder_whatsapp?: {
255353
+ enabled?: boolean;
255354
+ /** Format: uuid */
255355
+ account_id?: string;
255356
+ template_name?: string;
255357
+ template_language?: string;
254902
255358
  };
254903
255359
  booking_whatsapp?: {
254904
255360
  enabled?: boolean;
@@ -254908,6 +255364,13 @@ interface components {
254908
255364
  template_language?: string;
254909
255365
  change_template_name?: string;
254910
255366
  };
255367
+ finanzas_whatsapp?: {
255368
+ enabled?: boolean;
255369
+ /** Format: uuid */
255370
+ account_id?: string;
255371
+ template_name?: string;
255372
+ template_language?: string;
255373
+ };
254911
255374
  stock_alert?: {
254912
255375
  /** @description Lead stages that trigger the «Stock faltante» check when a lead moves into them. Empty turns it off. */
254913
255376
  stage_ids: string[];
@@ -258823,6 +259286,33 @@ interface components {
258823
259286
  /** @description The last day an occurrence may fall on. Default: today (the day before it starts, if it has not started). */
258824
259287
  ends_on?: string | null;
258825
259288
  };
259289
+ FinanzasAlert: {
259290
+ /** Format: uuid */
259291
+ id: string;
259292
+ /**
259293
+ * @description `cash_negative`: the Flujo de caja projection drops below zero in the next 30 days. `f29_due`: an F29 with something to pay is due within 5 days and is unpaid. `supplier_invoice_missing`: a Contraparte that invoiced each of the last 3 months has no invoice this month, 3 days past its usual day.
259294
+ * @enum {string}
259295
+ */
259296
+ kind: "cash_negative" | "f29_due" | "supplier_invoice_missing";
259297
+ /** @description One line, Spanish. */
259298
+ title: string;
259299
+ /** @description What happened and what to do. */
259300
+ body: string;
259301
+ /** @description The button that fixes it. */
259302
+ cta_label: string;
259303
+ /** @description Workspace-relative screen that fixes it (`/finanzas/reportes/flujo-de-caja`, `/finanzas/documentos?vista=f29`, `/finanzas/contrapartes/<id>`). */
259304
+ path: string;
259305
+ /** @description Day first seen (YYYY-MM-DD, Santiago). */
259306
+ opened_on: string;
259307
+ /** @description When the members were told; null until then. */
259308
+ notified_at: string | null;
259309
+ updated_at: string;
259310
+ /** @description The facts, whole CLP. cash_negative: `lowest_date`, `lowest_balance_clp`, `today_balance_clp`, `cause_label`, `cause_amount_clp`, `horizon_days`. f29_due: `period`, `due_date`, `amount_clp`, `days_left`, `amount_is_final`, `document_id`. supplier_invoice_missing: `contraparte_id`, `contraparte_name`, `period`, `usual_day`, `typical_amount_clp`, `months_invoiced`. */
259311
+ data: {
259312
+ [key: string]: unknown;
259313
+ };
259314
+ };
259315
+ FinanzasAlertList: components["schemas"]["FinanzasAlert"][];
258826
259316
  FinanzasCostos: {
258827
259317
  from: string;
258828
259318
  to: string;
package/dist/index.d.ts CHANGED
@@ -87872,6 +87872,126 @@ interface paths {
87872
87872
  patch?: never;
87873
87873
  trace?: never;
87874
87874
  };
87875
+ "/finanzas/alerts": {
87876
+ parameters: {
87877
+ query?: never;
87878
+ header?: never;
87879
+ path?: never;
87880
+ cookie?: never;
87881
+ };
87882
+ /**
87883
+ * Active Finanzas alerts
87884
+ * @description The alerts whose condition still holds: `cash_negative` (the Flujo de caja projection drops below zero in the next 30 days), `f29_due` (an F29 with something to pay is due within 5 days, unpaid) and `supplier_invoice_missing` (a Contraparte that invoiced each of the last 3 months has nothing this month, 3 days past its usual day). Evaluated hourly from 09:00 workspace time; each event is announced once to the owners and admins (bell and email by default; WhatsApp only on the opt-in `finanzas_whatsapp` rail) and leaves this list when its condition ends. Newest first. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise) and `finanzas:read`; the cash alert is listed only with `finanzas_reports:read` too.
87885
+ */
87886
+ get: {
87887
+ parameters: {
87888
+ query?: never;
87889
+ header?: never;
87890
+ path?: never;
87891
+ cookie?: never;
87892
+ };
87893
+ requestBody?: never;
87894
+ responses: {
87895
+ /** @description The active alerts */
87896
+ 200: {
87897
+ headers: {
87898
+ [name: string]: unknown;
87899
+ };
87900
+ content: {
87901
+ /**
87902
+ * @example {
87903
+ * "data": [
87904
+ * {
87905
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f8a01",
87906
+ * "kind": "f29_due",
87907
+ * "title": "El F29 de octubre vence el 20 de noviembre",
87908
+ * "body": "Hay que pagar $842.000 (monto estimado) al SII antes del 20 de noviembre. Cuando el pago aparezca en tus movimientos, el F29 queda como pagado.",
87909
+ * "cta_label": "Ver F29",
87910
+ * "path": "/finanzas/documentos?vista=f29",
87911
+ * "opened_on": "2026-11-15",
87912
+ * "notified_at": "2026-11-15T12:00:04.000Z",
87913
+ * "updated_at": "2026-11-16T12:00:03.000Z",
87914
+ * "data": {
87915
+ * "period": "2026-10",
87916
+ * "due_date": "2026-11-20",
87917
+ * "amount_clp": 842000,
87918
+ * "days_left": 4,
87919
+ * "amount_is_final": false,
87920
+ * "document_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7a01"
87921
+ * }
87922
+ * }
87923
+ * ]
87924
+ * }
87925
+ */
87926
+ "application/json": {
87927
+ data: components["schemas"]["FinanzasAlertList"];
87928
+ };
87929
+ };
87930
+ };
87931
+ /** @description Validation error */
87932
+ 400: {
87933
+ headers: {
87934
+ [name: string]: unknown;
87935
+ };
87936
+ content: {
87937
+ "application/json": components["schemas"]["Error"];
87938
+ };
87939
+ };
87940
+ /** @description Unauthorized */
87941
+ 401: {
87942
+ headers: {
87943
+ [name: string]: unknown;
87944
+ };
87945
+ content: {
87946
+ "application/json": components["schemas"]["Error"];
87947
+ };
87948
+ };
87949
+ /** @description Forbidden */
87950
+ 403: {
87951
+ headers: {
87952
+ [name: string]: unknown;
87953
+ };
87954
+ content: {
87955
+ "application/json": components["schemas"]["Error"];
87956
+ };
87957
+ };
87958
+ /** @description Not found */
87959
+ 404: {
87960
+ headers: {
87961
+ [name: string]: unknown;
87962
+ };
87963
+ content: {
87964
+ "application/json": components["schemas"]["Error"];
87965
+ };
87966
+ };
87967
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
87968
+ 409: {
87969
+ headers: {
87970
+ [name: string]: unknown;
87971
+ };
87972
+ content: {
87973
+ "application/json": components["schemas"]["Error"];
87974
+ };
87975
+ };
87976
+ /** @description Rate limited */
87977
+ 429: {
87978
+ headers: {
87979
+ [name: string]: unknown;
87980
+ };
87981
+ content: {
87982
+ "application/json": components["schemas"]["Error"];
87983
+ };
87984
+ };
87985
+ };
87986
+ };
87987
+ put?: never;
87988
+ post?: never;
87989
+ delete?: never;
87990
+ options?: never;
87991
+ head?: never;
87992
+ patch?: never;
87993
+ trace?: never;
87994
+ };
87875
87995
  "/finanzas/costos": {
87876
87996
  parameters: {
87877
87997
  query?: never;
@@ -88531,6 +88651,272 @@ interface paths {
88531
88651
  patch?: never;
88532
88652
  trace?: never;
88533
88653
  };
88654
+ "/finanzas/contador-export": {
88655
+ parameters: {
88656
+ query?: never;
88657
+ header?: never;
88658
+ path?: never;
88659
+ cookie?: never;
88660
+ };
88661
+ /**
88662
+ * Download the Contador package for a month (zip)
88663
+ * @description One zip, `paquete-contador-<period>.zip`, with seven xlsx: `01-libro-de-compras`, `02-libro-de-ventas`, `03-honorarios`, `04-movimientos-por-cuenta` (one sheet per bank account), `05-clasificaciones-por-cuenta` (net, as the Resultado counts), `06-resultado` and `07-ajustes-posteriores-al-cierre`, each `<name>-<period>.xlsx`, built by the same code as each screen and its export. Read-only. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» with no RUT; the libro de ventas keeps the patient RUT on facturas and on notas de crédito or débito that cite one, and 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`, `finanzas_reports:read` and `finanzas:export` (the Contador seat, owners and admins).
88664
+ */
88665
+ get: {
88666
+ parameters: {
88667
+ query?: {
88668
+ period?: string;
88669
+ };
88670
+ header?: never;
88671
+ path?: never;
88672
+ cookie?: never;
88673
+ };
88674
+ requestBody?: never;
88675
+ responses: {
88676
+ /** @description The package, as an attachment */
88677
+ 200: {
88678
+ headers: {
88679
+ [name: string]: unknown;
88680
+ };
88681
+ content: {
88682
+ "application/zip": string;
88683
+ };
88684
+ };
88685
+ /** @description Validation error */
88686
+ 400: {
88687
+ headers: {
88688
+ [name: string]: unknown;
88689
+ };
88690
+ content: {
88691
+ "application/json": components["schemas"]["Error"];
88692
+ };
88693
+ };
88694
+ /** @description Unauthorized */
88695
+ 401: {
88696
+ headers: {
88697
+ [name: string]: unknown;
88698
+ };
88699
+ content: {
88700
+ "application/json": components["schemas"]["Error"];
88701
+ };
88702
+ };
88703
+ /** @description Forbidden */
88704
+ 403: {
88705
+ headers: {
88706
+ [name: string]: unknown;
88707
+ };
88708
+ content: {
88709
+ "application/json": components["schemas"]["Error"];
88710
+ };
88711
+ };
88712
+ /** @description Not found */
88713
+ 404: {
88714
+ headers: {
88715
+ [name: string]: unknown;
88716
+ };
88717
+ content: {
88718
+ "application/json": components["schemas"]["Error"];
88719
+ };
88720
+ };
88721
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88722
+ 409: {
88723
+ headers: {
88724
+ [name: string]: unknown;
88725
+ };
88726
+ content: {
88727
+ "application/json": components["schemas"]["Error"];
88728
+ };
88729
+ };
88730
+ /** @description Rate limited */
88731
+ 429: {
88732
+ headers: {
88733
+ [name: string]: unknown;
88734
+ };
88735
+ content: {
88736
+ "application/json": components["schemas"]["Error"];
88737
+ };
88738
+ };
88739
+ };
88740
+ };
88741
+ put?: never;
88742
+ post?: never;
88743
+ delete?: never;
88744
+ options?: never;
88745
+ head?: never;
88746
+ patch?: never;
88747
+ trace?: never;
88748
+ };
88749
+ "/finanzas/contador-export/manifest": {
88750
+ parameters: {
88751
+ query?: never;
88752
+ header?: never;
88753
+ path?: never;
88754
+ cookie?: never;
88755
+ };
88756
+ /**
88757
+ * What the Contador package for a month holds
88758
+ * @description The same package as the download, without the bytes: the period, the zip name and each file (key, label, name, rows, size). Over MCP this is the read that generates and checks the package; the zip itself downloads over HTTPS. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» with no RUT; the libro de ventas keeps the patient RUT on facturas and on notas de crédito or débito that cite one, and 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`, `finanzas_reports:read` and `finanzas:export` (the Contador seat, owners and admins).
88759
+ */
88760
+ get: {
88761
+ parameters: {
88762
+ query?: {
88763
+ period?: string;
88764
+ };
88765
+ header?: never;
88766
+ path?: never;
88767
+ cookie?: never;
88768
+ };
88769
+ requestBody?: never;
88770
+ responses: {
88771
+ /** @description The manifest */
88772
+ 200: {
88773
+ headers: {
88774
+ [name: string]: unknown;
88775
+ };
88776
+ content: {
88777
+ /**
88778
+ * @example {
88779
+ * "data": {
88780
+ * "period": "2026-09",
88781
+ * "filename": "paquete-contador-2026-09.zip",
88782
+ * "files": [
88783
+ * {
88784
+ * "key": "libro_compras",
88785
+ * "label": "Libro de compras",
88786
+ * "filename": "01-libro-de-compras-2026-09.xlsx",
88787
+ * "rows": 84,
88788
+ * "size_bytes": 14210
88789
+ * },
88790
+ * {
88791
+ * "key": "libro_ventas",
88792
+ * "label": "Libro de ventas",
88793
+ * "filename": "02-libro-de-ventas-2026-09.xlsx",
88794
+ * "rows": 1312,
88795
+ * "size_bytes": 61904
88796
+ * },
88797
+ * {
88798
+ * "key": "honorarios",
88799
+ * "label": "Honorarios",
88800
+ * "filename": "03-honorarios-2026-09.xlsx",
88801
+ * "rows": 12,
88802
+ * "size_bytes": 7480
88803
+ * },
88804
+ * {
88805
+ * "key": "movimientos",
88806
+ * "label": "Movimientos por cuenta",
88807
+ * "filename": "04-movimientos-por-cuenta-2026-09.xlsx",
88808
+ * "rows": 640,
88809
+ * "size_bytes": 38112
88810
+ * },
88811
+ * {
88812
+ * "key": "clasificaciones",
88813
+ * "label": "Clasificaciones por cuenta",
88814
+ * "filename": "05-clasificaciones-por-cuenta-2026-09.xlsx",
88815
+ * "rows": 702,
88816
+ * "size_bytes": 40356
88817
+ * },
88818
+ * {
88819
+ * "key": "resultado",
88820
+ * "label": "Resultado",
88821
+ * "filename": "06-resultado-2026-09.xlsx",
88822
+ * "rows": 1398,
88823
+ * "size_bytes": 52018
88824
+ * },
88825
+ * {
88826
+ * "key": "ajustes",
88827
+ * "label": "Ajustes posteriores al cierre",
88828
+ * "filename": "07-ajustes-posteriores-al-cierre-2026-09.xlsx",
88829
+ * "rows": 3,
88830
+ * "size_bytes": 6920
88831
+ * }
88832
+ * ]
88833
+ * }
88834
+ * }
88835
+ */
88836
+ "application/json": {
88837
+ data: {
88838
+ /** @description The month, `YYYY-MM`. */
88839
+ period: string;
88840
+ /** @description The zip the download serves. */
88841
+ filename: string;
88842
+ files: {
88843
+ /** @enum {string} */
88844
+ key: "libro_compras" | "libro_ventas" | "honorarios" | "movimientos" | "clasificaciones" | "resultado" | "ajustes";
88845
+ label: string;
88846
+ /** @description The xlsx inside the zip. */
88847
+ filename: string;
88848
+ /** @description Rows of its «Detalle» sheet (documents, items) when it has one, else of its first sheet (movements, adjustments). */
88849
+ rows: number;
88850
+ size_bytes: number;
88851
+ }[];
88852
+ };
88853
+ };
88854
+ };
88855
+ };
88856
+ /** @description Validation error */
88857
+ 400: {
88858
+ headers: {
88859
+ [name: string]: unknown;
88860
+ };
88861
+ content: {
88862
+ "application/json": components["schemas"]["Error"];
88863
+ };
88864
+ };
88865
+ /** @description Unauthorized */
88866
+ 401: {
88867
+ headers: {
88868
+ [name: string]: unknown;
88869
+ };
88870
+ content: {
88871
+ "application/json": components["schemas"]["Error"];
88872
+ };
88873
+ };
88874
+ /** @description Forbidden */
88875
+ 403: {
88876
+ headers: {
88877
+ [name: string]: unknown;
88878
+ };
88879
+ content: {
88880
+ "application/json": components["schemas"]["Error"];
88881
+ };
88882
+ };
88883
+ /** @description Not found */
88884
+ 404: {
88885
+ headers: {
88886
+ [name: string]: unknown;
88887
+ };
88888
+ content: {
88889
+ "application/json": components["schemas"]["Error"];
88890
+ };
88891
+ };
88892
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88893
+ 409: {
88894
+ headers: {
88895
+ [name: string]: unknown;
88896
+ };
88897
+ content: {
88898
+ "application/json": components["schemas"]["Error"];
88899
+ };
88900
+ };
88901
+ /** @description Rate limited */
88902
+ 429: {
88903
+ headers: {
88904
+ [name: string]: unknown;
88905
+ };
88906
+ content: {
88907
+ "application/json": components["schemas"]["Error"];
88908
+ };
88909
+ };
88910
+ };
88911
+ };
88912
+ put?: never;
88913
+ post?: never;
88914
+ delete?: never;
88915
+ options?: never;
88916
+ head?: never;
88917
+ patch?: never;
88918
+ trace?: never;
88919
+ };
88534
88920
  "/clinic/evidence-cards": {
88535
88921
  parameters: {
88536
88922
  query?: never;
@@ -237700,6 +238086,8 @@ interface paths {
237700
238086
  * This car’s lead timeline
237701
238087
  * @description Every named lead that asked about this vehicle, merged with its anonymous Yapo phone-reveals, newest first. This is the car’s HISTORY, so unlike `/interest` a sold vehicle keeps its timeline.
237702
238088
  *
238089
+ * Each lead row carries `conversation_id`: the chat to open for that person (the lead's own conversation, else the contact's most recent one, e.g. the first-touch WhatsApp after a portal inquiry). Null when there is none.
238090
+ *
237703
238091
  * The Stock detail screen merges this with `/vehicles/{id}/history` (the change log) into one "Leads y cambios" feed — they are two endpoints because they are two different kinds of event. Automotive-vertical only: a workspace on another vertical gets 403 here however its scopes are set.
237704
238092
  */
237705
238093
  get: {
@@ -237728,6 +238116,7 @@ interface paths {
237728
238116
  * "kind": "lead",
237729
238117
  * "contact_id": "22222222-0000-4000-8000-000000000001",
237730
238118
  * "lead_id": "99999999-0000-4000-8000-000000000002",
238119
+ * "conversation_id": "99999999-0000-4000-8000-000000000003",
237731
238120
  * "portal": "website",
237732
238121
  * "at": "2026-09-19T15:30:00.000Z"
237733
238122
  * }
@@ -254428,7 +254817,7 @@ interface components {
254428
254817
  /** @enum {string} */
254429
254818
  kind: "page";
254430
254819
  /** @enum {string} */
254431
- page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254820
+ page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "finanzas.flujo_de_caja" | "finanzas.f29" | "finanzas.contraparte" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254432
254821
  params?: {
254433
254822
  [key: string]: string | number | boolean;
254434
254823
  };
@@ -254470,7 +254859,7 @@ interface components {
254470
254859
  /** @enum {string} */
254471
254860
  kind: "page";
254472
254861
  /** @enum {string} */
254473
- page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254862
+ page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "finanzas.flujo_de_caja" | "finanzas.f29" | "finanzas.contraparte" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254474
254863
  params?: {
254475
254864
  [key: string]: string | number | boolean;
254476
254865
  };
@@ -254497,7 +254886,7 @@ interface components {
254497
254886
  /** @enum {string} */
254498
254887
  kind: "page";
254499
254888
  /** @enum {string} */
254500
- page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254889
+ page: "settings.channels" | "settings.channel" | "settings.webhooks" | "finanzas.bancos" | "finanzas.flujo_de_caja" | "finanzas.f29" | "finanzas.contraparte" | "settings.api_keys" | "settings.billing" | "settings.seguimientos" | "settings.templates" | "settings.marketplaces" | "settings.notifications" | "ai_agents" | "ads" | "onboarding" | "vehicles.marketplaces" | "calendar";
254501
254890
  params?: {
254502
254891
  [key: string]: string | number | boolean;
254503
254892
  };
@@ -254511,11 +254900,11 @@ interface components {
254511
254900
  /** @enum {string} */
254512
254901
  preset: "important" | "all" | "custom";
254513
254902
  push_enabled: boolean;
254514
- categories: ("inbox" | "agenda" | "sales" | "followups" | "approvals" | "payments" | "agents" | "integrations" | "safety" | "account")[];
254903
+ categories: ("inbox" | "agenda" | "sales" | "followups" | "approvals" | "payments" | "agents" | "integrations" | "finanzas" | "safety" | "account")[];
254515
254904
  types: {
254516
254905
  key: string;
254517
254906
  /** @enum {string} */
254518
- category: "inbox" | "agenda" | "sales" | "followups" | "approvals" | "payments" | "agents" | "integrations" | "safety" | "account";
254907
+ category: "inbox" | "agenda" | "sales" | "followups" | "approvals" | "payments" | "agents" | "integrations" | "finanzas" | "safety" | "account";
254519
254908
  /** @description i18n slug: the UI renders `notif.<slug>.title` / `.when`. */
254520
254909
  slug: string;
254521
254910
  mandatory: boolean;
@@ -254595,7 +254984,7 @@ interface components {
254595
254984
  perfect_battery_pct?: number;
254596
254985
  currency?: string;
254597
254986
  };
254598
- /** @description Workspace notification rails. The staff WhatsApp rails (`staff_whatsapp`, `unanswered_supervisor_whatsapp`, `booking_whatsapp`) are opt-in: arming one (`enabled: true` with an `account_id`) submits its template to Meta on that number and wires it on approval. Each rail sent replaces that rail whole; rails not sent are kept. */
254987
+ /** @description Workspace notification rails. The staff WhatsApp rails (`staff_whatsapp`, `unanswered_supervisor_whatsapp`, `booking_whatsapp`, `reminder_whatsapp`, `finanzas_whatsapp`) are opt-in: arming one (`enabled: true` with an `account_id`) submits its template to Meta on that number and wires it on approval. Each rail sent replaces that rail whole; rails not sent are kept. */
254599
254988
  notifications?: {
254600
254989
  staff_whatsapp?: {
254601
254990
  enabled?: boolean;
@@ -254611,6 +255000,16 @@ interface components {
254611
255000
  template_name?: string;
254612
255001
  template_language?: string;
254613
255002
  user_ids?: string[];
255003
+ /** @description Minutes of open time a conversation waits on the team before the supervisors get the WhatsApp, once per episode. Unset = 60. */
255004
+ delay_minutes?: number;
255005
+ };
255006
+ /** @description Staff WhatsApp on every «sin respuesta» reminder, to the assignee (template aviso_sigue_esperando_v1). Opt-in: each send costs a WhatsApp conversation. */
255007
+ reminder_whatsapp?: {
255008
+ enabled?: boolean;
255009
+ /** Format: uuid */
255010
+ account_id?: string;
255011
+ template_name?: string;
255012
+ template_language?: string;
254614
255013
  };
254615
255014
  booking_whatsapp?: {
254616
255015
  enabled?: boolean;
@@ -254620,6 +255019,13 @@ interface components {
254620
255019
  template_language?: string;
254621
255020
  change_template_name?: string;
254622
255021
  };
255022
+ finanzas_whatsapp?: {
255023
+ enabled?: boolean;
255024
+ /** Format: uuid */
255025
+ account_id?: string;
255026
+ template_name?: string;
255027
+ template_language?: string;
255028
+ };
254623
255029
  stock_alert?: {
254624
255030
  /** @description Lead stages that trigger the «Stock faltante» check when a lead moves into them. Empty turns it off. */
254625
255031
  stage_ids: string[];
@@ -254687,6 +255093,46 @@ interface components {
254687
255093
  rejection_reason: string | null;
254688
255094
  }[];
254689
255095
  };
255096
+ finanzas_whatsapp: {
255097
+ /** @description The rail is switched on (`enabled: true`). */
255098
+ armed: boolean;
255099
+ /**
255100
+ * @description Worst state across the rail templates (blocked, rejected, missing, pending, approved); `off` when not armed or nothing to provision; `no_number` when armed without a sending number.
255101
+ * @enum {string}
255102
+ */
255103
+ template_state: "off" | "no_number" | "missing" | "pending" | "approved" | "rejected" | "blocked";
255104
+ reason: string | null;
255105
+ /** @description The rail has its template name set (by an admin or on approval). */
255106
+ wired: boolean;
255107
+ templates: {
255108
+ key: string;
255109
+ name: string;
255110
+ language: string;
255111
+ /** @enum {string} */
255112
+ state: "missing" | "pending" | "approved" | "rejected" | "blocked";
255113
+ rejection_reason: string | null;
255114
+ }[];
255115
+ };
255116
+ reminder_whatsapp: {
255117
+ /** @description The rail is switched on (`enabled: true`). */
255118
+ armed: boolean;
255119
+ /**
255120
+ * @description Worst state across the rail templates (blocked, rejected, missing, pending, approved); `off` when not armed or nothing to provision; `no_number` when armed without a sending number.
255121
+ * @enum {string}
255122
+ */
255123
+ template_state: "off" | "no_number" | "missing" | "pending" | "approved" | "rejected" | "blocked";
255124
+ reason: string | null;
255125
+ /** @description The rail has its template name set (by an admin or on approval). */
255126
+ wired: boolean;
255127
+ templates: {
255128
+ key: string;
255129
+ name: string;
255130
+ language: string;
255131
+ /** @enum {string} */
255132
+ state: "missing" | "pending" | "approved" | "rejected" | "blocked";
255133
+ rejection_reason: string | null;
255134
+ }[];
255135
+ };
254690
255136
  };
254691
255137
  /** @description Workspace display name. */
254692
255138
  name?: string;
@@ -254899,6 +255345,16 @@ interface components {
254899
255345
  template_name?: string;
254900
255346
  template_language?: string;
254901
255347
  user_ids?: string[];
255348
+ /** @description Minutes of open time a conversation waits on the team before the supervisors get the WhatsApp, once per episode. Unset = 60. */
255349
+ delay_minutes?: number;
255350
+ };
255351
+ /** @description Staff WhatsApp on every «sin respuesta» reminder, to the assignee (template aviso_sigue_esperando_v1). Opt-in: each send costs a WhatsApp conversation. */
255352
+ reminder_whatsapp?: {
255353
+ enabled?: boolean;
255354
+ /** Format: uuid */
255355
+ account_id?: string;
255356
+ template_name?: string;
255357
+ template_language?: string;
254902
255358
  };
254903
255359
  booking_whatsapp?: {
254904
255360
  enabled?: boolean;
@@ -254908,6 +255364,13 @@ interface components {
254908
255364
  template_language?: string;
254909
255365
  change_template_name?: string;
254910
255366
  };
255367
+ finanzas_whatsapp?: {
255368
+ enabled?: boolean;
255369
+ /** Format: uuid */
255370
+ account_id?: string;
255371
+ template_name?: string;
255372
+ template_language?: string;
255373
+ };
254911
255374
  stock_alert?: {
254912
255375
  /** @description Lead stages that trigger the «Stock faltante» check when a lead moves into them. Empty turns it off. */
254913
255376
  stage_ids: string[];
@@ -258823,6 +259286,33 @@ interface components {
258823
259286
  /** @description The last day an occurrence may fall on. Default: today (the day before it starts, if it has not started). */
258824
259287
  ends_on?: string | null;
258825
259288
  };
259289
+ FinanzasAlert: {
259290
+ /** Format: uuid */
259291
+ id: string;
259292
+ /**
259293
+ * @description `cash_negative`: the Flujo de caja projection drops below zero in the next 30 days. `f29_due`: an F29 with something to pay is due within 5 days and is unpaid. `supplier_invoice_missing`: a Contraparte that invoiced each of the last 3 months has no invoice this month, 3 days past its usual day.
259294
+ * @enum {string}
259295
+ */
259296
+ kind: "cash_negative" | "f29_due" | "supplier_invoice_missing";
259297
+ /** @description One line, Spanish. */
259298
+ title: string;
259299
+ /** @description What happened and what to do. */
259300
+ body: string;
259301
+ /** @description The button that fixes it. */
259302
+ cta_label: string;
259303
+ /** @description Workspace-relative screen that fixes it (`/finanzas/reportes/flujo-de-caja`, `/finanzas/documentos?vista=f29`, `/finanzas/contrapartes/<id>`). */
259304
+ path: string;
259305
+ /** @description Day first seen (YYYY-MM-DD, Santiago). */
259306
+ opened_on: string;
259307
+ /** @description When the members were told; null until then. */
259308
+ notified_at: string | null;
259309
+ updated_at: string;
259310
+ /** @description The facts, whole CLP. cash_negative: `lowest_date`, `lowest_balance_clp`, `today_balance_clp`, `cause_label`, `cause_amount_clp`, `horizon_days`. f29_due: `period`, `due_date`, `amount_clp`, `days_left`, `amount_is_final`, `document_id`. supplier_invoice_missing: `contraparte_id`, `contraparte_name`, `period`, `usual_day`, `typical_amount_clp`, `months_invoiced`. */
259311
+ data: {
259312
+ [key: string]: unknown;
259313
+ };
259314
+ };
259315
+ FinanzasAlertList: components["schemas"]["FinanzasAlert"][];
258826
259316
  FinanzasCostos: {
258827
259317
  from: string;
258828
259318
  to: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "15.17.0",
3
+ "version": "15.19.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",