@vitrina/api 17.83.1 → 17.85.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 +358 -18
- package/dist/index.d.ts +358 -18
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -43804,6 +43804,9 @@ interface paths {
|
|
|
43804
43804
|
* "tax_treatment": "no_gravado",
|
|
43805
43805
|
* "status": "issued",
|
|
43806
43806
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
43807
|
+
* "notes": null,
|
|
43808
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
43809
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
43807
43810
|
* "corrected_at": null,
|
|
43808
43811
|
* "corrected_by": null,
|
|
43809
43812
|
* "voided_at": null,
|
|
@@ -43887,11 +43890,15 @@ interface paths {
|
|
|
43887
43890
|
* Issue a nota de compra
|
|
43888
43891
|
* @description Issues the document and allocates its folio (`P-1`, `P-2`, …) inside the inserting transaction, so a failed issue RELEASES the number rather than burning it out of a legally accountable series.
|
|
43889
43892
|
*
|
|
43890
|
-
* **
|
|
43893
|
+
* **The Veekls-shape form (app#7721, ADR 0162): a car and a price are enough.** `{ net_clp, acquisition: { vehicle_id } }` issues the note and records the car's Costo de compra. Nothing about tax is required: `tax_treatment` defaults to the car's own IVA setting (`exento` with no car), and the acquisition's `acquired_on` (the note's day), `tax_treatment`, `borne_by` (`automotora`) and `generates_fiscal_credit` (false) are filled by the server. `invoice_includes_iva: true` is the «Compra con factura (incluye IVA)» tick: `net_clp` then includes IVA, the note stores it without IVA plus the IVA apart (`afecto`), and the car's cost carries the same split with fiscal credit; it wins over every stated tax field. «Descuentos» are `acquisition.retentions[]` as `{ description, net_clp }`: without `category_id` the line is filed under the workspace's «Descuentos de compra» cost category (created on first use), `tax_treatment` defaults to `no_gravado`. Total a pagar = `net_clp` (+ `tax_clp` under the tick) minus the Descuentos; Descuentos above the price are a **400** with `error.details.code` `discounts_exceed_price`. `forma_de_pago` (one line) and `observaciones` are free text that print; `notes` stays internal. Requests in the older shape (header `tax_treatment`, a full acquisition block, retention categories) keep working.
|
|
43894
|
+
*
|
|
43895
|
+
* **Refusals the form branches on** (`error.details.code`, 409): `vehicle_has_documented_cost` (the car already has a cost from another document; `details` names it: `purchase_note_id`, `sale_note_id` or `consignment_contract_id`) and `vehicle_sold_by_other_seller` (a live nota de venta names another seller; `details.sale_note_id`, `details.sale_note_display_id`). A car with a typed (bare) Costo de compra is NOT refused: the note takes that cost over.
|
|
43896
|
+
*
|
|
43897
|
+
* **Money is whole CLP pesos** (`bigint`, never minor units, never decimals) and the triple is `net_clp` + `tax_clp` + `tax_treatment`, on the header AND again per line. Omit `tax_clp` to record "not recorded"; pass `0` to record "no tax" — ADR 0058 §2 makes those two different claims and nothing collapses them. A LINE still states its `tax_treatment`.
|
|
43891
43898
|
*
|
|
43892
43899
|
* **`lines` are `document_line` rows**, written in the SAME transaction as the document, so a folio is never spent on a document whose breakdown never arrived. The array order IS the document order; positions are assigned by the database and cannot be supplied. Omit `lines` for a document with a header amount and no breakdown, which is complete and ordinary. Whether the lines add up to the header is deliberately NOT enforced.
|
|
43893
43900
|
*
|
|
43894
|
-
*
|
|
43901
|
+
* `acquisition` attaches the car in the same transaction; without it the document is issued alone, and a unit can be attached later on `/vehicle-acquisitions` (one nota de compra may acquire several units).
|
|
43895
43902
|
*
|
|
43896
43903
|
* `seller_contact_id` must belong to the calling workspace; a foreign id and a nonexistent one answer identically (404), deliberately, because a difference between them is an existence oracle. Unknown body keys are a **400** — `tax` is one character from `tax_clp`, and silently discarding it would record "no IVA was entered" for a caller who entered it. Answers 201.
|
|
43897
43904
|
*/
|
|
@@ -43911,26 +43918,40 @@ interface paths {
|
|
|
43911
43918
|
* @example {
|
|
43912
43919
|
* "seller_contact_id": "22222222-0000-4000-8000-000000000003",
|
|
43913
43920
|
* "net_clp": 6200000,
|
|
43914
|
-
* "
|
|
43915
|
-
* "
|
|
43916
|
-
*
|
|
43917
|
-
*
|
|
43918
|
-
*
|
|
43919
|
-
*
|
|
43920
|
-
*
|
|
43921
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
43922
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
43923
|
+
* "acquisition": {
|
|
43924
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
43925
|
+
* "retentions": [
|
|
43926
|
+
* {
|
|
43927
|
+
* "description": "Multas",
|
|
43928
|
+
* "net_clp": 180000
|
|
43929
|
+
* }
|
|
43930
|
+
* ]
|
|
43931
|
+
* }
|
|
43921
43932
|
* }
|
|
43922
43933
|
*/
|
|
43923
43934
|
"application/json": {
|
|
43924
43935
|
/** Format: uuid */
|
|
43925
43936
|
seller_contact_id?: string | null;
|
|
43937
|
+
/** @description Precio de compra en pesos. Con `invoice_includes_iva: true` es el monto escrito con IVA incluido: se guarda sin IVA en `net_clp` y el IVA en `tax_clp`. */
|
|
43926
43938
|
net_clp: number;
|
|
43927
43939
|
tax_clp?: number | null;
|
|
43928
|
-
/**
|
|
43929
|
-
|
|
43940
|
+
/**
|
|
43941
|
+
* @description Opcional. Por defecto `afecto` con `invoice_includes_iva`; si no, el régimen de IVA del auto de `acquisition` (el del auto, si no el de la automotora, si no exento); sin auto, exento.
|
|
43942
|
+
* @enum {string}
|
|
43943
|
+
*/
|
|
43944
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
43945
|
+
/** @description «Compra con factura (incluye IVA)». Opcional, por defecto false. Con true `net_clp` incluye IVA: la nota guarda el precio sin IVA y el IVA aparte, queda afecta, y el costo de compra del auto queda sin IVA y con crédito fiscal. Manda sobre `tax_clp`, `tax_treatment` y los campos de impuesto de `acquisition`. */
|
|
43946
|
+
invoice_includes_iva?: boolean;
|
|
43930
43947
|
/** Format: date-time */
|
|
43931
43948
|
issued_at?: string | null;
|
|
43932
43949
|
/** @description Internal free-text notes. Never printed on the document. Blank clears them. */
|
|
43933
43950
|
notes?: string | null;
|
|
43951
|
+
/** @description «Forma de pago», una línea libre que se imprime en la nota de compra (hasta 500 caracteres). Vacío o null la borra. */
|
|
43952
|
+
forma_de_pago?: string | null;
|
|
43953
|
+
/** @description Observaciones que se imprimen en la nota de compra (hasta 2000 caracteres). Vacío o null las borra. No son las notas internas (`notes`). */
|
|
43954
|
+
observaciones?: string | null;
|
|
43934
43955
|
lines?: {
|
|
43935
43956
|
description: string;
|
|
43936
43957
|
net_clp: number;
|
|
@@ -43941,20 +43962,22 @@ interface paths {
|
|
|
43941
43962
|
acquisition?: {
|
|
43942
43963
|
/** Format: uuid */
|
|
43943
43964
|
vehicle_id: string;
|
|
43944
|
-
acquired_on
|
|
43965
|
+
acquired_on?: string;
|
|
43945
43966
|
tax_clp?: number | null;
|
|
43946
43967
|
/** @enum {string} */
|
|
43947
|
-
tax_treatment
|
|
43968
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
43948
43969
|
/** @enum {string} */
|
|
43949
|
-
borne_by
|
|
43950
|
-
generates_fiscal_credit
|
|
43970
|
+
borne_by?: "automotora" | "cliente";
|
|
43971
|
+
generates_fiscal_credit?: boolean;
|
|
43951
43972
|
retentions?: {
|
|
43973
|
+
/** @description Qué se descuenta («Multas», «Prenda», «Permiso de circulación»), hasta 200 caracteres. Se imprime en la nota de compra. */
|
|
43974
|
+
description?: string | null;
|
|
43952
43975
|
/** Format: uuid */
|
|
43953
|
-
category_id
|
|
43976
|
+
category_id?: string;
|
|
43954
43977
|
net_clp: number;
|
|
43955
43978
|
tax_clp?: number | null;
|
|
43956
43979
|
/** @enum {string} */
|
|
43957
|
-
tax_treatment
|
|
43980
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
43958
43981
|
incurred_on?: string | null;
|
|
43959
43982
|
/** Format: uuid */
|
|
43960
43983
|
supplier_contact_id?: string | null;
|
|
@@ -43984,6 +44007,9 @@ interface paths {
|
|
|
43984
44007
|
* "tax_treatment": "no_gravado",
|
|
43985
44008
|
* "status": "issued",
|
|
43986
44009
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
44010
|
+
* "notes": null,
|
|
44011
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
44012
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
43987
44013
|
* "corrected_at": null,
|
|
43988
44014
|
* "corrected_by": null,
|
|
43989
44015
|
* "voided_at": null,
|
|
@@ -44108,6 +44134,9 @@ interface paths {
|
|
|
44108
44134
|
* "tax_treatment": "no_gravado",
|
|
44109
44135
|
* "status": "issued",
|
|
44110
44136
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
44137
|
+
* "notes": null,
|
|
44138
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
44139
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
44111
44140
|
* "corrected_at": null,
|
|
44112
44141
|
* "corrected_by": null,
|
|
44113
44142
|
* "voided_at": null,
|
|
@@ -44224,6 +44253,10 @@ interface paths {
|
|
|
44224
44253
|
* }
|
|
44225
44254
|
*/
|
|
44226
44255
|
"application/json": {
|
|
44256
|
+
/** @description «Forma de pago», una línea libre que se imprime en la nota de compra (hasta 500 caracteres). Vacío o null la borra. */
|
|
44257
|
+
forma_de_pago?: string | null;
|
|
44258
|
+
/** @description Observaciones que se imprimen en la nota de compra (hasta 2000 caracteres). Vacío o null las borra. No son las notas internas (`notes`). */
|
|
44259
|
+
observaciones?: string | null;
|
|
44227
44260
|
/** Format: uuid */
|
|
44228
44261
|
seller_contact_id?: string | null;
|
|
44229
44262
|
net_clp?: number;
|
|
@@ -44264,6 +44297,9 @@ interface paths {
|
|
|
44264
44297
|
* "tax_treatment": "no_gravado",
|
|
44265
44298
|
* "status": "issued",
|
|
44266
44299
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
44300
|
+
* "notes": null,
|
|
44301
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
44302
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
44267
44303
|
* "corrected_at": "2026-09-13T09:00:00.000Z",
|
|
44268
44304
|
* "corrected_by": "11111111-0000-4000-8000-000000000001",
|
|
44269
44305
|
* "voided_at": null,
|
|
@@ -44498,6 +44534,9 @@ interface paths {
|
|
|
44498
44534
|
* "tax_treatment": "no_gravado",
|
|
44499
44535
|
* "status": "voided",
|
|
44500
44536
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
44537
|
+
* "notes": null,
|
|
44538
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
44539
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
44501
44540
|
* "corrected_at": null,
|
|
44502
44541
|
* "corrected_by": null,
|
|
44503
44542
|
* "voided_at": "2026-09-14T11:30:00.000Z",
|
|
@@ -50199,7 +50238,121 @@ interface paths {
|
|
|
50199
50238
|
path?: never;
|
|
50200
50239
|
cookie?: never;
|
|
50201
50240
|
};
|
|
50202
|
-
|
|
50241
|
+
/**
|
|
50242
|
+
* The acquisition record for a vehicle
|
|
50243
|
+
* @description How one car arrived and what it cost (its Costo de compra). Needs `dealership_economics:read`. `vehicle_id` is required (no whole-lot cost dump). An empty array, not a 404, when no acquisition has been recorded yet; a car removed from Stock answers the same empty array. The cost editor prefills its amount from `amount_paid_clp` and its «Compra con factura (incluye IVA)» tick from `invoice_includes_iva` (vitrina-app#7719); a correction is `POST /vehicle-acquisitions`.
|
|
50244
|
+
*/
|
|
50245
|
+
get: {
|
|
50246
|
+
parameters: {
|
|
50247
|
+
query: {
|
|
50248
|
+
vehicle_id: string;
|
|
50249
|
+
};
|
|
50250
|
+
header?: never;
|
|
50251
|
+
path?: never;
|
|
50252
|
+
cookie?: never;
|
|
50253
|
+
};
|
|
50254
|
+
requestBody?: never;
|
|
50255
|
+
responses: {
|
|
50256
|
+
/** @description The acquisition of the car: a list of at most one row. */
|
|
50257
|
+
200: {
|
|
50258
|
+
headers: {
|
|
50259
|
+
[name: string]: unknown;
|
|
50260
|
+
};
|
|
50261
|
+
content: {
|
|
50262
|
+
/**
|
|
50263
|
+
* @example {
|
|
50264
|
+
* "data": [
|
|
50265
|
+
* {
|
|
50266
|
+
* "id": "b5f0d6c2-1e8a-4c3b-9f7d-2a6e4b8c0d11",
|
|
50267
|
+
* "tenant_id": "a3c9e1f0-7b2d-4e5a-8c6f-1d0b9e2a4f73",
|
|
50268
|
+
* "vehicle_id": "7c1e2a40-5b7d-4f0e-9a51-3d2f8e6b1c90",
|
|
50269
|
+
* "kind": "compra",
|
|
50270
|
+
* "counterparty_contact_id": null,
|
|
50271
|
+
* "acquired_on": "2026-08-03",
|
|
50272
|
+
* "purchase_note_id": null,
|
|
50273
|
+
* "consignment_contract_id": null,
|
|
50274
|
+
* "sale_note_id": null,
|
|
50275
|
+
* "net_clp": 8500000,
|
|
50276
|
+
* "tax_clp": null,
|
|
50277
|
+
* "tax_treatment": "exento",
|
|
50278
|
+
* "borne_by": "automotora",
|
|
50279
|
+
* "generates_fiscal_credit": false,
|
|
50280
|
+
* "created_at": "2026-11-19T15:02:00.000Z",
|
|
50281
|
+
* "updated_at": "2026-11-19T15:02:00.000Z",
|
|
50282
|
+
* "derived_tenencia": "propio",
|
|
50283
|
+
* "invoice_includes_iva": false,
|
|
50284
|
+
* "amount_paid_clp": 8500000
|
|
50285
|
+
* }
|
|
50286
|
+
* ],
|
|
50287
|
+
* "meta": {
|
|
50288
|
+
* "total": 1
|
|
50289
|
+
* }
|
|
50290
|
+
* }
|
|
50291
|
+
*/
|
|
50292
|
+
"application/json": {
|
|
50293
|
+
data: components["schemas"]["VehicleAcquisition"][];
|
|
50294
|
+
meta?: {
|
|
50295
|
+
[key: string]: unknown;
|
|
50296
|
+
};
|
|
50297
|
+
};
|
|
50298
|
+
};
|
|
50299
|
+
};
|
|
50300
|
+
/** @description Validation error */
|
|
50301
|
+
400: {
|
|
50302
|
+
headers: {
|
|
50303
|
+
[name: string]: unknown;
|
|
50304
|
+
};
|
|
50305
|
+
content: {
|
|
50306
|
+
"application/json": components["schemas"]["Error"];
|
|
50307
|
+
};
|
|
50308
|
+
};
|
|
50309
|
+
/** @description Unauthorized */
|
|
50310
|
+
401: {
|
|
50311
|
+
headers: {
|
|
50312
|
+
[name: string]: unknown;
|
|
50313
|
+
};
|
|
50314
|
+
content: {
|
|
50315
|
+
"application/json": components["schemas"]["Error"];
|
|
50316
|
+
};
|
|
50317
|
+
};
|
|
50318
|
+
/** @description Forbidden */
|
|
50319
|
+
403: {
|
|
50320
|
+
headers: {
|
|
50321
|
+
[name: string]: unknown;
|
|
50322
|
+
};
|
|
50323
|
+
content: {
|
|
50324
|
+
"application/json": components["schemas"]["Error"];
|
|
50325
|
+
};
|
|
50326
|
+
};
|
|
50327
|
+
/** @description Not found */
|
|
50328
|
+
404: {
|
|
50329
|
+
headers: {
|
|
50330
|
+
[name: string]: unknown;
|
|
50331
|
+
};
|
|
50332
|
+
content: {
|
|
50333
|
+
"application/json": components["schemas"]["Error"];
|
|
50334
|
+
};
|
|
50335
|
+
};
|
|
50336
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
50337
|
+
409: {
|
|
50338
|
+
headers: {
|
|
50339
|
+
[name: string]: unknown;
|
|
50340
|
+
};
|
|
50341
|
+
content: {
|
|
50342
|
+
"application/json": components["schemas"]["Error"];
|
|
50343
|
+
};
|
|
50344
|
+
};
|
|
50345
|
+
/** @description Rate limited */
|
|
50346
|
+
429: {
|
|
50347
|
+
headers: {
|
|
50348
|
+
[name: string]: unknown;
|
|
50349
|
+
};
|
|
50350
|
+
content: {
|
|
50351
|
+
"application/json": components["schemas"]["Error"];
|
|
50352
|
+
};
|
|
50353
|
+
};
|
|
50354
|
+
};
|
|
50355
|
+
};
|
|
50203
50356
|
put?: never;
|
|
50204
50357
|
/**
|
|
50205
50358
|
* Record how a unit arrived, or its bare Costo de compra
|
|
@@ -50397,6 +50550,131 @@ interface paths {
|
|
|
50397
50550
|
patch?: never;
|
|
50398
50551
|
trace?: never;
|
|
50399
50552
|
};
|
|
50553
|
+
"/vehicle-acquisitions/{id}": {
|
|
50554
|
+
parameters: {
|
|
50555
|
+
query?: never;
|
|
50556
|
+
header?: never;
|
|
50557
|
+
path?: never;
|
|
50558
|
+
cookie?: never;
|
|
50559
|
+
};
|
|
50560
|
+
/**
|
|
50561
|
+
* Fetch one acquisition record
|
|
50562
|
+
* @description One acquisition by its id, in the same shape as the list read. Needs `dealership_economics:read`. 404 for an id of another workspace or none at all.
|
|
50563
|
+
*/
|
|
50564
|
+
get: {
|
|
50565
|
+
parameters: {
|
|
50566
|
+
query?: never;
|
|
50567
|
+
header?: never;
|
|
50568
|
+
path: {
|
|
50569
|
+
id: string;
|
|
50570
|
+
};
|
|
50571
|
+
cookie?: never;
|
|
50572
|
+
};
|
|
50573
|
+
requestBody?: never;
|
|
50574
|
+
responses: {
|
|
50575
|
+
/** @description The acquisition record */
|
|
50576
|
+
200: {
|
|
50577
|
+
headers: {
|
|
50578
|
+
[name: string]: unknown;
|
|
50579
|
+
};
|
|
50580
|
+
content: {
|
|
50581
|
+
/**
|
|
50582
|
+
* @example {
|
|
50583
|
+
* "data": {
|
|
50584
|
+
* "id": "b5f0d6c2-1e8a-4c3b-9f7d-2a6e4b8c0d11",
|
|
50585
|
+
* "tenant_id": "a3c9e1f0-7b2d-4e5a-8c6f-1d0b9e2a4f73",
|
|
50586
|
+
* "vehicle_id": "7c1e2a40-5b7d-4f0e-9a51-3d2f8e6b1c90",
|
|
50587
|
+
* "kind": "compra",
|
|
50588
|
+
* "counterparty_contact_id": null,
|
|
50589
|
+
* "acquired_on": "2026-08-03",
|
|
50590
|
+
* "purchase_note_id": null,
|
|
50591
|
+
* "consignment_contract_id": null,
|
|
50592
|
+
* "sale_note_id": null,
|
|
50593
|
+
* "net_clp": 8500000,
|
|
50594
|
+
* "tax_clp": null,
|
|
50595
|
+
* "tax_treatment": "exento",
|
|
50596
|
+
* "borne_by": "automotora",
|
|
50597
|
+
* "generates_fiscal_credit": false,
|
|
50598
|
+
* "created_at": "2026-11-19T15:02:00.000Z",
|
|
50599
|
+
* "updated_at": "2026-11-19T15:02:00.000Z",
|
|
50600
|
+
* "derived_tenencia": "propio",
|
|
50601
|
+
* "invoice_includes_iva": false,
|
|
50602
|
+
* "amount_paid_clp": 8500000
|
|
50603
|
+
* }
|
|
50604
|
+
* }
|
|
50605
|
+
*/
|
|
50606
|
+
"application/json": {
|
|
50607
|
+
data: components["schemas"]["VehicleAcquisition"];
|
|
50608
|
+
meta?: {
|
|
50609
|
+
[key: string]: unknown;
|
|
50610
|
+
};
|
|
50611
|
+
};
|
|
50612
|
+
};
|
|
50613
|
+
};
|
|
50614
|
+
/** @description Validation error */
|
|
50615
|
+
400: {
|
|
50616
|
+
headers: {
|
|
50617
|
+
[name: string]: unknown;
|
|
50618
|
+
};
|
|
50619
|
+
content: {
|
|
50620
|
+
"application/json": components["schemas"]["Error"];
|
|
50621
|
+
};
|
|
50622
|
+
};
|
|
50623
|
+
/** @description Unauthorized */
|
|
50624
|
+
401: {
|
|
50625
|
+
headers: {
|
|
50626
|
+
[name: string]: unknown;
|
|
50627
|
+
};
|
|
50628
|
+
content: {
|
|
50629
|
+
"application/json": components["schemas"]["Error"];
|
|
50630
|
+
};
|
|
50631
|
+
};
|
|
50632
|
+
/** @description Forbidden */
|
|
50633
|
+
403: {
|
|
50634
|
+
headers: {
|
|
50635
|
+
[name: string]: unknown;
|
|
50636
|
+
};
|
|
50637
|
+
content: {
|
|
50638
|
+
"application/json": components["schemas"]["Error"];
|
|
50639
|
+
};
|
|
50640
|
+
};
|
|
50641
|
+
/** @description Not found */
|
|
50642
|
+
404: {
|
|
50643
|
+
headers: {
|
|
50644
|
+
[name: string]: unknown;
|
|
50645
|
+
};
|
|
50646
|
+
content: {
|
|
50647
|
+
"application/json": components["schemas"]["Error"];
|
|
50648
|
+
};
|
|
50649
|
+
};
|
|
50650
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
50651
|
+
409: {
|
|
50652
|
+
headers: {
|
|
50653
|
+
[name: string]: unknown;
|
|
50654
|
+
};
|
|
50655
|
+
content: {
|
|
50656
|
+
"application/json": components["schemas"]["Error"];
|
|
50657
|
+
};
|
|
50658
|
+
};
|
|
50659
|
+
/** @description Rate limited */
|
|
50660
|
+
429: {
|
|
50661
|
+
headers: {
|
|
50662
|
+
[name: string]: unknown;
|
|
50663
|
+
};
|
|
50664
|
+
content: {
|
|
50665
|
+
"application/json": components["schemas"]["Error"];
|
|
50666
|
+
};
|
|
50667
|
+
};
|
|
50668
|
+
};
|
|
50669
|
+
};
|
|
50670
|
+
put?: never;
|
|
50671
|
+
post?: never;
|
|
50672
|
+
delete?: never;
|
|
50673
|
+
options?: never;
|
|
50674
|
+
head?: never;
|
|
50675
|
+
patch?: never;
|
|
50676
|
+
trace?: never;
|
|
50677
|
+
};
|
|
50400
50678
|
"/vehicles/kanban": {
|
|
50401
50679
|
parameters: {
|
|
50402
50680
|
query?: never;
|
|
@@ -323830,6 +324108,68 @@ interface components {
|
|
|
323830
324108
|
};
|
|
323831
324109
|
/** @example 2026-01 */
|
|
323832
324110
|
OverheadPeriod: string;
|
|
324111
|
+
VehicleAcquisition: {
|
|
324112
|
+
/** Format: uuid */
|
|
324113
|
+
id: string;
|
|
324114
|
+
/** Format: uuid */
|
|
324115
|
+
tenant_id: string;
|
|
324116
|
+
/**
|
|
324117
|
+
* Format: uuid
|
|
324118
|
+
* @description El auto.
|
|
324119
|
+
*/
|
|
324120
|
+
vehicle_id: string;
|
|
324121
|
+
/**
|
|
324122
|
+
* @description Cómo llegó el auto: compra (de la automotora), consignacion o retoma (parte de pago).
|
|
324123
|
+
* @enum {string}
|
|
324124
|
+
*/
|
|
324125
|
+
kind: "compra" | "consignacion" | "retoma";
|
|
324126
|
+
/**
|
|
324127
|
+
* Format: uuid
|
|
324128
|
+
* @description De quién llegó el auto (contacto). null = no registrado.
|
|
324129
|
+
*/
|
|
324130
|
+
counterparty_contact_id: string | null;
|
|
324131
|
+
/** @description Fecha de adquisición, YYYY-MM-DD. */
|
|
324132
|
+
acquired_on: string;
|
|
324133
|
+
/**
|
|
324134
|
+
* Format: uuid
|
|
324135
|
+
* @description La nota de compra de una compra. null en un costo de compra escrito a mano.
|
|
324136
|
+
*/
|
|
324137
|
+
purchase_note_id: string | null;
|
|
324138
|
+
/**
|
|
324139
|
+
* Format: uuid
|
|
324140
|
+
* @description El contrato de una consignación.
|
|
324141
|
+
*/
|
|
324142
|
+
consignment_contract_id: string | null;
|
|
324143
|
+
/**
|
|
324144
|
+
* Format: uuid
|
|
324145
|
+
* @description La nota de venta que recibió el auto en parte de pago (retoma).
|
|
324146
|
+
*/
|
|
324147
|
+
sale_note_id: string | null;
|
|
324148
|
+
/** @description Costo de compra en pesos, sin IVA cuando la compra fue con factura. */
|
|
324149
|
+
net_clp: number;
|
|
324150
|
+
/** @description IVA de la compra en pesos. null = no registrado; 0 = sin IVA. */
|
|
324151
|
+
tax_clp: number | null;
|
|
324152
|
+
/**
|
|
324153
|
+
* @description Tratamiento de IVA de la compra.
|
|
324154
|
+
* @enum {string}
|
|
324155
|
+
*/
|
|
324156
|
+
tax_treatment: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
324157
|
+
/**
|
|
324158
|
+
* @description Quién asume el costo (automotora o cliente).
|
|
324159
|
+
* @enum {string}
|
|
324160
|
+
*/
|
|
324161
|
+
borne_by: "automotora" | "cliente";
|
|
324162
|
+
/** @description La compra genera crédito fiscal (IVA recuperable). */
|
|
324163
|
+
generates_fiscal_credit: boolean;
|
|
324164
|
+
created_at: string;
|
|
324165
|
+
updated_at: string;
|
|
324166
|
+
/** @description La tenencia del auto (propio o consignacion) tal como quedó tras este registro. */
|
|
324167
|
+
derived_tenencia: string | null;
|
|
324168
|
+
/** @description «Compra con factura (incluye IVA)» tal como quedó registrada. Sirve para mostrar el tick al reabrir el costo. */
|
|
324169
|
+
invoice_includes_iva: boolean;
|
|
324170
|
+
/** @description El monto que escribió la automotora: net_clp más el IVA cuando la compra fue con factura, si no net_clp. Sirve para mostrar el monto al reabrir el costo. */
|
|
324171
|
+
amount_paid_clp: number;
|
|
324172
|
+
};
|
|
323833
324173
|
/** @description A Mercado Pago checkout payment: its payment id, a link to it and its status. Null for every other movement. */
|
|
323834
324174
|
GatewayPaymentRef: {
|
|
323835
324175
|
/** @enum {string} */
|
package/dist/index.d.ts
CHANGED
|
@@ -43804,6 +43804,9 @@ interface paths {
|
|
|
43804
43804
|
* "tax_treatment": "no_gravado",
|
|
43805
43805
|
* "status": "issued",
|
|
43806
43806
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
43807
|
+
* "notes": null,
|
|
43808
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
43809
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
43807
43810
|
* "corrected_at": null,
|
|
43808
43811
|
* "corrected_by": null,
|
|
43809
43812
|
* "voided_at": null,
|
|
@@ -43887,11 +43890,15 @@ interface paths {
|
|
|
43887
43890
|
* Issue a nota de compra
|
|
43888
43891
|
* @description Issues the document and allocates its folio (`P-1`, `P-2`, …) inside the inserting transaction, so a failed issue RELEASES the number rather than burning it out of a legally accountable series.
|
|
43889
43892
|
*
|
|
43890
|
-
* **
|
|
43893
|
+
* **The Veekls-shape form (app#7721, ADR 0162): a car and a price are enough.** `{ net_clp, acquisition: { vehicle_id } }` issues the note and records the car's Costo de compra. Nothing about tax is required: `tax_treatment` defaults to the car's own IVA setting (`exento` with no car), and the acquisition's `acquired_on` (the note's day), `tax_treatment`, `borne_by` (`automotora`) and `generates_fiscal_credit` (false) are filled by the server. `invoice_includes_iva: true` is the «Compra con factura (incluye IVA)» tick: `net_clp` then includes IVA, the note stores it without IVA plus the IVA apart (`afecto`), and the car's cost carries the same split with fiscal credit; it wins over every stated tax field. «Descuentos» are `acquisition.retentions[]` as `{ description, net_clp }`: without `category_id` the line is filed under the workspace's «Descuentos de compra» cost category (created on first use), `tax_treatment` defaults to `no_gravado`. Total a pagar = `net_clp` (+ `tax_clp` under the tick) minus the Descuentos; Descuentos above the price are a **400** with `error.details.code` `discounts_exceed_price`. `forma_de_pago` (one line) and `observaciones` are free text that print; `notes` stays internal. Requests in the older shape (header `tax_treatment`, a full acquisition block, retention categories) keep working.
|
|
43894
|
+
*
|
|
43895
|
+
* **Refusals the form branches on** (`error.details.code`, 409): `vehicle_has_documented_cost` (the car already has a cost from another document; `details` names it: `purchase_note_id`, `sale_note_id` or `consignment_contract_id`) and `vehicle_sold_by_other_seller` (a live nota de venta names another seller; `details.sale_note_id`, `details.sale_note_display_id`). A car with a typed (bare) Costo de compra is NOT refused: the note takes that cost over.
|
|
43896
|
+
*
|
|
43897
|
+
* **Money is whole CLP pesos** (`bigint`, never minor units, never decimals) and the triple is `net_clp` + `tax_clp` + `tax_treatment`, on the header AND again per line. Omit `tax_clp` to record "not recorded"; pass `0` to record "no tax" — ADR 0058 §2 makes those two different claims and nothing collapses them. A LINE still states its `tax_treatment`.
|
|
43891
43898
|
*
|
|
43892
43899
|
* **`lines` are `document_line` rows**, written in the SAME transaction as the document, so a folio is never spent on a document whose breakdown never arrived. The array order IS the document order; positions are assigned by the database and cannot be supplied. Omit `lines` for a document with a header amount and no breakdown, which is complete and ordinary. Whether the lines add up to the header is deliberately NOT enforced.
|
|
43893
43900
|
*
|
|
43894
|
-
*
|
|
43901
|
+
* `acquisition` attaches the car in the same transaction; without it the document is issued alone, and a unit can be attached later on `/vehicle-acquisitions` (one nota de compra may acquire several units).
|
|
43895
43902
|
*
|
|
43896
43903
|
* `seller_contact_id` must belong to the calling workspace; a foreign id and a nonexistent one answer identically (404), deliberately, because a difference between them is an existence oracle. Unknown body keys are a **400** — `tax` is one character from `tax_clp`, and silently discarding it would record "no IVA was entered" for a caller who entered it. Answers 201.
|
|
43897
43904
|
*/
|
|
@@ -43911,26 +43918,40 @@ interface paths {
|
|
|
43911
43918
|
* @example {
|
|
43912
43919
|
* "seller_contact_id": "22222222-0000-4000-8000-000000000003",
|
|
43913
43920
|
* "net_clp": 6200000,
|
|
43914
|
-
* "
|
|
43915
|
-
* "
|
|
43916
|
-
*
|
|
43917
|
-
*
|
|
43918
|
-
*
|
|
43919
|
-
*
|
|
43920
|
-
*
|
|
43921
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
43922
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
43923
|
+
* "acquisition": {
|
|
43924
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
43925
|
+
* "retentions": [
|
|
43926
|
+
* {
|
|
43927
|
+
* "description": "Multas",
|
|
43928
|
+
* "net_clp": 180000
|
|
43929
|
+
* }
|
|
43930
|
+
* ]
|
|
43931
|
+
* }
|
|
43921
43932
|
* }
|
|
43922
43933
|
*/
|
|
43923
43934
|
"application/json": {
|
|
43924
43935
|
/** Format: uuid */
|
|
43925
43936
|
seller_contact_id?: string | null;
|
|
43937
|
+
/** @description Precio de compra en pesos. Con `invoice_includes_iva: true` es el monto escrito con IVA incluido: se guarda sin IVA en `net_clp` y el IVA en `tax_clp`. */
|
|
43926
43938
|
net_clp: number;
|
|
43927
43939
|
tax_clp?: number | null;
|
|
43928
|
-
/**
|
|
43929
|
-
|
|
43940
|
+
/**
|
|
43941
|
+
* @description Opcional. Por defecto `afecto` con `invoice_includes_iva`; si no, el régimen de IVA del auto de `acquisition` (el del auto, si no el de la automotora, si no exento); sin auto, exento.
|
|
43942
|
+
* @enum {string}
|
|
43943
|
+
*/
|
|
43944
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
43945
|
+
/** @description «Compra con factura (incluye IVA)». Opcional, por defecto false. Con true `net_clp` incluye IVA: la nota guarda el precio sin IVA y el IVA aparte, queda afecta, y el costo de compra del auto queda sin IVA y con crédito fiscal. Manda sobre `tax_clp`, `tax_treatment` y los campos de impuesto de `acquisition`. */
|
|
43946
|
+
invoice_includes_iva?: boolean;
|
|
43930
43947
|
/** Format: date-time */
|
|
43931
43948
|
issued_at?: string | null;
|
|
43932
43949
|
/** @description Internal free-text notes. Never printed on the document. Blank clears them. */
|
|
43933
43950
|
notes?: string | null;
|
|
43951
|
+
/** @description «Forma de pago», una línea libre que se imprime en la nota de compra (hasta 500 caracteres). Vacío o null la borra. */
|
|
43952
|
+
forma_de_pago?: string | null;
|
|
43953
|
+
/** @description Observaciones que se imprimen en la nota de compra (hasta 2000 caracteres). Vacío o null las borra. No son las notas internas (`notes`). */
|
|
43954
|
+
observaciones?: string | null;
|
|
43934
43955
|
lines?: {
|
|
43935
43956
|
description: string;
|
|
43936
43957
|
net_clp: number;
|
|
@@ -43941,20 +43962,22 @@ interface paths {
|
|
|
43941
43962
|
acquisition?: {
|
|
43942
43963
|
/** Format: uuid */
|
|
43943
43964
|
vehicle_id: string;
|
|
43944
|
-
acquired_on
|
|
43965
|
+
acquired_on?: string;
|
|
43945
43966
|
tax_clp?: number | null;
|
|
43946
43967
|
/** @enum {string} */
|
|
43947
|
-
tax_treatment
|
|
43968
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
43948
43969
|
/** @enum {string} */
|
|
43949
|
-
borne_by
|
|
43950
|
-
generates_fiscal_credit
|
|
43970
|
+
borne_by?: "automotora" | "cliente";
|
|
43971
|
+
generates_fiscal_credit?: boolean;
|
|
43951
43972
|
retentions?: {
|
|
43973
|
+
/** @description Qué se descuenta («Multas», «Prenda», «Permiso de circulación»), hasta 200 caracteres. Se imprime en la nota de compra. */
|
|
43974
|
+
description?: string | null;
|
|
43952
43975
|
/** Format: uuid */
|
|
43953
|
-
category_id
|
|
43976
|
+
category_id?: string;
|
|
43954
43977
|
net_clp: number;
|
|
43955
43978
|
tax_clp?: number | null;
|
|
43956
43979
|
/** @enum {string} */
|
|
43957
|
-
tax_treatment
|
|
43980
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
43958
43981
|
incurred_on?: string | null;
|
|
43959
43982
|
/** Format: uuid */
|
|
43960
43983
|
supplier_contact_id?: string | null;
|
|
@@ -43984,6 +44007,9 @@ interface paths {
|
|
|
43984
44007
|
* "tax_treatment": "no_gravado",
|
|
43985
44008
|
* "status": "issued",
|
|
43986
44009
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
44010
|
+
* "notes": null,
|
|
44011
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
44012
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
43987
44013
|
* "corrected_at": null,
|
|
43988
44014
|
* "corrected_by": null,
|
|
43989
44015
|
* "voided_at": null,
|
|
@@ -44108,6 +44134,9 @@ interface paths {
|
|
|
44108
44134
|
* "tax_treatment": "no_gravado",
|
|
44109
44135
|
* "status": "issued",
|
|
44110
44136
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
44137
|
+
* "notes": null,
|
|
44138
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
44139
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
44111
44140
|
* "corrected_at": null,
|
|
44112
44141
|
* "corrected_by": null,
|
|
44113
44142
|
* "voided_at": null,
|
|
@@ -44224,6 +44253,10 @@ interface paths {
|
|
|
44224
44253
|
* }
|
|
44225
44254
|
*/
|
|
44226
44255
|
"application/json": {
|
|
44256
|
+
/** @description «Forma de pago», una línea libre que se imprime en la nota de compra (hasta 500 caracteres). Vacío o null la borra. */
|
|
44257
|
+
forma_de_pago?: string | null;
|
|
44258
|
+
/** @description Observaciones que se imprimen en la nota de compra (hasta 2000 caracteres). Vacío o null las borra. No son las notas internas (`notes`). */
|
|
44259
|
+
observaciones?: string | null;
|
|
44227
44260
|
/** Format: uuid */
|
|
44228
44261
|
seller_contact_id?: string | null;
|
|
44229
44262
|
net_clp?: number;
|
|
@@ -44264,6 +44297,9 @@ interface paths {
|
|
|
44264
44297
|
* "tax_treatment": "no_gravado",
|
|
44265
44298
|
* "status": "issued",
|
|
44266
44299
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
44300
|
+
* "notes": null,
|
|
44301
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
44302
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
44267
44303
|
* "corrected_at": "2026-09-13T09:00:00.000Z",
|
|
44268
44304
|
* "corrected_by": "11111111-0000-4000-8000-000000000001",
|
|
44269
44305
|
* "voided_at": null,
|
|
@@ -44498,6 +44534,9 @@ interface paths {
|
|
|
44498
44534
|
* "tax_treatment": "no_gravado",
|
|
44499
44535
|
* "status": "voided",
|
|
44500
44536
|
* "issued_at": "2026-09-12T10:15:00.000Z",
|
|
44537
|
+
* "notes": null,
|
|
44538
|
+
* "forma_de_pago": "Transferencia a la cuenta del vendedor",
|
|
44539
|
+
* "observaciones": "Se entrega con dos llaves.",
|
|
44501
44540
|
* "corrected_at": null,
|
|
44502
44541
|
* "corrected_by": null,
|
|
44503
44542
|
* "voided_at": "2026-09-14T11:30:00.000Z",
|
|
@@ -50199,7 +50238,121 @@ interface paths {
|
|
|
50199
50238
|
path?: never;
|
|
50200
50239
|
cookie?: never;
|
|
50201
50240
|
};
|
|
50202
|
-
|
|
50241
|
+
/**
|
|
50242
|
+
* The acquisition record for a vehicle
|
|
50243
|
+
* @description How one car arrived and what it cost (its Costo de compra). Needs `dealership_economics:read`. `vehicle_id` is required (no whole-lot cost dump). An empty array, not a 404, when no acquisition has been recorded yet; a car removed from Stock answers the same empty array. The cost editor prefills its amount from `amount_paid_clp` and its «Compra con factura (incluye IVA)» tick from `invoice_includes_iva` (vitrina-app#7719); a correction is `POST /vehicle-acquisitions`.
|
|
50244
|
+
*/
|
|
50245
|
+
get: {
|
|
50246
|
+
parameters: {
|
|
50247
|
+
query: {
|
|
50248
|
+
vehicle_id: string;
|
|
50249
|
+
};
|
|
50250
|
+
header?: never;
|
|
50251
|
+
path?: never;
|
|
50252
|
+
cookie?: never;
|
|
50253
|
+
};
|
|
50254
|
+
requestBody?: never;
|
|
50255
|
+
responses: {
|
|
50256
|
+
/** @description The acquisition of the car: a list of at most one row. */
|
|
50257
|
+
200: {
|
|
50258
|
+
headers: {
|
|
50259
|
+
[name: string]: unknown;
|
|
50260
|
+
};
|
|
50261
|
+
content: {
|
|
50262
|
+
/**
|
|
50263
|
+
* @example {
|
|
50264
|
+
* "data": [
|
|
50265
|
+
* {
|
|
50266
|
+
* "id": "b5f0d6c2-1e8a-4c3b-9f7d-2a6e4b8c0d11",
|
|
50267
|
+
* "tenant_id": "a3c9e1f0-7b2d-4e5a-8c6f-1d0b9e2a4f73",
|
|
50268
|
+
* "vehicle_id": "7c1e2a40-5b7d-4f0e-9a51-3d2f8e6b1c90",
|
|
50269
|
+
* "kind": "compra",
|
|
50270
|
+
* "counterparty_contact_id": null,
|
|
50271
|
+
* "acquired_on": "2026-08-03",
|
|
50272
|
+
* "purchase_note_id": null,
|
|
50273
|
+
* "consignment_contract_id": null,
|
|
50274
|
+
* "sale_note_id": null,
|
|
50275
|
+
* "net_clp": 8500000,
|
|
50276
|
+
* "tax_clp": null,
|
|
50277
|
+
* "tax_treatment": "exento",
|
|
50278
|
+
* "borne_by": "automotora",
|
|
50279
|
+
* "generates_fiscal_credit": false,
|
|
50280
|
+
* "created_at": "2026-11-19T15:02:00.000Z",
|
|
50281
|
+
* "updated_at": "2026-11-19T15:02:00.000Z",
|
|
50282
|
+
* "derived_tenencia": "propio",
|
|
50283
|
+
* "invoice_includes_iva": false,
|
|
50284
|
+
* "amount_paid_clp": 8500000
|
|
50285
|
+
* }
|
|
50286
|
+
* ],
|
|
50287
|
+
* "meta": {
|
|
50288
|
+
* "total": 1
|
|
50289
|
+
* }
|
|
50290
|
+
* }
|
|
50291
|
+
*/
|
|
50292
|
+
"application/json": {
|
|
50293
|
+
data: components["schemas"]["VehicleAcquisition"][];
|
|
50294
|
+
meta?: {
|
|
50295
|
+
[key: string]: unknown;
|
|
50296
|
+
};
|
|
50297
|
+
};
|
|
50298
|
+
};
|
|
50299
|
+
};
|
|
50300
|
+
/** @description Validation error */
|
|
50301
|
+
400: {
|
|
50302
|
+
headers: {
|
|
50303
|
+
[name: string]: unknown;
|
|
50304
|
+
};
|
|
50305
|
+
content: {
|
|
50306
|
+
"application/json": components["schemas"]["Error"];
|
|
50307
|
+
};
|
|
50308
|
+
};
|
|
50309
|
+
/** @description Unauthorized */
|
|
50310
|
+
401: {
|
|
50311
|
+
headers: {
|
|
50312
|
+
[name: string]: unknown;
|
|
50313
|
+
};
|
|
50314
|
+
content: {
|
|
50315
|
+
"application/json": components["schemas"]["Error"];
|
|
50316
|
+
};
|
|
50317
|
+
};
|
|
50318
|
+
/** @description Forbidden */
|
|
50319
|
+
403: {
|
|
50320
|
+
headers: {
|
|
50321
|
+
[name: string]: unknown;
|
|
50322
|
+
};
|
|
50323
|
+
content: {
|
|
50324
|
+
"application/json": components["schemas"]["Error"];
|
|
50325
|
+
};
|
|
50326
|
+
};
|
|
50327
|
+
/** @description Not found */
|
|
50328
|
+
404: {
|
|
50329
|
+
headers: {
|
|
50330
|
+
[name: string]: unknown;
|
|
50331
|
+
};
|
|
50332
|
+
content: {
|
|
50333
|
+
"application/json": components["schemas"]["Error"];
|
|
50334
|
+
};
|
|
50335
|
+
};
|
|
50336
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
50337
|
+
409: {
|
|
50338
|
+
headers: {
|
|
50339
|
+
[name: string]: unknown;
|
|
50340
|
+
};
|
|
50341
|
+
content: {
|
|
50342
|
+
"application/json": components["schemas"]["Error"];
|
|
50343
|
+
};
|
|
50344
|
+
};
|
|
50345
|
+
/** @description Rate limited */
|
|
50346
|
+
429: {
|
|
50347
|
+
headers: {
|
|
50348
|
+
[name: string]: unknown;
|
|
50349
|
+
};
|
|
50350
|
+
content: {
|
|
50351
|
+
"application/json": components["schemas"]["Error"];
|
|
50352
|
+
};
|
|
50353
|
+
};
|
|
50354
|
+
};
|
|
50355
|
+
};
|
|
50203
50356
|
put?: never;
|
|
50204
50357
|
/**
|
|
50205
50358
|
* Record how a unit arrived, or its bare Costo de compra
|
|
@@ -50397,6 +50550,131 @@ interface paths {
|
|
|
50397
50550
|
patch?: never;
|
|
50398
50551
|
trace?: never;
|
|
50399
50552
|
};
|
|
50553
|
+
"/vehicle-acquisitions/{id}": {
|
|
50554
|
+
parameters: {
|
|
50555
|
+
query?: never;
|
|
50556
|
+
header?: never;
|
|
50557
|
+
path?: never;
|
|
50558
|
+
cookie?: never;
|
|
50559
|
+
};
|
|
50560
|
+
/**
|
|
50561
|
+
* Fetch one acquisition record
|
|
50562
|
+
* @description One acquisition by its id, in the same shape as the list read. Needs `dealership_economics:read`. 404 for an id of another workspace or none at all.
|
|
50563
|
+
*/
|
|
50564
|
+
get: {
|
|
50565
|
+
parameters: {
|
|
50566
|
+
query?: never;
|
|
50567
|
+
header?: never;
|
|
50568
|
+
path: {
|
|
50569
|
+
id: string;
|
|
50570
|
+
};
|
|
50571
|
+
cookie?: never;
|
|
50572
|
+
};
|
|
50573
|
+
requestBody?: never;
|
|
50574
|
+
responses: {
|
|
50575
|
+
/** @description The acquisition record */
|
|
50576
|
+
200: {
|
|
50577
|
+
headers: {
|
|
50578
|
+
[name: string]: unknown;
|
|
50579
|
+
};
|
|
50580
|
+
content: {
|
|
50581
|
+
/**
|
|
50582
|
+
* @example {
|
|
50583
|
+
* "data": {
|
|
50584
|
+
* "id": "b5f0d6c2-1e8a-4c3b-9f7d-2a6e4b8c0d11",
|
|
50585
|
+
* "tenant_id": "a3c9e1f0-7b2d-4e5a-8c6f-1d0b9e2a4f73",
|
|
50586
|
+
* "vehicle_id": "7c1e2a40-5b7d-4f0e-9a51-3d2f8e6b1c90",
|
|
50587
|
+
* "kind": "compra",
|
|
50588
|
+
* "counterparty_contact_id": null,
|
|
50589
|
+
* "acquired_on": "2026-08-03",
|
|
50590
|
+
* "purchase_note_id": null,
|
|
50591
|
+
* "consignment_contract_id": null,
|
|
50592
|
+
* "sale_note_id": null,
|
|
50593
|
+
* "net_clp": 8500000,
|
|
50594
|
+
* "tax_clp": null,
|
|
50595
|
+
* "tax_treatment": "exento",
|
|
50596
|
+
* "borne_by": "automotora",
|
|
50597
|
+
* "generates_fiscal_credit": false,
|
|
50598
|
+
* "created_at": "2026-11-19T15:02:00.000Z",
|
|
50599
|
+
* "updated_at": "2026-11-19T15:02:00.000Z",
|
|
50600
|
+
* "derived_tenencia": "propio",
|
|
50601
|
+
* "invoice_includes_iva": false,
|
|
50602
|
+
* "amount_paid_clp": 8500000
|
|
50603
|
+
* }
|
|
50604
|
+
* }
|
|
50605
|
+
*/
|
|
50606
|
+
"application/json": {
|
|
50607
|
+
data: components["schemas"]["VehicleAcquisition"];
|
|
50608
|
+
meta?: {
|
|
50609
|
+
[key: string]: unknown;
|
|
50610
|
+
};
|
|
50611
|
+
};
|
|
50612
|
+
};
|
|
50613
|
+
};
|
|
50614
|
+
/** @description Validation error */
|
|
50615
|
+
400: {
|
|
50616
|
+
headers: {
|
|
50617
|
+
[name: string]: unknown;
|
|
50618
|
+
};
|
|
50619
|
+
content: {
|
|
50620
|
+
"application/json": components["schemas"]["Error"];
|
|
50621
|
+
};
|
|
50622
|
+
};
|
|
50623
|
+
/** @description Unauthorized */
|
|
50624
|
+
401: {
|
|
50625
|
+
headers: {
|
|
50626
|
+
[name: string]: unknown;
|
|
50627
|
+
};
|
|
50628
|
+
content: {
|
|
50629
|
+
"application/json": components["schemas"]["Error"];
|
|
50630
|
+
};
|
|
50631
|
+
};
|
|
50632
|
+
/** @description Forbidden */
|
|
50633
|
+
403: {
|
|
50634
|
+
headers: {
|
|
50635
|
+
[name: string]: unknown;
|
|
50636
|
+
};
|
|
50637
|
+
content: {
|
|
50638
|
+
"application/json": components["schemas"]["Error"];
|
|
50639
|
+
};
|
|
50640
|
+
};
|
|
50641
|
+
/** @description Not found */
|
|
50642
|
+
404: {
|
|
50643
|
+
headers: {
|
|
50644
|
+
[name: string]: unknown;
|
|
50645
|
+
};
|
|
50646
|
+
content: {
|
|
50647
|
+
"application/json": components["schemas"]["Error"];
|
|
50648
|
+
};
|
|
50649
|
+
};
|
|
50650
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
50651
|
+
409: {
|
|
50652
|
+
headers: {
|
|
50653
|
+
[name: string]: unknown;
|
|
50654
|
+
};
|
|
50655
|
+
content: {
|
|
50656
|
+
"application/json": components["schemas"]["Error"];
|
|
50657
|
+
};
|
|
50658
|
+
};
|
|
50659
|
+
/** @description Rate limited */
|
|
50660
|
+
429: {
|
|
50661
|
+
headers: {
|
|
50662
|
+
[name: string]: unknown;
|
|
50663
|
+
};
|
|
50664
|
+
content: {
|
|
50665
|
+
"application/json": components["schemas"]["Error"];
|
|
50666
|
+
};
|
|
50667
|
+
};
|
|
50668
|
+
};
|
|
50669
|
+
};
|
|
50670
|
+
put?: never;
|
|
50671
|
+
post?: never;
|
|
50672
|
+
delete?: never;
|
|
50673
|
+
options?: never;
|
|
50674
|
+
head?: never;
|
|
50675
|
+
patch?: never;
|
|
50676
|
+
trace?: never;
|
|
50677
|
+
};
|
|
50400
50678
|
"/vehicles/kanban": {
|
|
50401
50679
|
parameters: {
|
|
50402
50680
|
query?: never;
|
|
@@ -323830,6 +324108,68 @@ interface components {
|
|
|
323830
324108
|
};
|
|
323831
324109
|
/** @example 2026-01 */
|
|
323832
324110
|
OverheadPeriod: string;
|
|
324111
|
+
VehicleAcquisition: {
|
|
324112
|
+
/** Format: uuid */
|
|
324113
|
+
id: string;
|
|
324114
|
+
/** Format: uuid */
|
|
324115
|
+
tenant_id: string;
|
|
324116
|
+
/**
|
|
324117
|
+
* Format: uuid
|
|
324118
|
+
* @description El auto.
|
|
324119
|
+
*/
|
|
324120
|
+
vehicle_id: string;
|
|
324121
|
+
/**
|
|
324122
|
+
* @description Cómo llegó el auto: compra (de la automotora), consignacion o retoma (parte de pago).
|
|
324123
|
+
* @enum {string}
|
|
324124
|
+
*/
|
|
324125
|
+
kind: "compra" | "consignacion" | "retoma";
|
|
324126
|
+
/**
|
|
324127
|
+
* Format: uuid
|
|
324128
|
+
* @description De quién llegó el auto (contacto). null = no registrado.
|
|
324129
|
+
*/
|
|
324130
|
+
counterparty_contact_id: string | null;
|
|
324131
|
+
/** @description Fecha de adquisición, YYYY-MM-DD. */
|
|
324132
|
+
acquired_on: string;
|
|
324133
|
+
/**
|
|
324134
|
+
* Format: uuid
|
|
324135
|
+
* @description La nota de compra de una compra. null en un costo de compra escrito a mano.
|
|
324136
|
+
*/
|
|
324137
|
+
purchase_note_id: string | null;
|
|
324138
|
+
/**
|
|
324139
|
+
* Format: uuid
|
|
324140
|
+
* @description El contrato de una consignación.
|
|
324141
|
+
*/
|
|
324142
|
+
consignment_contract_id: string | null;
|
|
324143
|
+
/**
|
|
324144
|
+
* Format: uuid
|
|
324145
|
+
* @description La nota de venta que recibió el auto en parte de pago (retoma).
|
|
324146
|
+
*/
|
|
324147
|
+
sale_note_id: string | null;
|
|
324148
|
+
/** @description Costo de compra en pesos, sin IVA cuando la compra fue con factura. */
|
|
324149
|
+
net_clp: number;
|
|
324150
|
+
/** @description IVA de la compra en pesos. null = no registrado; 0 = sin IVA. */
|
|
324151
|
+
tax_clp: number | null;
|
|
324152
|
+
/**
|
|
324153
|
+
* @description Tratamiento de IVA de la compra.
|
|
324154
|
+
* @enum {string}
|
|
324155
|
+
*/
|
|
324156
|
+
tax_treatment: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
324157
|
+
/**
|
|
324158
|
+
* @description Quién asume el costo (automotora o cliente).
|
|
324159
|
+
* @enum {string}
|
|
324160
|
+
*/
|
|
324161
|
+
borne_by: "automotora" | "cliente";
|
|
324162
|
+
/** @description La compra genera crédito fiscal (IVA recuperable). */
|
|
324163
|
+
generates_fiscal_credit: boolean;
|
|
324164
|
+
created_at: string;
|
|
324165
|
+
updated_at: string;
|
|
324166
|
+
/** @description La tenencia del auto (propio o consignacion) tal como quedó tras este registro. */
|
|
324167
|
+
derived_tenencia: string | null;
|
|
324168
|
+
/** @description «Compra con factura (incluye IVA)» tal como quedó registrada. Sirve para mostrar el tick al reabrir el costo. */
|
|
324169
|
+
invoice_includes_iva: boolean;
|
|
324170
|
+
/** @description El monto que escribió la automotora: net_clp más el IVA cuando la compra fue con factura, si no net_clp. Sirve para mostrar el monto al reabrir el costo. */
|
|
324171
|
+
amount_paid_clp: number;
|
|
324172
|
+
};
|
|
323833
324173
|
/** @description A Mercado Pago checkout payment: its payment id, a link to it and its status. Null for every other movement. */
|
|
323834
324174
|
GatewayPaymentRef: {
|
|
323835
324175
|
/** @enum {string} */
|
package/package.json
CHANGED