@vitrina/api 11.30.0 → 11.31.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
@@ -39989,6 +39989,267 @@ interface paths {
39989
39989
  patch?: never;
39990
39990
  trace?: never;
39991
39991
  };
39992
+ "/clinic/diagnostico": {
39993
+ parameters: {
39994
+ query?: never;
39995
+ header?: never;
39996
+ path?: never;
39997
+ cookie?: never;
39998
+ };
39999
+ /**
40000
+ * The Diagnóstico: day N of 30, live numbers, plan band
40001
+ * @description The clinic's free Diagnóstico in one read. `status` is `not_started`, `active` or `closed`; `eligibility` says whether the owner can start one and, if not, why (`reason` + a printable `message`; `available_on` when this clinic's yearly Diagnóstico was already used). `window` is the open window (else the newest closed one) with `day` of `days_total`, `days_left`, and `closing.sentence` — what the last day does: a window that turned the revenue mirror on stops it and deletes the copied detail unless the clinic holds the plan; a window over a mirror that was already on never deletes. `report` is the aggregate reading (the 90 days ending today, from the same engine as `GET /clinic/insights/comercial`) — `live` while the window is open, `stored` once closed; it carries the day-one plan `band` with its price. `formula_status: propuesta` marks the formulas the mentors have not frozen yet. `history` lists past Diagnósticos. Requires `clinic_money:read` or `clinic_insights:read`. Aggregates only — counts, CLP, rates, months and professional names; never a patient, cita, presupuesto or payment. A caller WITHOUT `clinic_money:read` (a Consultor or an app on the insights scope) additionally gets every figure resting on fewer than 5 cases withheld as `null` (`suppression.min_count`) and no deletion-ledger detail.
40002
+ *
40003
+ * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
40004
+ */
40005
+ get: {
40006
+ parameters: {
40007
+ query?: never;
40008
+ header?: never;
40009
+ path?: never;
40010
+ cookie?: never;
40011
+ };
40012
+ requestBody?: never;
40013
+ responses: {
40014
+ /** @description The Diagnóstico */
40015
+ 200: {
40016
+ headers: {
40017
+ [name: string]: unknown;
40018
+ };
40019
+ content: {
40020
+ /**
40021
+ * @example {
40022
+ * "data": {
40023
+ * "status": "active",
40024
+ * "viewer": {
40025
+ * "may_start": true
40026
+ * },
40027
+ * "eligibility": {
40028
+ * "can_start": false,
40029
+ * "reason": "active",
40030
+ * "message": "Tu Diagnóstico está en curso.",
40031
+ * "available_on": null
40032
+ * },
40033
+ * "window": {
40034
+ * "id": "0192f1c4-7d3a-7b21-9c4e-3f5a6b7c8d9e",
40035
+ * "status": "active",
40036
+ * "phase": "running",
40037
+ * "closing_reason": null,
40038
+ * "held_until": null,
40039
+ * "started_at": "2026-10-05T13:00:00.000Z",
40040
+ * "ends_at": "2026-11-04T13:00:00.000Z",
40041
+ * "day": 12,
40042
+ * "days_total": 30,
40043
+ * "days_left": 19,
40044
+ * "warned_at": null,
40045
+ * "ended_early_at": null,
40046
+ * "closed_at": null,
40047
+ * "outcome": null,
40048
+ * "mirror_origin": "diagnostico",
40049
+ * "closing": {
40050
+ * "deletes_detail": true,
40051
+ * "sentence": "El 4 de noviembre dejamos de copiar datos y eliminamos el detalle copiado; conservamos solo el informe con tus totales. Con el plan, todo sigue al día."
40052
+ * },
40053
+ * "runs": []
40054
+ * },
40055
+ * "sync": {
40056
+ * "state": "up_to_date",
40057
+ * "synced_at": "2026-10-16T12:03:00.000Z",
40058
+ * "message": null
40059
+ * },
40060
+ * "report": {
40061
+ * "version": 1,
40062
+ * "computed_at": "2026-10-16T12:10:00.000Z",
40063
+ * "from": "2026-07-19",
40064
+ * "to": "2026-10-16",
40065
+ * "data_through": "2026-10-16T12:03:00.000Z",
40066
+ * "state": "ready",
40067
+ * "state_reason": null,
40068
+ * "collected": {
40069
+ * "clp": 48250000,
40070
+ * "previous_clp": 44100000,
40071
+ * "delta_pct": 9.4,
40072
+ * "rule": "Lo cobrado en el período: todos los pagos recibidos, sin los anulados."
40073
+ * },
40074
+ * "acceptance": {
40075
+ * "presented": 212,
40076
+ * "accepted": 97,
40077
+ * "rate": 45.8,
40078
+ * "presented_clp": 186400000,
40079
+ * "accepted_clp": 71900000,
40080
+ * "formula_status": "acordada",
40081
+ * "rule": "Presupuestos aceptados ÷ presupuestos presentados, cada presupuesto una vez."
40082
+ * },
40083
+ * "cierres": {
40084
+ * "count": 81,
40085
+ * "value_clp": 63300000,
40086
+ * "formula_status": "acordada",
40087
+ * "rule": "Un cierre es el primer pago de un presupuesto aceptado."
40088
+ * },
40089
+ * "by_professional": [
40090
+ * {
40091
+ * "professional_id": "0192f1c4-0000-7000-8000-000000000001",
40092
+ * "professional_name": "Dra. Ejemplo",
40093
+ * "presented": 64,
40094
+ * "accepted": 35,
40095
+ * "rate": 54.7,
40096
+ * "accepted_clp": 28100000,
40097
+ * "cierres": 30,
40098
+ * "cierres_clp": 24900000,
40099
+ * "suppressed": false
40100
+ * }
40101
+ * ],
40102
+ * "months": [
40103
+ * {
40104
+ * "month": "2026-09",
40105
+ * "accepted_clp": 24300000,
40106
+ * "produced_clp": 19800000,
40107
+ * "collected_clp": 16900000,
40108
+ * "cierres": 27
40109
+ * }
40110
+ * ],
40111
+ * "first_visit": {
40112
+ * "patients": 140,
40113
+ * "paid": 61,
40114
+ * "rate": 43.6,
40115
+ * "formula_status": "propuesta",
40116
+ * "rule": "Fórmula propuesta, a la espera de los mentores."
40117
+ * },
40118
+ * "second_visit": {
40119
+ * "eligible": 79,
40120
+ * "converted": 22,
40121
+ * "rate": 27.8,
40122
+ * "formula_status": "propuesta",
40123
+ * "rule": "Fórmula propuesta, a la espera de los mentores."
40124
+ * },
40125
+ * "botados": {
40126
+ * "unaccepted": {
40127
+ * "count": 88,
40128
+ * "clp": 74200000,
40129
+ * "suppressed": false
40130
+ * },
40131
+ * "accepted_unscheduled": {
40132
+ * "count": 14,
40133
+ * "clp": 9600000,
40134
+ * "suppressed": false
40135
+ * },
40136
+ * "mid_treatment_no_future_cita": {
40137
+ * "count": 23,
40138
+ * "clp": 12100000,
40139
+ * "suppressed": false
40140
+ * },
40141
+ * "total": {
40142
+ * "count": 125,
40143
+ * "clp": 95900000,
40144
+ * "suppressed": false
40145
+ * },
40146
+ * "focus": "unaccepted",
40147
+ * "formula_status": "propuesta",
40148
+ * "rule": "Fórmula propuesta, a la espera de los mentores."
40149
+ * },
40150
+ * "band": {
40151
+ * "band": "M",
40152
+ * "count": 7.3,
40153
+ * "has_history": true,
40154
+ * "months": [
40155
+ * {
40156
+ * "month": "2026-07",
40157
+ * "count": 7
40158
+ * },
40159
+ * {
40160
+ * "month": "2026-08",
40161
+ * "count": 8
40162
+ * },
40163
+ * {
40164
+ * "month": "2026-09",
40165
+ * "count": 7
40166
+ * }
40167
+ * ],
40168
+ * "uf_month": 3,
40169
+ * "estimated_clp_month": 119000,
40170
+ * "price_label": "UF 3 al mes",
40171
+ * "rule": "Tu tramo se revisa cada mes con el promedio de tus últimos 3 meses; si sube, te avisamos con un mes de anticipación."
40172
+ * }
40173
+ * },
40174
+ * "report_source": "live",
40175
+ * "plan": {
40176
+ * "holds_plan": false,
40177
+ * "status": "none"
40178
+ * },
40179
+ * "history": [],
40180
+ * "suppression": null
40181
+ * }
40182
+ * }
40183
+ */
40184
+ "application/json": {
40185
+ data: components["schemas"]["ClinicDiagnostico"];
40186
+ };
40187
+ };
40188
+ };
40189
+ /** @description Validation error */
40190
+ 400: {
40191
+ headers: {
40192
+ [name: string]: unknown;
40193
+ };
40194
+ content: {
40195
+ "application/json": components["schemas"]["Error"];
40196
+ };
40197
+ };
40198
+ /** @description Unauthorized */
40199
+ 401: {
40200
+ headers: {
40201
+ [name: string]: unknown;
40202
+ };
40203
+ content: {
40204
+ "application/json": components["schemas"]["Error"];
40205
+ };
40206
+ };
40207
+ /** @description Forbidden */
40208
+ 403: {
40209
+ headers: {
40210
+ [name: string]: unknown;
40211
+ };
40212
+ content: {
40213
+ "application/json": components["schemas"]["Error"];
40214
+ };
40215
+ };
40216
+ /** @description Not found */
40217
+ 404: {
40218
+ headers: {
40219
+ [name: string]: unknown;
40220
+ };
40221
+ content: {
40222
+ "application/json": components["schemas"]["Error"];
40223
+ };
40224
+ };
40225
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
40226
+ 409: {
40227
+ headers: {
40228
+ [name: string]: unknown;
40229
+ };
40230
+ content: {
40231
+ "application/json": components["schemas"]["Error"];
40232
+ };
40233
+ };
40234
+ /** @description Rate limited */
40235
+ 429: {
40236
+ headers: {
40237
+ [name: string]: unknown;
40238
+ };
40239
+ content: {
40240
+ "application/json": components["schemas"]["Error"];
40241
+ };
40242
+ };
40243
+ };
40244
+ };
40245
+ put?: never;
40246
+ post?: never;
40247
+ delete?: never;
40248
+ options?: never;
40249
+ head?: never;
40250
+ patch?: never;
40251
+ trace?: never;
40252
+ };
39992
40253
  "/clinic/cash-sessions/current": {
39993
40254
  parameters: {
39994
40255
  query?: never;
@@ -66863,7 +67124,7 @@ interface paths {
66863
67124
  };
66864
67125
  /**
66865
67126
  * Commercial numbers: presupuesto acceptance, cierres, cash, botados
66866
- * @description The clinic's commercial numbers, aggregates only (counts, CLP, percentages, months and professional names; never a patient). `regime` says how acceptance is read: `evidencia` when the revenue mirror is on (a non-entry line performed, or a cita booked after the presupuesto, inside its window), `explicita` otherwise (the acceptance the clinic recorded). Acceptance is by COUNT of presupuestos, one per lineage; $0 and entry-only presupuestos are out of both sides; the window is 60 days (90 for ortodoncia and implantología); the rate goes to the professional who issued the presupuesto. Presupuestos ISSUED in the window form the acceptance cohort (`cohorts` by issue month with 30- and 60-day reads). A cierre is the first payment on an accepted presupuesto: once per presupuesto, dated on that payment, valued at the full accepted value. `headline` is the cash collected in the window against the previous window of the same length. `first_visit`, `second_visit` and `botados` carry `formula: propuesta`; `botados` is a live worklist over the last six months. Every KPI carries its `formula` and a printable `rule`; a rate with no denominator is `null`, never 0. `state` is `empty`, `settling` (presupuesto lines still being read; `state_reason` says so) or `ready`. Requires `clinic_money:read` (or `clinic_insights:read`, which reads the same aggregates). Accepts `from` / `to` (bare `YYYY-MM-DD`, `to` INCLUSIVE; default the 90 days ending today in the clinic's zone), `location_id` and `professional_id`. With `professional_id`, cash (`headline`, `months[].collected_clp`) is `null`: a payment belongs to the patient, not to a professional.
67127
+ * @description The clinic's commercial numbers, aggregates only (counts, CLP, percentages, months and professional names; never a patient). `regime` says how acceptance is read: `evidencia` when the revenue mirror is on (a non-entry line performed, or a cita booked after the presupuesto, inside its window), `explicita` otherwise (the acceptance the clinic recorded). Acceptance is by COUNT of presupuestos, one per lineage; $0 and entry-only presupuestos are out of both sides; the window is 60 days (90 for ortodoncia and implantología); the rate goes to the professional who issued the presupuesto. Presupuestos ISSUED in the window form the acceptance cohort (`cohorts` by issue month with 30- and 60-day reads). A cierre is the first payment on an accepted presupuesto: once per presupuesto, dated on that payment, valued at the full accepted value. `headline` is the cash collected in the window against the previous window of the same length. `first_visit`, `second_visit` and `botados` carry `formula: propuesta`; `botados` is a live worklist over the last six months. Every KPI carries its `formula` and a printable `rule`; a rate with no denominator is `null`, never 0. `state` is `empty`, `settling` (presupuesto lines still being read; `state_reason` says so) or `ready`. Requires `clinic_money:read` (or `clinic_insights:read`, which reads the same aggregates). Accepts `from` / `to` (bare `YYYY-MM-DD`, `to` INCLUSIVE; default the 90 days ending today in the clinic's zone), `location_id` and `professional_id`. With `professional_id`, cash (`headline`, `months[].collected_clp`) is `null`: a payment belongs to the patient, not to a professional. A caller WITHOUT `clinic_money:read` always reads one fixed window — the last 3 closed calendar months — whatever range or filter it asks (`suppression.filters_ignored`), with every count or CLP resting on 1–4 cases `null`, rates over fewer than 5 cases `null`, complementary suppression over professionals, cohorts and botados lists, and month rows carrying only cash.
66867
67128
  *
66868
67129
  * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
66869
67130
  */
@@ -115184,6 +115445,190 @@ interface components {
115184
115445
  author: components["schemas"]["Author"];
115185
115446
  created_at: string;
115186
115447
  };
115448
+ ClinicDiagnostico: {
115449
+ /** @enum {string} */
115450
+ status: "not_started" | "active" | "closed";
115451
+ viewer: {
115452
+ may_start: boolean;
115453
+ };
115454
+ eligibility: {
115455
+ can_start: boolean;
115456
+ /** @enum {string|null} */
115457
+ reason: "no_account" | "not_dentalink" | "money_adopted" | "dpa_required" | "plan_active" | "already_used" | "active" | null;
115458
+ message: string | null;
115459
+ available_on: string | null;
115460
+ };
115461
+ window: {
115462
+ /** Format: uuid */
115463
+ id: string;
115464
+ /** @enum {string} */
115465
+ status: "active" | "closed";
115466
+ /** @enum {string} */
115467
+ phase: "running" | "closing" | "closed";
115468
+ /** @enum {string|null} */
115469
+ closing_reason: "plan_pending" | "finishing" | null;
115470
+ held_until: string | null;
115471
+ started_at: string;
115472
+ ends_at: string;
115473
+ day: number;
115474
+ days_total: number;
115475
+ days_left: number;
115476
+ warned_at: string | null;
115477
+ ended_early_at: string | null;
115478
+ closed_at: string | null;
115479
+ /** @enum {string|null} */
115480
+ outcome: "purged" | "kept_plan" | "kept_preexisting" | null;
115481
+ /** @enum {string} */
115482
+ mirror_origin: "diagnostico" | "preexisting";
115483
+ closing: {
115484
+ deletes_detail: boolean;
115485
+ sentence: string;
115486
+ };
115487
+ runs: {
115488
+ /** @enum {string} */
115489
+ outcome: "purged" | "residual_purged" | "kept_plan" | "kept_preexisting" | "deferred_plan_pending" | "failed";
115490
+ finished_at: string;
115491
+ deleted: {
115492
+ plans: number;
115493
+ plan_lines: number;
115494
+ payments: number;
115495
+ tax_documents: number;
115496
+ };
115497
+ }[];
115498
+ } | null;
115499
+ sync: {
115500
+ /** @enum {string} */
115501
+ state: "copying" | "up_to_date" | "error" | "off";
115502
+ synced_at: string | null;
115503
+ message: string | null;
115504
+ } | null;
115505
+ report: {
115506
+ /** @enum {number} */
115507
+ version: 1;
115508
+ computed_at: string;
115509
+ from: string;
115510
+ to: string;
115511
+ data_through: string | null;
115512
+ /** @enum {string} */
115513
+ state: "ready" | "settling" | "empty";
115514
+ state_reason: string | null;
115515
+ collected: {
115516
+ clp: number | null;
115517
+ previous_clp: number | null;
115518
+ delta_pct: number | null;
115519
+ rule: string;
115520
+ };
115521
+ acceptance: {
115522
+ presented: number | null;
115523
+ accepted: number | null;
115524
+ rate: number | null;
115525
+ presented_clp: number | null;
115526
+ accepted_clp: number | null;
115527
+ /** @enum {string} */
115528
+ formula_status: "acordada" | "propuesta";
115529
+ rule: string;
115530
+ };
115531
+ cierres: {
115532
+ count: number | null;
115533
+ value_clp: number | null;
115534
+ /** @enum {string} */
115535
+ formula_status: "acordada" | "propuesta";
115536
+ rule: string;
115537
+ };
115538
+ by_professional: {
115539
+ professional_id: string;
115540
+ professional_name: string;
115541
+ presented: number | null;
115542
+ accepted: number | null;
115543
+ rate: number | null;
115544
+ accepted_clp: number | null;
115545
+ cierres: number | null;
115546
+ cierres_clp: number | null;
115547
+ suppressed: boolean;
115548
+ }[];
115549
+ months: {
115550
+ month: string;
115551
+ accepted_clp: number | null;
115552
+ produced_clp: number | null;
115553
+ collected_clp: number | null;
115554
+ cierres: number | null;
115555
+ }[];
115556
+ first_visit: {
115557
+ patients: number | null;
115558
+ paid: number | null;
115559
+ rate: number | null;
115560
+ /** @enum {string} */
115561
+ formula_status: "acordada" | "propuesta";
115562
+ rule: string;
115563
+ };
115564
+ second_visit: {
115565
+ eligible: number | null;
115566
+ converted: number | null;
115567
+ rate: number | null;
115568
+ /** @enum {string} */
115569
+ formula_status: "acordada" | "propuesta";
115570
+ rule: string;
115571
+ };
115572
+ botados: {
115573
+ unaccepted: {
115574
+ count: number | null;
115575
+ clp: number | null;
115576
+ suppressed: boolean;
115577
+ };
115578
+ accepted_unscheduled: {
115579
+ count: number | null;
115580
+ clp: number | null;
115581
+ suppressed: boolean;
115582
+ };
115583
+ mid_treatment_no_future_cita: {
115584
+ count: number | null;
115585
+ clp: number | null;
115586
+ suppressed: boolean;
115587
+ };
115588
+ total: {
115589
+ count: number | null;
115590
+ clp: number | null;
115591
+ suppressed: boolean;
115592
+ };
115593
+ focus: string | null;
115594
+ /** @enum {string} */
115595
+ formula_status: "acordada" | "propuesta";
115596
+ rule: string;
115597
+ };
115598
+ band: {
115599
+ band: string;
115600
+ count: number;
115601
+ has_history: boolean;
115602
+ months: {
115603
+ month: string;
115604
+ count: number;
115605
+ }[];
115606
+ uf_month: number | null;
115607
+ estimated_clp_month: number | null;
115608
+ price_label: string | null;
115609
+ rule: string;
115610
+ } | null;
115611
+ } | null;
115612
+ /** @enum {string|null} */
115613
+ report_source: "live" | "stored" | null;
115614
+ plan: {
115615
+ holds_plan: boolean;
115616
+ /** @enum {string} */
115617
+ status: "none" | "awaiting_payment" | "active" | "past_due";
115618
+ };
115619
+ history: {
115620
+ /** Format: uuid */
115621
+ id: string;
115622
+ started_at: string;
115623
+ closed_at: string | null;
115624
+ /** @enum {string|null} */
115625
+ outcome: "purged" | "kept_plan" | "kept_preexisting" | null;
115626
+ label: string;
115627
+ }[];
115628
+ suppression: {
115629
+ min_count: number;
115630
+ } | null;
115631
+ };
115187
115632
  BankFeedSources: {
115188
115633
  email: {
115189
115634
  /** @enum {boolean} */
@@ -115280,24 +115725,27 @@ interface components {
115280
115725
  rule: string;
115281
115726
  };
115282
115727
  acceptance: {
115283
- /** @description Presupuestos presented (issued), one per lineage. */
115284
- presented: number;
115285
- accepted: number;
115286
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115728
+ /** @description Presupuestos presented (issued), one per lineage. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115729
+ presented: number | null;
115730
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115731
+ accepted: number | null;
115732
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115287
115733
  rate: number | null;
115288
- /** @description Accepted the day they were issued. */
115289
- same_day: number;
115290
- later: number;
115291
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115292
- cita_only: number;
115293
- /** @description Not accepted yet, window still open. */
115294
- pending: number;
115295
- /** @description CLP presented, entry lines excluded. */
115296
- presented_clp: number;
115297
- accepted_clp: number;
115298
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115734
+ /** @description Accepted the day they were issued. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115735
+ same_day: number | null;
115736
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115737
+ later: number | null;
115738
+ /** @description Accepted only through a cita still ahead — may drop if it is cancelled. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115739
+ cita_only: number | null;
115740
+ /** @description Not accepted yet, window still open. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115741
+ pending: number | null;
115742
+ /** @description CLP presented, entry lines excluded. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115743
+ presented_clp: number | null;
115744
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115745
+ accepted_clp: number | null;
115746
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115299
115747
  rate_30d: number | null;
115300
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115748
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115301
115749
  rate_60d: number | null;
115302
115750
  /** @enum {string} */
115303
115751
  formula: "mentores_2026_09_25";
@@ -115306,10 +115754,12 @@ interface components {
115306
115754
  rule: string;
115307
115755
  };
115308
115756
  cierres: {
115309
- count: number;
115310
- /** @description The accepted value of the presupuestos that closed — never the payments. */
115311
- value_clp: number;
115312
- accepted_without_payment: number;
115757
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115758
+ count: number | null;
115759
+ /** @description The accepted value of the presupuestos that closed — never the payments. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115760
+ value_clp: number | null;
115761
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115762
+ accepted_without_payment: number | null;
115313
115763
  /** @enum {string} */
115314
115764
  formula: "cierre_2026_09_25";
115315
115765
  rule: string;
@@ -115317,24 +115767,27 @@ interface components {
115317
115767
  cohorts: {
115318
115768
  /** @description Issue month, `YYYY-MM`. */
115319
115769
  month: string;
115320
- /** @description Presupuestos presented (issued), one per lineage. */
115321
- presented: number;
115322
- accepted: number;
115323
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115770
+ /** @description Presupuestos presented (issued), one per lineage. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115771
+ presented: number | null;
115772
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115773
+ accepted: number | null;
115774
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115324
115775
  rate: number | null;
115325
- /** @description Accepted the day they were issued. */
115326
- same_day: number;
115327
- later: number;
115328
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115329
- cita_only: number;
115330
- /** @description Not accepted yet, window still open. */
115331
- pending: number;
115332
- /** @description CLP presented, entry lines excluded. */
115333
- presented_clp: number;
115334
- accepted_clp: number;
115335
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115776
+ /** @description Accepted the day they were issued. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115777
+ same_day: number | null;
115778
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115779
+ later: number | null;
115780
+ /** @description Accepted only through a cita still ahead — may drop if it is cancelled. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115781
+ cita_only: number | null;
115782
+ /** @description Not accepted yet, window still open. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115783
+ pending: number | null;
115784
+ /** @description CLP presented, entry lines excluded. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115785
+ presented_clp: number | null;
115786
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115787
+ accepted_clp: number | null;
115788
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115336
115789
  rate_30d: number | null;
115337
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115790
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115338
115791
  rate_60d: number | null;
115339
115792
  /** @description Every presupuesto of the month is past its window. */
115340
115793
  mature: boolean;
@@ -115343,81 +115796,113 @@ interface components {
115343
115796
  /** Format: uuid */
115344
115797
  professional_id: string;
115345
115798
  professional_name: string;
115346
- /** @description Presupuestos presented (issued), one per lineage. */
115347
- presented: number;
115348
- accepted: number;
115349
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115799
+ /** @description Presupuestos presented (issued), one per lineage. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115800
+ presented: number | null;
115801
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115802
+ accepted: number | null;
115803
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115350
115804
  rate: number | null;
115351
- /** @description Accepted the day they were issued. */
115352
- same_day: number;
115353
- later: number;
115354
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115355
- cita_only: number;
115356
- /** @description Not accepted yet, window still open. */
115357
- pending: number;
115358
- /** @description CLP presented, entry lines excluded. */
115359
- presented_clp: number;
115360
- accepted_clp: number;
115361
- cierres: number;
115362
- cierres_clp: number;
115805
+ /** @description Accepted the day they were issued. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115806
+ same_day: number | null;
115807
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115808
+ later: number | null;
115809
+ /** @description Accepted only through a cita still ahead — may drop if it is cancelled. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115810
+ cita_only: number | null;
115811
+ /** @description Not accepted yet, window still open. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115812
+ pending: number | null;
115813
+ /** @description CLP presented, entry lines excluded. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115814
+ presented_clp: number | null;
115815
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115816
+ accepted_clp: number | null;
115817
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115818
+ cierres: number | null;
115819
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115820
+ cierres_clp: number | null;
115363
115821
  }[];
115364
- unassigned_presented: number;
115365
- unassigned_cierres: number;
115822
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115823
+ unassigned_presented: number | null;
115824
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115825
+ unassigned_cierres: number | null;
115366
115826
  months: {
115367
115827
  month: string;
115368
- accepted_clp: number;
115369
- produced_clp: number;
115828
+ /** @description `null` for a caller without `clinic_money:read`: month rows then carry only the cash. */
115829
+ accepted_clp: number | null;
115830
+ /** @description `null` for a caller without `clinic_money:read`: month rows then carry only the cash. */
115831
+ produced_clp: number | null;
115370
115832
  collected_clp: number | null;
115371
- cierres: number;
115372
- cierres_clp: number;
115833
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115834
+ cierres: number | null;
115835
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115836
+ cierres_clp: number | null;
115373
115837
  }[];
115374
115838
  first_visit: {
115375
115839
  /** @enum {string} */
115376
115840
  formula: "propuesta";
115377
- patients: number;
115378
- paid: number;
115379
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115841
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115842
+ patients: number | null;
115843
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115844
+ paid: number | null;
115845
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115380
115846
  rate: number | null;
115381
115847
  rule: string;
115382
115848
  };
115383
115849
  second_visit: {
115384
115850
  /** @enum {string} */
115385
115851
  formula: "propuesta";
115386
- eligible: number;
115387
- converted: number;
115388
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
115852
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115853
+ eligible: number | null;
115854
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115855
+ converted: number | null;
115856
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115389
115857
  rate: number | null;
115390
115858
  rule: string;
115391
115859
  };
115392
115860
  botados: {
115393
115861
  unaccepted: {
115394
- count: number;
115395
- clp: number;
115862
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115863
+ count: number | null;
115864
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115865
+ clp: number | null;
115396
115866
  };
115397
115867
  accepted_unscheduled: {
115398
- count: number;
115399
- clp: number;
115868
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115869
+ count: number | null;
115870
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115871
+ clp: number | null;
115400
115872
  };
115401
115873
  mid_treatment_no_future_cita: {
115402
- count: number;
115403
- clp: number;
115874
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115875
+ count: number | null;
115876
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115877
+ clp: number | null;
115404
115878
  };
115405
115879
  /** @enum {string} */
115406
115880
  formula: "propuesta";
115407
115881
  /** @enum {string} */
115408
115882
  basis: "live_last_6_months";
115409
115883
  total: {
115410
- count: number;
115411
- clp: number;
115884
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115885
+ count: number | null;
115886
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115887
+ clp: number | null;
115412
115888
  };
115413
115889
  /** @enum {string|null} */
115414
115890
  focus: "unaccepted" | "accepted_unscheduled" | "mid_treatment_no_future_cita" | null;
115415
115891
  rule: string;
115416
115892
  };
115417
115893
  coverage: {
115418
- plans_without_lines: number;
115419
- excluded_zero: number;
115420
- excluded_entry_only: number;
115894
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115895
+ plans_without_lines: number | null;
115896
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115897
+ excluded_zero: number | null;
115898
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
115899
+ excluded_entry_only: number | null;
115900
+ };
115901
+ suppression?: {
115902
+ min_count: number;
115903
+ professionals_withheld: number;
115904
+ /** @description The Consultor view always reads the last 3 closed calendar months (the report's `from`/`to`) and ignores the requested range and professional / sucursal filters. */
115905
+ filters_ignored?: boolean;
115421
115906
  };
115422
115907
  };
115423
115908
  AdsState: {