@vitrina/api 11.29.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
@@ -13399,7 +13399,7 @@ interface paths {
13399
13399
  };
13400
13400
  /**
13401
13401
  * Read the channel AI availability policy and current status
13402
- * @description Returns the per-channel coverage clock and its current evaluation. Schedule availability does not override agent assignment, channel kill switches, or a human takeover. An account without a saved policy reports `configured: false` and preserves the legacy always-eligible schedule. `policy.timezone` and `status.effective_timezone` report the server-resolved clock inherited from General settings or selected business hours. `policy.human_silence_resume` and `policy.handoff_renotify` are always present in the response with defaults applied (enabled, 30 minutes).
13402
+ * @description Returns the per-channel coverage clock and its current evaluation. Schedule availability does not override agent assignment, channel kill switches, or a human takeover. An account without a saved policy reports `configured: false` and preserves the legacy always-eligible schedule. `policy.timezone` and `status.effective_timezone` report the server-resolved clock inherited from General settings or selected business hours. `policy.human_silence_resume` and `policy.handoff_renotify` are always present in the response with defaults applied (resume: enabled, 30 minutes; re-notify: disabled, 30 minutes once enabled).
13403
13403
  */
13404
13404
  get: {
13405
13405
  parameters: {
@@ -13432,7 +13432,7 @@ interface paths {
13432
13432
  * "minutes": 30
13433
13433
  * },
13434
13434
  * "handoff_renotify": {
13435
- * "enabled": true,
13435
+ * "enabled": false,
13436
13436
  * "minutes": 30
13437
13437
  * },
13438
13438
  * "timezone": "America/Santiago"
@@ -13546,7 +13546,7 @@ interface paths {
13546
13546
  * "minutes": 30
13547
13547
  * },
13548
13548
  * "handoff_renotify": {
13549
- * "enabled": true,
13549
+ * "enabled": false,
13550
13550
  * "minutes": 30
13551
13551
  * }
13552
13552
  * }
@@ -13573,7 +13573,7 @@ interface paths {
13573
13573
  enabled: boolean;
13574
13574
  minutes: number;
13575
13575
  };
13576
- /** @description The AI handed the conversation off explicitly, so it stays out. While the customer's message stays unanswered, notify the assignee (or, when nobody is assigned, the channel roster) every `minutes`, with owners and admins copied. Checked on a 10-minute tick; stops 24 hours after the customer's message. Absent = enabled, 30 minutes. */
13576
+ /** @description The AI handed the conversation off explicitly, so it stays out. While the customer's message stays unanswered, notify the assignee (or, when nobody is assigned, the channel roster) every `minutes`, with owners and admins copied. Checked on a 10-minute tick; stops 24 hours after the customer's message. Absent = DISABLED (opt-in per channel); once enabled, the default cadence is 30 minutes. */
13577
13577
  handoff_renotify?: {
13578
13578
  enabled: boolean;
13579
13579
  minutes: number;
@@ -13602,7 +13602,7 @@ interface paths {
13602
13602
  * "minutes": 30
13603
13603
  * },
13604
13604
  * "handoff_renotify": {
13605
- * "enabled": true,
13605
+ * "enabled": false,
13606
13606
  * "minutes": 30
13607
13607
  * },
13608
13608
  * "timezone": "America/Santiago"
@@ -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
  */
@@ -68683,6 +68944,10 @@ interface paths {
68683
68944
  * "lock": null,
68684
68945
  * "awaiting_switch": false,
68685
68946
  * "source": "available",
68947
+ * "ready": true,
68948
+ * "ready_reason": null,
68949
+ * "count_28d": 212,
68950
+ * "weekly_28d": 53,
68686
68951
  * "verdict": "below_threshold",
68687
68952
  * "active_ad_sets": 0,
68688
68953
  * "last_sent_at": "2026-09-25T12:40:00.000Z",
@@ -68737,6 +69002,10 @@ interface paths {
68737
69002
  * "lock": null,
68738
69003
  * "awaiting_switch": false,
68739
69004
  * "source": "available",
69005
+ * "ready": true,
69006
+ * "ready_reason": null,
69007
+ * "count_28d": 96,
69008
+ * "weekly_28d": 24,
68740
69009
  * "verdict": "not_checked",
68741
69010
  * "active_ad_sets": 0,
68742
69011
  * "last_sent_at": "2026-09-25T11:40:00.000Z",
@@ -68791,6 +69060,10 @@ interface paths {
68791
69060
  * "lock": null,
68792
69061
  * "awaiting_switch": false,
68793
69062
  * "source": "available",
69063
+ * "ready": false,
69064
+ * "ready_reason": "off",
69065
+ * "count_28d": 71,
69066
+ * "weekly_28d": 17.8,
68794
69067
  * "verdict": "not_checked",
68795
69068
  * "active_ad_sets": 0,
68796
69069
  * "last_sent_at": "2026-09-25T10:40:00.000Z",
@@ -68845,6 +69118,10 @@ interface paths {
68845
69118
  * "lock": null,
68846
69119
  * "awaiting_switch": false,
68847
69120
  * "source": "available",
69121
+ * "ready": true,
69122
+ * "ready_reason": null,
69123
+ * "count_28d": 40,
69124
+ * "weekly_28d": 10,
68848
69125
  * "verdict": "not_checked",
68849
69126
  * "active_ad_sets": 0,
68850
69127
  * "last_sent_at": "2026-09-25T09:40:00.000Z",
@@ -68899,6 +69176,10 @@ interface paths {
68899
69176
  * "lock": null,
68900
69177
  * "awaiting_switch": false,
68901
69178
  * "source": "available",
69179
+ * "ready": true,
69180
+ * "ready_reason": null,
69181
+ * "count_28d": 22,
69182
+ * "weekly_28d": 5.5,
68902
69183
  * "verdict": "wired",
68903
69184
  * "active_ad_sets": 2,
68904
69185
  * "last_sent_at": "2026-09-25T08:40:00.000Z",
@@ -68953,6 +69234,10 @@ interface paths {
68953
69234
  * "lock": null,
68954
69235
  * "awaiting_switch": false,
68955
69236
  * "source": "definition_missing",
69237
+ * "ready": false,
69238
+ * "ready_reason": "definition_missing",
69239
+ * "count_28d": 64,
69240
+ * "weekly_28d": 16,
68956
69241
  * "verdict": "not_checked",
68957
69242
  * "active_ad_sets": 0,
68958
69243
  * "last_sent_at": null,
@@ -69007,6 +69292,10 @@ interface paths {
69007
69292
  * "lock": "installments",
69008
69293
  * "awaiting_switch": false,
69009
69294
  * "source": "available",
69295
+ * "ready": false,
69296
+ * "ready_reason": "installments",
69297
+ * "count_28d": 58,
69298
+ * "weekly_28d": 14.5,
69010
69299
  * "verdict": "not_checked",
69011
69300
  * "active_ad_sets": 0,
69012
69301
  * "last_sent_at": "2026-09-25T07:40:00.000Z",
@@ -69052,7 +69341,14 @@ interface paths {
69052
69341
  * }
69053
69342
  * ],
69054
69343
  * "enabled_count": 4,
69344
+ * "waiting_count": 0,
69055
69345
  * "stage_count": 6,
69346
+ * "first_payment_candidates": {
69347
+ * "count_28d": 64,
69348
+ * "weekly_28d": 16,
69349
+ * "mirror_count_28d": null,
69350
+ * "mirror_weekly_28d": null
69351
+ * },
69056
69352
  * "restriction": {
69057
69353
  * "kind": "unknown",
69058
69354
  * "since": null
@@ -69060,8 +69356,8 @@ interface paths {
69060
69356
  * "protected_dataset": null,
69061
69357
  * "recommended_optimization_stage": {
69062
69358
  * "stage": "appointment_attended",
69063
- * "reason": "default",
69064
- * "rate": null
69359
+ * "reason": "rate_band",
69360
+ * "rate": 0.33490566037735847
69065
69361
  * },
69066
69362
  * "purchase_stage": "first_payment",
69067
69363
  * "purchase_switch_available": false,
@@ -69224,16 +69520,19 @@ interface paths {
69224
69520
  /**
69225
69521
  * @example {
69226
69522
  * "data": {
69227
- * "stage": "closed_won",
69523
+ * "stage": "first_payment",
69228
69524
  * "source": "own",
69229
69525
  * "vitrina": {
69230
- * "stage_label": "Presupuesto aceptado",
69526
+ * "stage_label": "Primer pago",
69231
69527
  * "occurred_at": "2026-09-25T08:40:00.000Z",
69232
69528
  * "value_clp": 1200000,
69233
69529
  * "contact_tail": "a3f2"
69234
69530
  * },
69235
69531
  * "meta": {
69236
- * "event": "closed_won",
69532
+ * "event": "Purchase",
69533
+ * "value_clp": 1038075,
69534
+ * "capped": true,
69535
+ * "value_cap_clp": 1038075,
69237
69536
  * "reaches_meta": true,
69238
69537
  * "not_sent_reason": null,
69239
69538
  * "fields": [
@@ -69241,7 +69540,7 @@ interface paths {
69241
69540
  * "key": "event",
69242
69541
  * "label": "Evento",
69243
69542
  * "state": "sent",
69244
- * "display": "closed_won"
69543
+ * "display": "Purchase"
69245
69544
  * },
69246
69545
  * {
69247
69546
  * "key": "time",
@@ -69252,13 +69551,15 @@ interface paths {
69252
69551
  * {
69253
69552
  * "key": "value",
69254
69553
  * "label": "Valor",
69255
- * "state": "withheld"
69554
+ * "state": "sent",
69555
+ * "display": "1.038.075 CLP"
69256
69556
  * },
69257
69557
  * {
69258
69558
  * "key": "action_source",
69259
69559
  * "label": "Dónde pasó",
69260
69560
  * "state": "sent",
69261
- * "display": "business_messaging"
69561
+ * "display": "business_messaging",
69562
+ * "display_channel": "whatsapp"
69262
69563
  * },
69263
69564
  * {
69264
69565
  * "key": "email",
@@ -94004,6 +94305,8 @@ interface paths {
94004
94305
  before?: string;
94005
94306
  /** @description Rows per page (default 20, max 50). */
94006
94307
  limit?: number;
94308
+ /** @description Only one screen’s executions. `envio` = «Enviar a Meta»: `send_setup`, `send_stage`, `send_dataset`, `send_stop`, `send_protected_move` and their rollbacks. Omitted = every execution. */
94309
+ screen?: "envio";
94007
94310
  /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
94008
94311
  sample?: "1" | "true";
94009
94312
  };
@@ -115142,6 +115445,190 @@ interface components {
115142
115445
  author: components["schemas"]["Author"];
115143
115446
  created_at: string;
115144
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
+ };
115145
115632
  BankFeedSources: {
115146
115633
  email: {
115147
115634
  /** @enum {boolean} */
@@ -115238,24 +115725,27 @@ interface components {
115238
115725
  rule: string;
115239
115726
  };
115240
115727
  acceptance: {
115241
- /** @description Presupuestos presented (issued), one per lineage. */
115242
- presented: number;
115243
- accepted: number;
115244
- /** @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. */
115245
115733
  rate: number | null;
115246
- /** @description Accepted the day they were issued. */
115247
- same_day: number;
115248
- later: number;
115249
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115250
- cita_only: number;
115251
- /** @description Not accepted yet, window still open. */
115252
- pending: number;
115253
- /** @description CLP presented, entry lines excluded. */
115254
- presented_clp: number;
115255
- accepted_clp: number;
115256
- /** @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. */
115257
115747
  rate_30d: number | null;
115258
- /** @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. */
115259
115749
  rate_60d: number | null;
115260
115750
  /** @enum {string} */
115261
115751
  formula: "mentores_2026_09_25";
@@ -115264,10 +115754,12 @@ interface components {
115264
115754
  rule: string;
115265
115755
  };
115266
115756
  cierres: {
115267
- count: number;
115268
- /** @description The accepted value of the presupuestos that closed — never the payments. */
115269
- value_clp: number;
115270
- 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;
115271
115763
  /** @enum {string} */
115272
115764
  formula: "cierre_2026_09_25";
115273
115765
  rule: string;
@@ -115275,24 +115767,27 @@ interface components {
115275
115767
  cohorts: {
115276
115768
  /** @description Issue month, `YYYY-MM`. */
115277
115769
  month: string;
115278
- /** @description Presupuestos presented (issued), one per lineage. */
115279
- presented: number;
115280
- accepted: number;
115281
- /** @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. */
115282
115775
  rate: number | null;
115283
- /** @description Accepted the day they were issued. */
115284
- same_day: number;
115285
- later: number;
115286
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115287
- cita_only: number;
115288
- /** @description Not accepted yet, window still open. */
115289
- pending: number;
115290
- /** @description CLP presented, entry lines excluded. */
115291
- presented_clp: number;
115292
- accepted_clp: number;
115293
- /** @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. */
115294
115789
  rate_30d: number | null;
115295
- /** @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. */
115296
115791
  rate_60d: number | null;
115297
115792
  /** @description Every presupuesto of the month is past its window. */
115298
115793
  mature: boolean;
@@ -115301,81 +115796,113 @@ interface components {
115301
115796
  /** Format: uuid */
115302
115797
  professional_id: string;
115303
115798
  professional_name: string;
115304
- /** @description Presupuestos presented (issued), one per lineage. */
115305
- presented: number;
115306
- accepted: number;
115307
- /** @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. */
115308
115804
  rate: number | null;
115309
- /** @description Accepted the day they were issued. */
115310
- same_day: number;
115311
- later: number;
115312
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115313
- cita_only: number;
115314
- /** @description Not accepted yet, window still open. */
115315
- pending: number;
115316
- /** @description CLP presented, entry lines excluded. */
115317
- presented_clp: number;
115318
- accepted_clp: number;
115319
- cierres: number;
115320
- 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;
115321
115821
  }[];
115322
- unassigned_presented: number;
115323
- 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;
115324
115826
  months: {
115325
115827
  month: string;
115326
- accepted_clp: number;
115327
- 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;
115328
115832
  collected_clp: number | null;
115329
- cierres: number;
115330
- 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;
115331
115837
  }[];
115332
115838
  first_visit: {
115333
115839
  /** @enum {string} */
115334
115840
  formula: "propuesta";
115335
- patients: number;
115336
- paid: number;
115337
- /** @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. */
115338
115846
  rate: number | null;
115339
115847
  rule: string;
115340
115848
  };
115341
115849
  second_visit: {
115342
115850
  /** @enum {string} */
115343
115851
  formula: "propuesta";
115344
- eligible: number;
115345
- converted: number;
115346
- /** @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. */
115347
115857
  rate: number | null;
115348
115858
  rule: string;
115349
115859
  };
115350
115860
  botados: {
115351
115861
  unaccepted: {
115352
- count: number;
115353
- 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;
115354
115866
  };
115355
115867
  accepted_unscheduled: {
115356
- count: number;
115357
- 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;
115358
115872
  };
115359
115873
  mid_treatment_no_future_cita: {
115360
- count: number;
115361
- 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;
115362
115878
  };
115363
115879
  /** @enum {string} */
115364
115880
  formula: "propuesta";
115365
115881
  /** @enum {string} */
115366
115882
  basis: "live_last_6_months";
115367
115883
  total: {
115368
- count: number;
115369
- 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;
115370
115888
  };
115371
115889
  /** @enum {string|null} */
115372
115890
  focus: "unaccepted" | "accepted_unscheduled" | "mid_treatment_no_future_cita" | null;
115373
115891
  rule: string;
115374
115892
  };
115375
115893
  coverage: {
115376
- plans_without_lines: number;
115377
- excluded_zero: number;
115378
- 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;
115379
115906
  };
115380
115907
  };
115381
115908
  AdsState: {
@@ -115513,6 +116040,17 @@ interface components {
115513
116040
  * @enum {string}
115514
116041
  */
115515
116042
  source: "available" | "no_payments_source" | "definition_missing";
116043
+ /** @description If the stage happened now, it would reach Meta: switched on and its source has what it needs. */
116044
+ ready: boolean;
116045
+ /**
116046
+ * @description Why it would not reach Meta now; `null` when `ready`. Precedence: `installments` > `awaiting_switch` > `definition_missing` > `no_payments_yet` > `off`.
116047
+ * @enum {string|null}
116048
+ */
116049
+ ready_reason: "installments" | "awaiting_switch" | "definition_missing" | "no_payments_yet" | "off" | null;
116050
+ /** @description Outcomes of the stage that happened in Vitrina over the last 28 days, sent or not. `first_payment`: first payments of accepted plans in Vitrina’s payment ledger, before the switch too. */
116051
+ count_28d: number;
116052
+ /** @description `count_28d / 4`, one decimal — «por semana». */
116053
+ weekly_28d: number;
115516
116054
  /** @enum {string} */
115517
116055
  verdict: "wired" | "sent_not_used" | "below_threshold" | "custom_conversion_broken" | "missing_custom_conversion" | "connection_broken" | "check_failed" | "not_checked";
115518
116056
  active_ad_sets: number;
@@ -115540,9 +116078,22 @@ interface components {
115540
116078
  /** @description Sample mode only: when the scripted arrival plays. */
115541
116079
  sample_arrival_ms?: number;
115542
116080
  }[];
116081
+ /** @description Counted stages that are `ready` — «{enabled_count} de {stage_count} etapas llegan a Meta». A switched-on stage whose source has no data yet is in `waiting_count` instead. */
115543
116082
  enabled_count: number;
115544
- /** @description «{enabled_count} de {stage_count} etapas»; locked stages excluded. */
116083
+ /** @description Counted stages switched on but not `ready` yet («1 espera pagos»). `enabled_count + waiting_count` = the switched-on counted stages. */
116084
+ waiting_count: number;
116085
+ /** @description «{enabled_count} de {stage_count} etapas»; locked stages and the first payment before the switch excluded. */
115545
116086
  stage_count: number;
116087
+ /** @description Clinics: the Purchase volume of the first payment, counted before the switch too. `null` outside clinics or when it could not be read. */
116088
+ first_payment_candidates: {
116089
+ /** @description First payments of accepted plans over the last 28 days in Vitrina’s payment ledger — what reaches Meta as Purchase once switched. */
116090
+ count_28d: number;
116091
+ /** @description `count_28d / 4`, one decimal. */
116092
+ weekly_28d: number;
116093
+ /** @description The same volume in the clinic system’s mirror, for information: mirrored payments do not reach Meta. `null` without a mirror opt-in. */
116094
+ mirror_count_28d: number | null;
116095
+ mirror_weekly_28d: number | null;
116096
+ } | null;
115546
116097
  /** @description Health-dataset restriction by Meta (clinics): `blocked` = Meta counted none of the Lead / Schedule / Purchase sent on ≥ 3 of the last 7 days. `unknown` when it could not be read; `none` outside clinics. */
115547
116098
  restriction: {
115548
116099
  /** @enum {string} */
@@ -115607,12 +116158,19 @@ interface components {
115607
116158
  vitrina: {
115608
116159
  stage_label: string;
115609
116160
  occurred_at: string;
116161
+ /** @description The workspace’s full value, CLP (before Meta’s cap). */
115610
116162
  value_clp: number | null;
115611
116163
  /** @description Last 4 characters of the contact’s opaque reference; never a name or a contact detail. */
115612
116164
  contact_tail: string | null;
115613
116165
  };
115614
116166
  meta: {
115615
116167
  event: string;
116168
+ /** @description The value Meta receives, CLP; `null` when Meta gets no value. */
116169
+ value_clp: number | null;
116170
+ /** @description Meta receives the workspace’s 95th-percentile cap instead of the full value (`vitrina.value_clp`). */
116171
+ capped: boolean;
116172
+ /** @description The cap applied, CLP, when `capped`. */
116173
+ value_cap_clp: number | null;
115616
116174
  reaches_meta: boolean;
115617
116175
  /** @enum {string|null} */
115618
116176
  not_sent_reason: "marketing_opt_out" | "stage_off" | "stage_locked" | null;
@@ -115627,6 +116185,11 @@ interface components {
115627
116185
  state: "sent" | "hashed" | "withheld" | "absent";
115628
116186
  /** @description Non-identifying fields only (event, time, value, where it happened). */
115629
116187
  display?: string;
116188
+ /**
116189
+ * @description `action_source` only: the conversation’s channel when the event was born in a messaging thread; `null` when not, or unknown.
116190
+ * @enum {string|null}
116191
+ */
116192
+ display_channel?: "whatsapp" | "instagram" | "messenger" | null;
115630
116193
  }[];
115631
116194
  };
115632
116195
  /** @description What never leaves Vitrina, as keys (`national_id`, `clinical_data`, `notes`, …). */
@@ -116278,8 +116841,11 @@ interface components {
116278
116841
  AdsFeedItem: {
116279
116842
  /** Format: uuid */
116280
116843
  id: string;
116281
- /** @enum {string} */
116282
- stage: "lead_created" | "appointment_booked" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received";
116844
+ /**
116845
+ * @description The outcome stage. `first_payment` = a clinic’s first payment of an accepted plan («Primer pago»), the Purchase Meta receives after the switch.
116846
+ * @enum {string}
116847
+ */
116848
+ stage: "lead_created" | "appointment_booked" | "appointment_attended" | "quote_presented" | "closed_won" | "first_payment" | "payment_received";
116283
116849
  /** @description When the outcome happened. */
116284
116850
  occurred_at: string;
116285
116851
  /** @description When Vitrina recorded it — the cursor field, microsecond-exact. */