@vitrina/api 17.72.1 → 17.75.1
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 +301 -0
- package/dist/index.d.ts +301 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -38444,6 +38444,9 @@ interface paths {
|
|
|
38444
38444
|
uf_value: number | null;
|
|
38445
38445
|
uf_value_date: string | null;
|
|
38446
38446
|
} | null;
|
|
38447
|
+
cancel_at_period_end: boolean;
|
|
38448
|
+
ends_on: string | null;
|
|
38449
|
+
plan_ended_at: string | null;
|
|
38447
38450
|
};
|
|
38448
38451
|
};
|
|
38449
38452
|
};
|
|
@@ -39552,6 +39555,7 @@ interface paths {
|
|
|
39552
39555
|
* "deed_version": null,
|
|
39553
39556
|
* "fee_schedule_version": null,
|
|
39554
39557
|
* "terms_version": null,
|
|
39558
|
+
* "document_family": null,
|
|
39555
39559
|
* "rendered_at": "2026-09-19T15:10:00.000Z",
|
|
39556
39560
|
* "rendered_by": "11111111-0000-4000-8000-000000000001",
|
|
39557
39561
|
* "supersedes_id": null
|
|
@@ -39597,6 +39601,7 @@ interface paths {
|
|
|
39597
39601
|
* "deed_version": null,
|
|
39598
39602
|
* "fee_schedule_version": null,
|
|
39599
39603
|
* "terms_version": null,
|
|
39604
|
+
* "document_family": null,
|
|
39600
39605
|
* "rendered_at": "2026-09-19T15:10:00.000Z",
|
|
39601
39606
|
* "rendered_by": "11111111-0000-4000-8000-000000000001",
|
|
39602
39607
|
* "supersedes_id": null
|
|
@@ -39809,6 +39814,282 @@ interface paths {
|
|
|
39809
39814
|
patch?: never;
|
|
39810
39815
|
trace?: never;
|
|
39811
39816
|
};
|
|
39817
|
+
"/sale-notes/{id}/declaracion-responsabilidad": {
|
|
39818
|
+
parameters: {
|
|
39819
|
+
query?: never;
|
|
39820
|
+
header?: never;
|
|
39821
|
+
path?: never;
|
|
39822
|
+
cookie?: never;
|
|
39823
|
+
};
|
|
39824
|
+
get?: never;
|
|
39825
|
+
put?: never;
|
|
39826
|
+
/**
|
|
39827
|
+
* Print and freeze the buyer’s declaración de responsabilidad
|
|
39828
|
+
* @description Produces the **declaración de responsabilidad** the buyer signs when taking the car, for a closed (approved) nota de venta, and freezes it as an immutable `rendered_document` (ADR 0057) with `document_family: "declaracion_responsabilidad"` and the template version it was worded with. One page, portrait A4, on the workspace’s document branding.
|
|
39829
|
+
*
|
|
39830
|
+
* The buyer declares that, from the purchase on, they answer for any damage to people or property from using the car (by them or anyone else) and for every traffic fine and toll charge, and that fines from before the purchase stay with the dealership. The plate stays registered to the seller until the transfer is inscribed; this is the dealership’s cover for that window.
|
|
39831
|
+
*
|
|
39832
|
+
* **The words are the dealership’s own:** the workspace’s `declaracion_responsabilidad` document template (Plantillas) — its default, else its only one, else the standard text (`declaracion-de-responsabilidad-estandar`). Withdrawing the template returns to the standard text. A re-print keeps the words of the declaración already issued.
|
|
39833
|
+
*
|
|
39834
|
+
* **It never asks for legal data.** It prints with whatever the sale has (buyer name, RUT, domicilio, phone and e-mail; the car’s make, model, year, colour, plate with its check digit, VIN) and leaves out what is missing — never a blank, never a placeholder, never a 409 for data.
|
|
39835
|
+
*
|
|
39836
|
+
* **Reachable only once the sale is closed (approved) and not voided:** a sale not yet closed is a **409** with `details.blocked_reason: sale_note_not_approved` («La venta V-12 todavía no está cerrada. Ciérrala para imprimir la declaración de responsabilidad.»), a voided one a **409** with `sale_note_voided`.
|
|
39837
|
+
*
|
|
39838
|
+
* **Re-printing is not a new document:** an unchanged note answers **200** with the same artefact, `frozen: true`. When the facts changed (say the buyer’s RUT was added) a **201** carries a NEW artefact whose `supersedes_id` names the previous one. Then `GET /sale-notes/{id}/declaracion-responsabilidad/pdf` serves the bytes.
|
|
39839
|
+
*/
|
|
39840
|
+
post: {
|
|
39841
|
+
parameters: {
|
|
39842
|
+
query?: never;
|
|
39843
|
+
header?: {
|
|
39844
|
+
/** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
|
|
39845
|
+
"Idempotency-Key"?: string;
|
|
39846
|
+
};
|
|
39847
|
+
path: {
|
|
39848
|
+
id: string;
|
|
39849
|
+
};
|
|
39850
|
+
cookie?: never;
|
|
39851
|
+
};
|
|
39852
|
+
requestBody?: never;
|
|
39853
|
+
responses: {
|
|
39854
|
+
/** @description The frozen artefact, served unchanged */
|
|
39855
|
+
200: {
|
|
39856
|
+
headers: {
|
|
39857
|
+
[name: string]: unknown;
|
|
39858
|
+
};
|
|
39859
|
+
content: {
|
|
39860
|
+
/**
|
|
39861
|
+
* @example {
|
|
39862
|
+
* "data": {
|
|
39863
|
+
* "document": {
|
|
39864
|
+
* "id": "d5d5d5d5-0000-4000-8000-000000000002",
|
|
39865
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39866
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39867
|
+
* "purchase_note_id": null,
|
|
39868
|
+
* "consignment_contract_id": null,
|
|
39869
|
+
* "clinic_consent_id": null,
|
|
39870
|
+
* "storage_bucket": "rendered-documents",
|
|
39871
|
+
* "storage_key": "tenants/a1a1a1a1-0000-4000-8000-000000000001/documents/sale_note/d4d4d4d4-0000-4000-8000-000000000001/d5d5d5d5-0000-4000-8000-000000000002.pdf",
|
|
39872
|
+
* "mime": "application/pdf",
|
|
39873
|
+
* "byte_size": 31877,
|
|
39874
|
+
* "sha256": "4be1c0d2a3f4e5d6c7b8a9f0e1d2c3b4a5f6e7d8c9b0a1f2e3d4c5b6a7f8e9d0",
|
|
39875
|
+
* "template_version": "declaracion-de-responsabilidad-v1",
|
|
39876
|
+
* "deed_version": null,
|
|
39877
|
+
* "fee_schedule_version": null,
|
|
39878
|
+
* "terms_version": null,
|
|
39879
|
+
* "document_family": "declaracion_responsabilidad",
|
|
39880
|
+
* "rendered_at": "2026-11-19T15:10:00.000Z",
|
|
39881
|
+
* "rendered_by": "11111111-0000-4000-8000-000000000001",
|
|
39882
|
+
* "supersedes_id": null
|
|
39883
|
+
* },
|
|
39884
|
+
* "frozen": true,
|
|
39885
|
+
* "already_issued": true,
|
|
39886
|
+
* "template_version": "declaracion-de-responsabilidad-v1"
|
|
39887
|
+
* }
|
|
39888
|
+
* }
|
|
39889
|
+
*/
|
|
39890
|
+
"application/json": {
|
|
39891
|
+
data: components["schemas"]["DeclaracionResponsabilidadIssuance"];
|
|
39892
|
+
};
|
|
39893
|
+
};
|
|
39894
|
+
};
|
|
39895
|
+
/** @description The newly issued artefact */
|
|
39896
|
+
201: {
|
|
39897
|
+
headers: {
|
|
39898
|
+
[name: string]: unknown;
|
|
39899
|
+
};
|
|
39900
|
+
content: {
|
|
39901
|
+
/**
|
|
39902
|
+
* @example {
|
|
39903
|
+
* "data": {
|
|
39904
|
+
* "document": {
|
|
39905
|
+
* "id": "d5d5d5d5-0000-4000-8000-000000000002",
|
|
39906
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39907
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39908
|
+
* "purchase_note_id": null,
|
|
39909
|
+
* "consignment_contract_id": null,
|
|
39910
|
+
* "clinic_consent_id": null,
|
|
39911
|
+
* "storage_bucket": "rendered-documents",
|
|
39912
|
+
* "storage_key": "tenants/a1a1a1a1-0000-4000-8000-000000000001/documents/sale_note/d4d4d4d4-0000-4000-8000-000000000001/d5d5d5d5-0000-4000-8000-000000000002.pdf",
|
|
39913
|
+
* "mime": "application/pdf",
|
|
39914
|
+
* "byte_size": 31877,
|
|
39915
|
+
* "sha256": "4be1c0d2a3f4e5d6c7b8a9f0e1d2c3b4a5f6e7d8c9b0a1f2e3d4c5b6a7f8e9d0",
|
|
39916
|
+
* "template_version": "declaracion-de-responsabilidad-v1",
|
|
39917
|
+
* "deed_version": null,
|
|
39918
|
+
* "fee_schedule_version": null,
|
|
39919
|
+
* "terms_version": null,
|
|
39920
|
+
* "document_family": "declaracion_responsabilidad",
|
|
39921
|
+
* "rendered_at": "2026-11-19T15:10:00.000Z",
|
|
39922
|
+
* "rendered_by": "11111111-0000-4000-8000-000000000001",
|
|
39923
|
+
* "supersedes_id": null
|
|
39924
|
+
* },
|
|
39925
|
+
* "frozen": false,
|
|
39926
|
+
* "already_issued": false,
|
|
39927
|
+
* "template_version": "declaracion-de-responsabilidad-v1"
|
|
39928
|
+
* }
|
|
39929
|
+
* }
|
|
39930
|
+
*/
|
|
39931
|
+
"application/json": {
|
|
39932
|
+
data: components["schemas"]["DeclaracionResponsabilidadIssuance"];
|
|
39933
|
+
};
|
|
39934
|
+
};
|
|
39935
|
+
};
|
|
39936
|
+
/** @description Validation error */
|
|
39937
|
+
400: {
|
|
39938
|
+
headers: {
|
|
39939
|
+
[name: string]: unknown;
|
|
39940
|
+
};
|
|
39941
|
+
content: {
|
|
39942
|
+
"application/json": components["schemas"]["Error"];
|
|
39943
|
+
};
|
|
39944
|
+
};
|
|
39945
|
+
/** @description Unauthorized */
|
|
39946
|
+
401: {
|
|
39947
|
+
headers: {
|
|
39948
|
+
[name: string]: unknown;
|
|
39949
|
+
};
|
|
39950
|
+
content: {
|
|
39951
|
+
"application/json": components["schemas"]["Error"];
|
|
39952
|
+
};
|
|
39953
|
+
};
|
|
39954
|
+
/** @description Forbidden */
|
|
39955
|
+
403: {
|
|
39956
|
+
headers: {
|
|
39957
|
+
[name: string]: unknown;
|
|
39958
|
+
};
|
|
39959
|
+
content: {
|
|
39960
|
+
"application/json": components["schemas"]["Error"];
|
|
39961
|
+
};
|
|
39962
|
+
};
|
|
39963
|
+
/** @description Not found */
|
|
39964
|
+
404: {
|
|
39965
|
+
headers: {
|
|
39966
|
+
[name: string]: unknown;
|
|
39967
|
+
};
|
|
39968
|
+
content: {
|
|
39969
|
+
"application/json": components["schemas"]["Error"];
|
|
39970
|
+
};
|
|
39971
|
+
};
|
|
39972
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
39973
|
+
409: {
|
|
39974
|
+
headers: {
|
|
39975
|
+
[name: string]: unknown;
|
|
39976
|
+
};
|
|
39977
|
+
content: {
|
|
39978
|
+
"application/json": components["schemas"]["Error"];
|
|
39979
|
+
};
|
|
39980
|
+
};
|
|
39981
|
+
/** @description Rate limited */
|
|
39982
|
+
429: {
|
|
39983
|
+
headers: {
|
|
39984
|
+
[name: string]: unknown;
|
|
39985
|
+
};
|
|
39986
|
+
content: {
|
|
39987
|
+
"application/json": components["schemas"]["Error"];
|
|
39988
|
+
};
|
|
39989
|
+
};
|
|
39990
|
+
};
|
|
39991
|
+
};
|
|
39992
|
+
delete?: never;
|
|
39993
|
+
options?: never;
|
|
39994
|
+
head?: never;
|
|
39995
|
+
patch?: never;
|
|
39996
|
+
trace?: never;
|
|
39997
|
+
};
|
|
39998
|
+
"/sale-notes/{id}/declaracion-responsabilidad/pdf": {
|
|
39999
|
+
parameters: {
|
|
40000
|
+
query?: never;
|
|
40001
|
+
header?: never;
|
|
40002
|
+
path?: never;
|
|
40003
|
+
cookie?: never;
|
|
40004
|
+
};
|
|
40005
|
+
/**
|
|
40006
|
+
* Download the declaración de responsabilidad
|
|
40007
|
+
* @description The **stored bytes** of the current declaración, as `application/pdf` (inline), with its `sha256` re-verified against the row; it never re-renders. The `X-Template-Version` header names the words it carries. A voided note still serves the declaración it printed before the void. A **404** when none was printed yet — call `POST /sale-notes/{id}/declaracion-responsabilidad` first.
|
|
40008
|
+
*/
|
|
40009
|
+
get: {
|
|
40010
|
+
parameters: {
|
|
40011
|
+
query?: never;
|
|
40012
|
+
header?: never;
|
|
40013
|
+
path: {
|
|
40014
|
+
id: string;
|
|
40015
|
+
};
|
|
40016
|
+
cookie?: never;
|
|
40017
|
+
};
|
|
40018
|
+
requestBody?: never;
|
|
40019
|
+
responses: {
|
|
40020
|
+
/** @description The declaración, as stored */
|
|
40021
|
+
200: {
|
|
40022
|
+
headers: {
|
|
40023
|
+
[name: string]: unknown;
|
|
40024
|
+
};
|
|
40025
|
+
content: {
|
|
40026
|
+
"application/pdf": string;
|
|
40027
|
+
};
|
|
40028
|
+
};
|
|
40029
|
+
/** @description Validation error */
|
|
40030
|
+
400: {
|
|
40031
|
+
headers: {
|
|
40032
|
+
[name: string]: unknown;
|
|
40033
|
+
};
|
|
40034
|
+
content: {
|
|
40035
|
+
"application/json": components["schemas"]["Error"];
|
|
40036
|
+
};
|
|
40037
|
+
};
|
|
40038
|
+
/** @description Unauthorized */
|
|
40039
|
+
401: {
|
|
40040
|
+
headers: {
|
|
40041
|
+
[name: string]: unknown;
|
|
40042
|
+
};
|
|
40043
|
+
content: {
|
|
40044
|
+
"application/json": components["schemas"]["Error"];
|
|
40045
|
+
};
|
|
40046
|
+
};
|
|
40047
|
+
/** @description Forbidden */
|
|
40048
|
+
403: {
|
|
40049
|
+
headers: {
|
|
40050
|
+
[name: string]: unknown;
|
|
40051
|
+
};
|
|
40052
|
+
content: {
|
|
40053
|
+
"application/json": components["schemas"]["Error"];
|
|
40054
|
+
};
|
|
40055
|
+
};
|
|
40056
|
+
/** @description Not found */
|
|
40057
|
+
404: {
|
|
40058
|
+
headers: {
|
|
40059
|
+
[name: string]: unknown;
|
|
40060
|
+
};
|
|
40061
|
+
content: {
|
|
40062
|
+
"application/json": components["schemas"]["Error"];
|
|
40063
|
+
};
|
|
40064
|
+
};
|
|
40065
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
40066
|
+
409: {
|
|
40067
|
+
headers: {
|
|
40068
|
+
[name: string]: unknown;
|
|
40069
|
+
};
|
|
40070
|
+
content: {
|
|
40071
|
+
"application/json": components["schemas"]["Error"];
|
|
40072
|
+
};
|
|
40073
|
+
};
|
|
40074
|
+
/** @description Rate limited */
|
|
40075
|
+
429: {
|
|
40076
|
+
headers: {
|
|
40077
|
+
[name: string]: unknown;
|
|
40078
|
+
};
|
|
40079
|
+
content: {
|
|
40080
|
+
"application/json": components["schemas"]["Error"];
|
|
40081
|
+
};
|
|
40082
|
+
};
|
|
40083
|
+
};
|
|
40084
|
+
};
|
|
40085
|
+
put?: never;
|
|
40086
|
+
post?: never;
|
|
40087
|
+
delete?: never;
|
|
40088
|
+
options?: never;
|
|
40089
|
+
head?: never;
|
|
40090
|
+
patch?: never;
|
|
40091
|
+
trace?: never;
|
|
40092
|
+
};
|
|
39812
40093
|
"/sale-notes/{id}/registered-owner": {
|
|
39813
40094
|
parameters: {
|
|
39814
40095
|
query?: never;
|
|
@@ -316785,6 +317066,7 @@ interface paths {
|
|
|
316785
317066
|
* "vendor_active": true,
|
|
316786
317067
|
* "active": true,
|
|
316787
317068
|
* "agent_bookable": true,
|
|
317069
|
+
* "is_evaluation": true,
|
|
316788
317070
|
* "color": "#cccccc",
|
|
316789
317071
|
* "agenda_online": false,
|
|
316790
317072
|
* "overrides": [
|
|
@@ -316908,6 +317190,8 @@ interface paths {
|
|
|
316908
317190
|
duration_minutes?: number | null;
|
|
316909
317191
|
active?: boolean;
|
|
316910
317192
|
agent_bookable?: boolean;
|
|
317193
|
+
/** @description Is this motivo the evaluation visit? Absent = seeded from the name («Evaluación», «Diagnóstico», «Primera consulta»…). */
|
|
317194
|
+
is_evaluation?: boolean;
|
|
316911
317195
|
professionals?: {
|
|
316912
317196
|
/** Format: uuid */
|
|
316913
317197
|
professional_id: string;
|
|
@@ -316937,6 +317221,7 @@ interface paths {
|
|
|
316937
317221
|
* "vendor_active": true,
|
|
316938
317222
|
* "active": true,
|
|
316939
317223
|
* "agent_bookable": true,
|
|
317224
|
+
* "is_evaluation": true,
|
|
316940
317225
|
* "color": "#cccccc",
|
|
316941
317226
|
* "agenda_online": false,
|
|
316942
317227
|
* "overrides": [],
|
|
@@ -317322,6 +317607,8 @@ interface paths {
|
|
|
317322
317607
|
duration_minutes?: number;
|
|
317323
317608
|
active?: boolean;
|
|
317324
317609
|
agent_bookable?: boolean;
|
|
317610
|
+
/** @description Mark or unmark this motivo as the evaluation visit (mirrored and native motivos alike; never an override, a resync keeps it). */
|
|
317611
|
+
is_evaluation?: boolean;
|
|
317325
317612
|
reset?: ("duration_minutes" | "active" | "professionals")[];
|
|
317326
317613
|
};
|
|
317327
317614
|
};
|
|
@@ -317347,6 +317634,7 @@ interface paths {
|
|
|
317347
317634
|
* "vendor_active": true,
|
|
317348
317635
|
* "active": true,
|
|
317349
317636
|
* "agent_bookable": true,
|
|
317637
|
+
* "is_evaluation": true,
|
|
317350
317638
|
* "color": "#cccccc",
|
|
317351
317639
|
* "agenda_online": false,
|
|
317352
317640
|
* "overrides": [
|
|
@@ -317491,6 +317779,7 @@ interface paths {
|
|
|
317491
317779
|
* "vendor_active": true,
|
|
317492
317780
|
* "active": true,
|
|
317493
317781
|
* "agent_bookable": true,
|
|
317782
|
+
* "is_evaluation": true,
|
|
317494
317783
|
* "color": "#cccccc",
|
|
317495
317784
|
* "agenda_online": false,
|
|
317496
317785
|
* "overrides": [
|
|
@@ -317630,6 +317919,7 @@ interface paths {
|
|
|
317630
317919
|
* "vendor_active": true,
|
|
317631
317920
|
* "active": true,
|
|
317632
317921
|
* "agent_bookable": true,
|
|
317922
|
+
* "is_evaluation": true,
|
|
317633
317923
|
* "color": "#cccccc",
|
|
317634
317924
|
* "agenda_online": false,
|
|
317635
317925
|
* "overrides": [],
|
|
@@ -317788,6 +318078,7 @@ interface paths {
|
|
|
317788
318078
|
* "vendor_active": true,
|
|
317789
318079
|
* "active": true,
|
|
317790
318080
|
* "agent_bookable": true,
|
|
318081
|
+
* "is_evaluation": true,
|
|
317791
318082
|
* "color": "#cccccc",
|
|
317792
318083
|
* "agenda_online": false,
|
|
317793
318084
|
* "overrides": [],
|
|
@@ -317940,6 +318231,7 @@ interface paths {
|
|
|
317940
318231
|
* "vendor_active": true,
|
|
317941
318232
|
* "active": true,
|
|
317942
318233
|
* "agent_bookable": true,
|
|
318234
|
+
* "is_evaluation": true,
|
|
317943
318235
|
* "color": "#cccccc",
|
|
317944
318236
|
* "agenda_online": false,
|
|
317945
318237
|
* "overrides": [],
|
|
@@ -322501,6 +322793,7 @@ interface components {
|
|
|
322501
322793
|
byte_size: number;
|
|
322502
322794
|
sha256: string;
|
|
322503
322795
|
template_version: string | null;
|
|
322796
|
+
document_family?: string | null;
|
|
322504
322797
|
rendered_at: string;
|
|
322505
322798
|
rendered_by: string | null;
|
|
322506
322799
|
/** Format: uuid */
|
|
@@ -322548,6 +322841,12 @@ interface components {
|
|
|
322548
322841
|
message: string;
|
|
322549
322842
|
} | null;
|
|
322550
322843
|
};
|
|
322844
|
+
DeclaracionResponsabilidadIssuance: {
|
|
322845
|
+
document: components["schemas"]["CompraventaArtefact"];
|
|
322846
|
+
frozen: boolean;
|
|
322847
|
+
already_issued: boolean;
|
|
322848
|
+
template_version: string;
|
|
322849
|
+
};
|
|
322551
322850
|
SaleNoteCorrection: {
|
|
322552
322851
|
/** @enum {string} */
|
|
322553
322852
|
outcome: "applied" | "pending_approval" | "unchanged";
|
|
@@ -339685,6 +339984,8 @@ interface components {
|
|
|
339685
339984
|
vendor_active: boolean;
|
|
339686
339985
|
active: boolean;
|
|
339687
339986
|
agent_bookable: boolean;
|
|
339987
|
+
/** @description Vitrina's own answer: this motivo is the evaluation visit (where a plan is diagnosed and quoted). Seeded from the name when the motivo is created or first synced, editable, never overwritten by a resync. The AI agent never books a second live evaluation for the same patient. */
|
|
339988
|
+
is_evaluation: boolean;
|
|
339688
339989
|
color: string | null;
|
|
339689
339990
|
agenda_online: boolean | null;
|
|
339690
339991
|
overrides: ("duration_minutes" | "active" | "professionals")[];
|
package/dist/index.d.ts
CHANGED
|
@@ -38444,6 +38444,9 @@ interface paths {
|
|
|
38444
38444
|
uf_value: number | null;
|
|
38445
38445
|
uf_value_date: string | null;
|
|
38446
38446
|
} | null;
|
|
38447
|
+
cancel_at_period_end: boolean;
|
|
38448
|
+
ends_on: string | null;
|
|
38449
|
+
plan_ended_at: string | null;
|
|
38447
38450
|
};
|
|
38448
38451
|
};
|
|
38449
38452
|
};
|
|
@@ -39552,6 +39555,7 @@ interface paths {
|
|
|
39552
39555
|
* "deed_version": null,
|
|
39553
39556
|
* "fee_schedule_version": null,
|
|
39554
39557
|
* "terms_version": null,
|
|
39558
|
+
* "document_family": null,
|
|
39555
39559
|
* "rendered_at": "2026-09-19T15:10:00.000Z",
|
|
39556
39560
|
* "rendered_by": "11111111-0000-4000-8000-000000000001",
|
|
39557
39561
|
* "supersedes_id": null
|
|
@@ -39597,6 +39601,7 @@ interface paths {
|
|
|
39597
39601
|
* "deed_version": null,
|
|
39598
39602
|
* "fee_schedule_version": null,
|
|
39599
39603
|
* "terms_version": null,
|
|
39604
|
+
* "document_family": null,
|
|
39600
39605
|
* "rendered_at": "2026-09-19T15:10:00.000Z",
|
|
39601
39606
|
* "rendered_by": "11111111-0000-4000-8000-000000000001",
|
|
39602
39607
|
* "supersedes_id": null
|
|
@@ -39809,6 +39814,282 @@ interface paths {
|
|
|
39809
39814
|
patch?: never;
|
|
39810
39815
|
trace?: never;
|
|
39811
39816
|
};
|
|
39817
|
+
"/sale-notes/{id}/declaracion-responsabilidad": {
|
|
39818
|
+
parameters: {
|
|
39819
|
+
query?: never;
|
|
39820
|
+
header?: never;
|
|
39821
|
+
path?: never;
|
|
39822
|
+
cookie?: never;
|
|
39823
|
+
};
|
|
39824
|
+
get?: never;
|
|
39825
|
+
put?: never;
|
|
39826
|
+
/**
|
|
39827
|
+
* Print and freeze the buyer’s declaración de responsabilidad
|
|
39828
|
+
* @description Produces the **declaración de responsabilidad** the buyer signs when taking the car, for a closed (approved) nota de venta, and freezes it as an immutable `rendered_document` (ADR 0057) with `document_family: "declaracion_responsabilidad"` and the template version it was worded with. One page, portrait A4, on the workspace’s document branding.
|
|
39829
|
+
*
|
|
39830
|
+
* The buyer declares that, from the purchase on, they answer for any damage to people or property from using the car (by them or anyone else) and for every traffic fine and toll charge, and that fines from before the purchase stay with the dealership. The plate stays registered to the seller until the transfer is inscribed; this is the dealership’s cover for that window.
|
|
39831
|
+
*
|
|
39832
|
+
* **The words are the dealership’s own:** the workspace’s `declaracion_responsabilidad` document template (Plantillas) — its default, else its only one, else the standard text (`declaracion-de-responsabilidad-estandar`). Withdrawing the template returns to the standard text. A re-print keeps the words of the declaración already issued.
|
|
39833
|
+
*
|
|
39834
|
+
* **It never asks for legal data.** It prints with whatever the sale has (buyer name, RUT, domicilio, phone and e-mail; the car’s make, model, year, colour, plate with its check digit, VIN) and leaves out what is missing — never a blank, never a placeholder, never a 409 for data.
|
|
39835
|
+
*
|
|
39836
|
+
* **Reachable only once the sale is closed (approved) and not voided:** a sale not yet closed is a **409** with `details.blocked_reason: sale_note_not_approved` («La venta V-12 todavía no está cerrada. Ciérrala para imprimir la declaración de responsabilidad.»), a voided one a **409** with `sale_note_voided`.
|
|
39837
|
+
*
|
|
39838
|
+
* **Re-printing is not a new document:** an unchanged note answers **200** with the same artefact, `frozen: true`. When the facts changed (say the buyer’s RUT was added) a **201** carries a NEW artefact whose `supersedes_id` names the previous one. Then `GET /sale-notes/{id}/declaracion-responsabilidad/pdf` serves the bytes.
|
|
39839
|
+
*/
|
|
39840
|
+
post: {
|
|
39841
|
+
parameters: {
|
|
39842
|
+
query?: never;
|
|
39843
|
+
header?: {
|
|
39844
|
+
/** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
|
|
39845
|
+
"Idempotency-Key"?: string;
|
|
39846
|
+
};
|
|
39847
|
+
path: {
|
|
39848
|
+
id: string;
|
|
39849
|
+
};
|
|
39850
|
+
cookie?: never;
|
|
39851
|
+
};
|
|
39852
|
+
requestBody?: never;
|
|
39853
|
+
responses: {
|
|
39854
|
+
/** @description The frozen artefact, served unchanged */
|
|
39855
|
+
200: {
|
|
39856
|
+
headers: {
|
|
39857
|
+
[name: string]: unknown;
|
|
39858
|
+
};
|
|
39859
|
+
content: {
|
|
39860
|
+
/**
|
|
39861
|
+
* @example {
|
|
39862
|
+
* "data": {
|
|
39863
|
+
* "document": {
|
|
39864
|
+
* "id": "d5d5d5d5-0000-4000-8000-000000000002",
|
|
39865
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39866
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39867
|
+
* "purchase_note_id": null,
|
|
39868
|
+
* "consignment_contract_id": null,
|
|
39869
|
+
* "clinic_consent_id": null,
|
|
39870
|
+
* "storage_bucket": "rendered-documents",
|
|
39871
|
+
* "storage_key": "tenants/a1a1a1a1-0000-4000-8000-000000000001/documents/sale_note/d4d4d4d4-0000-4000-8000-000000000001/d5d5d5d5-0000-4000-8000-000000000002.pdf",
|
|
39872
|
+
* "mime": "application/pdf",
|
|
39873
|
+
* "byte_size": 31877,
|
|
39874
|
+
* "sha256": "4be1c0d2a3f4e5d6c7b8a9f0e1d2c3b4a5f6e7d8c9b0a1f2e3d4c5b6a7f8e9d0",
|
|
39875
|
+
* "template_version": "declaracion-de-responsabilidad-v1",
|
|
39876
|
+
* "deed_version": null,
|
|
39877
|
+
* "fee_schedule_version": null,
|
|
39878
|
+
* "terms_version": null,
|
|
39879
|
+
* "document_family": "declaracion_responsabilidad",
|
|
39880
|
+
* "rendered_at": "2026-11-19T15:10:00.000Z",
|
|
39881
|
+
* "rendered_by": "11111111-0000-4000-8000-000000000001",
|
|
39882
|
+
* "supersedes_id": null
|
|
39883
|
+
* },
|
|
39884
|
+
* "frozen": true,
|
|
39885
|
+
* "already_issued": true,
|
|
39886
|
+
* "template_version": "declaracion-de-responsabilidad-v1"
|
|
39887
|
+
* }
|
|
39888
|
+
* }
|
|
39889
|
+
*/
|
|
39890
|
+
"application/json": {
|
|
39891
|
+
data: components["schemas"]["DeclaracionResponsabilidadIssuance"];
|
|
39892
|
+
};
|
|
39893
|
+
};
|
|
39894
|
+
};
|
|
39895
|
+
/** @description The newly issued artefact */
|
|
39896
|
+
201: {
|
|
39897
|
+
headers: {
|
|
39898
|
+
[name: string]: unknown;
|
|
39899
|
+
};
|
|
39900
|
+
content: {
|
|
39901
|
+
/**
|
|
39902
|
+
* @example {
|
|
39903
|
+
* "data": {
|
|
39904
|
+
* "document": {
|
|
39905
|
+
* "id": "d5d5d5d5-0000-4000-8000-000000000002",
|
|
39906
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39907
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39908
|
+
* "purchase_note_id": null,
|
|
39909
|
+
* "consignment_contract_id": null,
|
|
39910
|
+
* "clinic_consent_id": null,
|
|
39911
|
+
* "storage_bucket": "rendered-documents",
|
|
39912
|
+
* "storage_key": "tenants/a1a1a1a1-0000-4000-8000-000000000001/documents/sale_note/d4d4d4d4-0000-4000-8000-000000000001/d5d5d5d5-0000-4000-8000-000000000002.pdf",
|
|
39913
|
+
* "mime": "application/pdf",
|
|
39914
|
+
* "byte_size": 31877,
|
|
39915
|
+
* "sha256": "4be1c0d2a3f4e5d6c7b8a9f0e1d2c3b4a5f6e7d8c9b0a1f2e3d4c5b6a7f8e9d0",
|
|
39916
|
+
* "template_version": "declaracion-de-responsabilidad-v1",
|
|
39917
|
+
* "deed_version": null,
|
|
39918
|
+
* "fee_schedule_version": null,
|
|
39919
|
+
* "terms_version": null,
|
|
39920
|
+
* "document_family": "declaracion_responsabilidad",
|
|
39921
|
+
* "rendered_at": "2026-11-19T15:10:00.000Z",
|
|
39922
|
+
* "rendered_by": "11111111-0000-4000-8000-000000000001",
|
|
39923
|
+
* "supersedes_id": null
|
|
39924
|
+
* },
|
|
39925
|
+
* "frozen": false,
|
|
39926
|
+
* "already_issued": false,
|
|
39927
|
+
* "template_version": "declaracion-de-responsabilidad-v1"
|
|
39928
|
+
* }
|
|
39929
|
+
* }
|
|
39930
|
+
*/
|
|
39931
|
+
"application/json": {
|
|
39932
|
+
data: components["schemas"]["DeclaracionResponsabilidadIssuance"];
|
|
39933
|
+
};
|
|
39934
|
+
};
|
|
39935
|
+
};
|
|
39936
|
+
/** @description Validation error */
|
|
39937
|
+
400: {
|
|
39938
|
+
headers: {
|
|
39939
|
+
[name: string]: unknown;
|
|
39940
|
+
};
|
|
39941
|
+
content: {
|
|
39942
|
+
"application/json": components["schemas"]["Error"];
|
|
39943
|
+
};
|
|
39944
|
+
};
|
|
39945
|
+
/** @description Unauthorized */
|
|
39946
|
+
401: {
|
|
39947
|
+
headers: {
|
|
39948
|
+
[name: string]: unknown;
|
|
39949
|
+
};
|
|
39950
|
+
content: {
|
|
39951
|
+
"application/json": components["schemas"]["Error"];
|
|
39952
|
+
};
|
|
39953
|
+
};
|
|
39954
|
+
/** @description Forbidden */
|
|
39955
|
+
403: {
|
|
39956
|
+
headers: {
|
|
39957
|
+
[name: string]: unknown;
|
|
39958
|
+
};
|
|
39959
|
+
content: {
|
|
39960
|
+
"application/json": components["schemas"]["Error"];
|
|
39961
|
+
};
|
|
39962
|
+
};
|
|
39963
|
+
/** @description Not found */
|
|
39964
|
+
404: {
|
|
39965
|
+
headers: {
|
|
39966
|
+
[name: string]: unknown;
|
|
39967
|
+
};
|
|
39968
|
+
content: {
|
|
39969
|
+
"application/json": components["schemas"]["Error"];
|
|
39970
|
+
};
|
|
39971
|
+
};
|
|
39972
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
39973
|
+
409: {
|
|
39974
|
+
headers: {
|
|
39975
|
+
[name: string]: unknown;
|
|
39976
|
+
};
|
|
39977
|
+
content: {
|
|
39978
|
+
"application/json": components["schemas"]["Error"];
|
|
39979
|
+
};
|
|
39980
|
+
};
|
|
39981
|
+
/** @description Rate limited */
|
|
39982
|
+
429: {
|
|
39983
|
+
headers: {
|
|
39984
|
+
[name: string]: unknown;
|
|
39985
|
+
};
|
|
39986
|
+
content: {
|
|
39987
|
+
"application/json": components["schemas"]["Error"];
|
|
39988
|
+
};
|
|
39989
|
+
};
|
|
39990
|
+
};
|
|
39991
|
+
};
|
|
39992
|
+
delete?: never;
|
|
39993
|
+
options?: never;
|
|
39994
|
+
head?: never;
|
|
39995
|
+
patch?: never;
|
|
39996
|
+
trace?: never;
|
|
39997
|
+
};
|
|
39998
|
+
"/sale-notes/{id}/declaracion-responsabilidad/pdf": {
|
|
39999
|
+
parameters: {
|
|
40000
|
+
query?: never;
|
|
40001
|
+
header?: never;
|
|
40002
|
+
path?: never;
|
|
40003
|
+
cookie?: never;
|
|
40004
|
+
};
|
|
40005
|
+
/**
|
|
40006
|
+
* Download the declaración de responsabilidad
|
|
40007
|
+
* @description The **stored bytes** of the current declaración, as `application/pdf` (inline), with its `sha256` re-verified against the row; it never re-renders. The `X-Template-Version` header names the words it carries. A voided note still serves the declaración it printed before the void. A **404** when none was printed yet — call `POST /sale-notes/{id}/declaracion-responsabilidad` first.
|
|
40008
|
+
*/
|
|
40009
|
+
get: {
|
|
40010
|
+
parameters: {
|
|
40011
|
+
query?: never;
|
|
40012
|
+
header?: never;
|
|
40013
|
+
path: {
|
|
40014
|
+
id: string;
|
|
40015
|
+
};
|
|
40016
|
+
cookie?: never;
|
|
40017
|
+
};
|
|
40018
|
+
requestBody?: never;
|
|
40019
|
+
responses: {
|
|
40020
|
+
/** @description The declaración, as stored */
|
|
40021
|
+
200: {
|
|
40022
|
+
headers: {
|
|
40023
|
+
[name: string]: unknown;
|
|
40024
|
+
};
|
|
40025
|
+
content: {
|
|
40026
|
+
"application/pdf": string;
|
|
40027
|
+
};
|
|
40028
|
+
};
|
|
40029
|
+
/** @description Validation error */
|
|
40030
|
+
400: {
|
|
40031
|
+
headers: {
|
|
40032
|
+
[name: string]: unknown;
|
|
40033
|
+
};
|
|
40034
|
+
content: {
|
|
40035
|
+
"application/json": components["schemas"]["Error"];
|
|
40036
|
+
};
|
|
40037
|
+
};
|
|
40038
|
+
/** @description Unauthorized */
|
|
40039
|
+
401: {
|
|
40040
|
+
headers: {
|
|
40041
|
+
[name: string]: unknown;
|
|
40042
|
+
};
|
|
40043
|
+
content: {
|
|
40044
|
+
"application/json": components["schemas"]["Error"];
|
|
40045
|
+
};
|
|
40046
|
+
};
|
|
40047
|
+
/** @description Forbidden */
|
|
40048
|
+
403: {
|
|
40049
|
+
headers: {
|
|
40050
|
+
[name: string]: unknown;
|
|
40051
|
+
};
|
|
40052
|
+
content: {
|
|
40053
|
+
"application/json": components["schemas"]["Error"];
|
|
40054
|
+
};
|
|
40055
|
+
};
|
|
40056
|
+
/** @description Not found */
|
|
40057
|
+
404: {
|
|
40058
|
+
headers: {
|
|
40059
|
+
[name: string]: unknown;
|
|
40060
|
+
};
|
|
40061
|
+
content: {
|
|
40062
|
+
"application/json": components["schemas"]["Error"];
|
|
40063
|
+
};
|
|
40064
|
+
};
|
|
40065
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
40066
|
+
409: {
|
|
40067
|
+
headers: {
|
|
40068
|
+
[name: string]: unknown;
|
|
40069
|
+
};
|
|
40070
|
+
content: {
|
|
40071
|
+
"application/json": components["schemas"]["Error"];
|
|
40072
|
+
};
|
|
40073
|
+
};
|
|
40074
|
+
/** @description Rate limited */
|
|
40075
|
+
429: {
|
|
40076
|
+
headers: {
|
|
40077
|
+
[name: string]: unknown;
|
|
40078
|
+
};
|
|
40079
|
+
content: {
|
|
40080
|
+
"application/json": components["schemas"]["Error"];
|
|
40081
|
+
};
|
|
40082
|
+
};
|
|
40083
|
+
};
|
|
40084
|
+
};
|
|
40085
|
+
put?: never;
|
|
40086
|
+
post?: never;
|
|
40087
|
+
delete?: never;
|
|
40088
|
+
options?: never;
|
|
40089
|
+
head?: never;
|
|
40090
|
+
patch?: never;
|
|
40091
|
+
trace?: never;
|
|
40092
|
+
};
|
|
39812
40093
|
"/sale-notes/{id}/registered-owner": {
|
|
39813
40094
|
parameters: {
|
|
39814
40095
|
query?: never;
|
|
@@ -316785,6 +317066,7 @@ interface paths {
|
|
|
316785
317066
|
* "vendor_active": true,
|
|
316786
317067
|
* "active": true,
|
|
316787
317068
|
* "agent_bookable": true,
|
|
317069
|
+
* "is_evaluation": true,
|
|
316788
317070
|
* "color": "#cccccc",
|
|
316789
317071
|
* "agenda_online": false,
|
|
316790
317072
|
* "overrides": [
|
|
@@ -316908,6 +317190,8 @@ interface paths {
|
|
|
316908
317190
|
duration_minutes?: number | null;
|
|
316909
317191
|
active?: boolean;
|
|
316910
317192
|
agent_bookable?: boolean;
|
|
317193
|
+
/** @description Is this motivo the evaluation visit? Absent = seeded from the name («Evaluación», «Diagnóstico», «Primera consulta»…). */
|
|
317194
|
+
is_evaluation?: boolean;
|
|
316911
317195
|
professionals?: {
|
|
316912
317196
|
/** Format: uuid */
|
|
316913
317197
|
professional_id: string;
|
|
@@ -316937,6 +317221,7 @@ interface paths {
|
|
|
316937
317221
|
* "vendor_active": true,
|
|
316938
317222
|
* "active": true,
|
|
316939
317223
|
* "agent_bookable": true,
|
|
317224
|
+
* "is_evaluation": true,
|
|
316940
317225
|
* "color": "#cccccc",
|
|
316941
317226
|
* "agenda_online": false,
|
|
316942
317227
|
* "overrides": [],
|
|
@@ -317322,6 +317607,8 @@ interface paths {
|
|
|
317322
317607
|
duration_minutes?: number;
|
|
317323
317608
|
active?: boolean;
|
|
317324
317609
|
agent_bookable?: boolean;
|
|
317610
|
+
/** @description Mark or unmark this motivo as the evaluation visit (mirrored and native motivos alike; never an override, a resync keeps it). */
|
|
317611
|
+
is_evaluation?: boolean;
|
|
317325
317612
|
reset?: ("duration_minutes" | "active" | "professionals")[];
|
|
317326
317613
|
};
|
|
317327
317614
|
};
|
|
@@ -317347,6 +317634,7 @@ interface paths {
|
|
|
317347
317634
|
* "vendor_active": true,
|
|
317348
317635
|
* "active": true,
|
|
317349
317636
|
* "agent_bookable": true,
|
|
317637
|
+
* "is_evaluation": true,
|
|
317350
317638
|
* "color": "#cccccc",
|
|
317351
317639
|
* "agenda_online": false,
|
|
317352
317640
|
* "overrides": [
|
|
@@ -317491,6 +317779,7 @@ interface paths {
|
|
|
317491
317779
|
* "vendor_active": true,
|
|
317492
317780
|
* "active": true,
|
|
317493
317781
|
* "agent_bookable": true,
|
|
317782
|
+
* "is_evaluation": true,
|
|
317494
317783
|
* "color": "#cccccc",
|
|
317495
317784
|
* "agenda_online": false,
|
|
317496
317785
|
* "overrides": [
|
|
@@ -317630,6 +317919,7 @@ interface paths {
|
|
|
317630
317919
|
* "vendor_active": true,
|
|
317631
317920
|
* "active": true,
|
|
317632
317921
|
* "agent_bookable": true,
|
|
317922
|
+
* "is_evaluation": true,
|
|
317633
317923
|
* "color": "#cccccc",
|
|
317634
317924
|
* "agenda_online": false,
|
|
317635
317925
|
* "overrides": [],
|
|
@@ -317788,6 +318078,7 @@ interface paths {
|
|
|
317788
318078
|
* "vendor_active": true,
|
|
317789
318079
|
* "active": true,
|
|
317790
318080
|
* "agent_bookable": true,
|
|
318081
|
+
* "is_evaluation": true,
|
|
317791
318082
|
* "color": "#cccccc",
|
|
317792
318083
|
* "agenda_online": false,
|
|
317793
318084
|
* "overrides": [],
|
|
@@ -317940,6 +318231,7 @@ interface paths {
|
|
|
317940
318231
|
* "vendor_active": true,
|
|
317941
318232
|
* "active": true,
|
|
317942
318233
|
* "agent_bookable": true,
|
|
318234
|
+
* "is_evaluation": true,
|
|
317943
318235
|
* "color": "#cccccc",
|
|
317944
318236
|
* "agenda_online": false,
|
|
317945
318237
|
* "overrides": [],
|
|
@@ -322501,6 +322793,7 @@ interface components {
|
|
|
322501
322793
|
byte_size: number;
|
|
322502
322794
|
sha256: string;
|
|
322503
322795
|
template_version: string | null;
|
|
322796
|
+
document_family?: string | null;
|
|
322504
322797
|
rendered_at: string;
|
|
322505
322798
|
rendered_by: string | null;
|
|
322506
322799
|
/** Format: uuid */
|
|
@@ -322548,6 +322841,12 @@ interface components {
|
|
|
322548
322841
|
message: string;
|
|
322549
322842
|
} | null;
|
|
322550
322843
|
};
|
|
322844
|
+
DeclaracionResponsabilidadIssuance: {
|
|
322845
|
+
document: components["schemas"]["CompraventaArtefact"];
|
|
322846
|
+
frozen: boolean;
|
|
322847
|
+
already_issued: boolean;
|
|
322848
|
+
template_version: string;
|
|
322849
|
+
};
|
|
322551
322850
|
SaleNoteCorrection: {
|
|
322552
322851
|
/** @enum {string} */
|
|
322553
322852
|
outcome: "applied" | "pending_approval" | "unchanged";
|
|
@@ -339685,6 +339984,8 @@ interface components {
|
|
|
339685
339984
|
vendor_active: boolean;
|
|
339686
339985
|
active: boolean;
|
|
339687
339986
|
agent_bookable: boolean;
|
|
339987
|
+
/** @description Vitrina's own answer: this motivo is the evaluation visit (where a plan is diagnosed and quoted). Seeded from the name when the motivo is created or first synced, editable, never overwritten by a resync. The AI agent never books a second live evaluation for the same patient. */
|
|
339988
|
+
is_evaluation: boolean;
|
|
339688
339989
|
color: string | null;
|
|
339689
339990
|
agenda_online: boolean | null;
|
|
339690
339991
|
overrides: ("duration_minutes" | "active" | "professionals")[];
|
package/package.json
CHANGED