@vitrina/api 17.87.0 → 17.88.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 +143 -6
- package/dist/index.d.ts +143 -6
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -44132,6 +44132,8 @@ interface paths {
|
|
|
44132
44132
|
*
|
|
44133
44133
|
* It also carries the unit it bought, the same as each row of the list: `vehicle` is `{ id, make, model, year, registration_number }` or `null`, and `vehicle_count` says how many units the document acquired (`vehicle` is the FIRST of them when there are several, and `null` exactly when the count is `0`).
|
|
44134
44134
|
*
|
|
44135
|
+
* Since vitrina-app#7723 it also carries what the «Modificar» form opens with: `acquisition` (the car’s cost under this note, with `invoice_includes_iva` and `amount_paid_clp`, or `null`) and `retentions` (the note’s live «Descuentos», each with `description` and `net_clp`).
|
|
44136
|
+
*
|
|
44135
44137
|
* A document belonging to another workspace is a 404, indistinguishable from one that does not exist.
|
|
44136
44138
|
*/
|
|
44137
44139
|
get: {
|
|
@@ -44181,7 +44183,42 @@ interface paths {
|
|
|
44181
44183
|
* "year": 2020,
|
|
44182
44184
|
* "registration_number": "KXPT21"
|
|
44183
44185
|
* },
|
|
44184
|
-
* "vehicle_count": 1
|
|
44186
|
+
* "vehicle_count": 1,
|
|
44187
|
+
* "acquisition": {
|
|
44188
|
+
* "id": "7b0e1c52-3a1f-4d8e-9c2a-5f6b7c8d9e01",
|
|
44189
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
44190
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44191
|
+
* "kind": "compra",
|
|
44192
|
+
* "counterparty_contact_id": "22222222-0000-4000-8000-000000000003",
|
|
44193
|
+
* "acquired_on": "2026-09-12",
|
|
44194
|
+
* "purchase_note_id": "d5d5d5d5-0000-4000-8000-000000000001",
|
|
44195
|
+
* "consignment_contract_id": null,
|
|
44196
|
+
* "sale_note_id": null,
|
|
44197
|
+
* "net_clp": 6020000,
|
|
44198
|
+
* "tax_clp": null,
|
|
44199
|
+
* "tax_treatment": "no_gravado",
|
|
44200
|
+
* "borne_by": "automotora",
|
|
44201
|
+
* "generates_fiscal_credit": false,
|
|
44202
|
+
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44203
|
+
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44204
|
+
* "invoice_includes_iva": false,
|
|
44205
|
+
* "amount_paid_clp": 6020000
|
|
44206
|
+
* },
|
|
44207
|
+
* "retentions": [
|
|
44208
|
+
* {
|
|
44209
|
+
* "id": "9c1d2e3f-4a5b-4c6d-8e7f-0a1b2c3d4e5f",
|
|
44210
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44211
|
+
* "kind": "expense",
|
|
44212
|
+
* "description": "Multas",
|
|
44213
|
+
* "net_clp": 180000,
|
|
44214
|
+
* "tax_clp": null,
|
|
44215
|
+
* "tax_treatment": "no_gravado",
|
|
44216
|
+
* "incurred_on": "2026-09-12",
|
|
44217
|
+
* "purchase_note_id": "d5d5d5d5-0000-4000-8000-000000000001",
|
|
44218
|
+
* "retained": true,
|
|
44219
|
+
* "voided_at": null
|
|
44220
|
+
* }
|
|
44221
|
+
* ]
|
|
44185
44222
|
* }
|
|
44186
44223
|
* }
|
|
44187
44224
|
*/
|
|
@@ -44255,8 +44292,10 @@ interface paths {
|
|
|
44255
44292
|
options?: never;
|
|
44256
44293
|
head?: never;
|
|
44257
44294
|
/**
|
|
44258
|
-
*
|
|
44259
|
-
* @description
|
|
44295
|
+
* Modify a nota de compra
|
|
44296
|
+
* @description **Everything is editable until the note is voided** (vitrina-app#7723): seller, car, price, date, «Descuentos», forma de pago, observaciones and the «Compra con factura (incluye IVA)» tick. **The car’s cost follows in the same write**: the acquisition takes the new payout (price − Descuentos), the seller, the day and the tax split; `acquisition.retentions` replaces the Descuentos (the old cost lines are voided, never edited); `acquisition.vehicle_id` moves the cost and the Descuentos to another car (the old one is left without a cost). Send `invoice_includes_iva` on every save of the form. The answer is the note as `GET` returns it plus `previous` (what it said before); every change is also an audit-log row with who and when. Refusals (`error.details.code`): `purchase_note_voided` (409), `discounts_exceed_price` (400), `vehicle_has_documented_cost` (409), `vehicle_sold_by_other_seller` (409), `purchase_note_has_several_cars` (409, a legacy note that bought several cars: price, tick, car or Descuentos), `purchase_note_changed_meanwhile` (409).
|
|
44297
|
+
*
|
|
44298
|
+
* Corrects a LIVE document and **stamps it**: `corrected_at` and the acting principal are written onto the row, so a reader of the document can tell it has been changed since it was issued without joining an audit table. The folio and the status are never touched.
|
|
44260
44299
|
*
|
|
44261
44300
|
* **An ABSENT field is left alone; an explicit `null` CLEARS it.** On `tax_clp` that is the difference between "not recorded" and "no tax", which ADR 0058 §2 keeps apart — so correcting away an amount entered by mistake is expressible without being confused with zero.
|
|
44262
44301
|
*
|
|
@@ -44279,7 +44318,16 @@ interface paths {
|
|
|
44279
44318
|
content: {
|
|
44280
44319
|
/**
|
|
44281
44320
|
* @example {
|
|
44282
|
-
* "net_clp": 6150000
|
|
44321
|
+
* "net_clp": 6150000,
|
|
44322
|
+
* "invoice_includes_iva": false,
|
|
44323
|
+
* "acquisition": {
|
|
44324
|
+
* "retentions": [
|
|
44325
|
+
* {
|
|
44326
|
+
* "description": "Multas",
|
|
44327
|
+
* "net_clp": 180000
|
|
44328
|
+
* }
|
|
44329
|
+
* ]
|
|
44330
|
+
* }
|
|
44283
44331
|
* }
|
|
44284
44332
|
*/
|
|
44285
44333
|
"application/json": {
|
|
@@ -44304,6 +44352,30 @@ interface paths {
|
|
|
44304
44352
|
/** @enum {string} */
|
|
44305
44353
|
tax_treatment: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
44306
44354
|
}[];
|
|
44355
|
+
/** @description «Compra con factura (incluye IVA)». Mándalo en cada guardado del formulario. true: `net_clp` (o el precio actual si no viene) incluye IVA y se separa como al emitir. false: el precio completo es el costo, sin IVA aparte. Sin el campo, `net_clp` es el precio sin IVA y los campos de impuesto quedan como se indiquen. */
|
|
44356
|
+
invoice_includes_iva?: boolean;
|
|
44357
|
+
acquisition?: {
|
|
44358
|
+
/**
|
|
44359
|
+
* Format: uuid
|
|
44360
|
+
* @description Otro auto para la nota. Su costo y sus descuentos pasan a ese auto; el auto anterior queda sin costo de compra. Sin el campo, el auto no cambia.
|
|
44361
|
+
*/
|
|
44362
|
+
vehicle_id?: string;
|
|
44363
|
+
/** @description Los «Descuentos» pasan a ser exactamente esta lista (`[]` = ninguno). Sin el campo, no cambian. */
|
|
44364
|
+
retentions?: {
|
|
44365
|
+
/** @description Qué se descuenta («Multas», «Prenda», «Permiso de circulación»), hasta 200 caracteres. Se imprime en la nota de compra. */
|
|
44366
|
+
description?: string | null;
|
|
44367
|
+
/** Format: uuid */
|
|
44368
|
+
category_id?: string;
|
|
44369
|
+
net_clp: number;
|
|
44370
|
+
tax_clp?: number | null;
|
|
44371
|
+
/** @enum {string} */
|
|
44372
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
44373
|
+
incurred_on?: string | null;
|
|
44374
|
+
/** Format: uuid */
|
|
44375
|
+
supplier_contact_id?: string | null;
|
|
44376
|
+
document_ref?: string | null;
|
|
44377
|
+
}[];
|
|
44378
|
+
};
|
|
44307
44379
|
};
|
|
44308
44380
|
};
|
|
44309
44381
|
};
|
|
@@ -44336,7 +44408,57 @@ interface paths {
|
|
|
44336
44408
|
* "void_reason": null,
|
|
44337
44409
|
* "voided_by": null,
|
|
44338
44410
|
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44339
|
-
* "updated_at": "2026-09-12T10:15:00.000Z"
|
|
44411
|
+
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44412
|
+
* "lines": [],
|
|
44413
|
+
* "vehicle": {
|
|
44414
|
+
* "id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44415
|
+
* "make": "Mazda",
|
|
44416
|
+
* "model": "CX-5",
|
|
44417
|
+
* "year": 2020,
|
|
44418
|
+
* "registration_number": "KXPT21"
|
|
44419
|
+
* },
|
|
44420
|
+
* "vehicle_count": 1,
|
|
44421
|
+
* "acquisition": {
|
|
44422
|
+
* "id": "7b0e1c52-3a1f-4d8e-9c2a-5f6b7c8d9e01",
|
|
44423
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
44424
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44425
|
+
* "kind": "compra",
|
|
44426
|
+
* "counterparty_contact_id": "22222222-0000-4000-8000-000000000003",
|
|
44427
|
+
* "acquired_on": "2026-09-12",
|
|
44428
|
+
* "purchase_note_id": "d5d5d5d5-0000-4000-8000-000000000001",
|
|
44429
|
+
* "consignment_contract_id": null,
|
|
44430
|
+
* "sale_note_id": null,
|
|
44431
|
+
* "net_clp": 5970000,
|
|
44432
|
+
* "tax_clp": null,
|
|
44433
|
+
* "tax_treatment": "no_gravado",
|
|
44434
|
+
* "borne_by": "automotora",
|
|
44435
|
+
* "generates_fiscal_credit": false,
|
|
44436
|
+
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44437
|
+
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44438
|
+
* "invoice_includes_iva": false,
|
|
44439
|
+
* "amount_paid_clp": 5970000
|
|
44440
|
+
* },
|
|
44441
|
+
* "retentions": [
|
|
44442
|
+
* {
|
|
44443
|
+
* "id": "9c1d2e3f-4a5b-4c6d-8e7f-0a1b2c3d4e5f",
|
|
44444
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44445
|
+
* "kind": "expense",
|
|
44446
|
+
* "description": "Multas",
|
|
44447
|
+
* "net_clp": 180000,
|
|
44448
|
+
* "tax_clp": null,
|
|
44449
|
+
* "tax_treatment": "no_gravado",
|
|
44450
|
+
* "incurred_on": "2026-09-12",
|
|
44451
|
+
* "purchase_note_id": "d5d5d5d5-0000-4000-8000-000000000001",
|
|
44452
|
+
* "retained": true,
|
|
44453
|
+
* "voided_at": null
|
|
44454
|
+
* }
|
|
44455
|
+
* ],
|
|
44456
|
+
* "previous": {
|
|
44457
|
+
* "net_clp": 6200000,
|
|
44458
|
+
* "tax_clp": null,
|
|
44459
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44460
|
+
* "discounts_clp": 180000
|
|
44461
|
+
* }
|
|
44340
44462
|
* }
|
|
44341
44463
|
* }
|
|
44342
44464
|
*/
|
|
@@ -44518,6 +44640,8 @@ interface paths {
|
|
|
44518
44640
|
*
|
|
44519
44641
|
* The actor comes from the authenticated principal; a `voided_by` in the body is IGNORED rather than rejected — a self-declared actor is not an attestation. Voiding twice is a **409**: the first actor and reason stand.
|
|
44520
44642
|
*
|
|
44643
|
+
* **The car keeps its cost** (vitrina-app#7723): in the same transaction each car the note bought keeps the note’s total (payout + «Descuentos») as a plain Costo de compra, no longer linked to the note, and the Descuentos stop counting apart. That cost can then be corrected by typing it (`POST /vehicle-acquisitions`) or taken over by a new nota de compra. `void_outcome` says what happened per car, and `void_outcome.message` is ready to show as is. Voiding a voided note is a 409 `purchase_note_voided`.
|
|
44644
|
+
*
|
|
44521
44645
|
* Requires `purchase_notes:void`, which is a DIFFERENT authority from `purchase_notes:write` — holding the write scope does not permit a void.
|
|
44522
44646
|
*/
|
|
44523
44647
|
post: {
|
|
@@ -44573,7 +44697,20 @@ interface paths {
|
|
|
44573
44697
|
* "void_reason": "se anuló la compra: el vendedor desistió antes de firmar",
|
|
44574
44698
|
* "voided_by": "11111111-0000-4000-8000-000000000001",
|
|
44575
44699
|
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44576
|
-
* "updated_at": "2026-09-12T10:15:00.000Z"
|
|
44700
|
+
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44701
|
+
* "lines": [],
|
|
44702
|
+
* "void_outcome": {
|
|
44703
|
+
* "vehicles": [
|
|
44704
|
+
* {
|
|
44705
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44706
|
+
* "acquisition_id": "7b0e1c52-3a1f-4d8e-9c2a-5f6b7c8d9e01",
|
|
44707
|
+
* "purchase_cost_clp": 6200000,
|
|
44708
|
+
* "invoice_includes_iva": false,
|
|
44709
|
+
* "discounts_clp": 180000
|
|
44710
|
+
* }
|
|
44711
|
+
* ],
|
|
44712
|
+
* "message": "Anulaste la nota de compra P-9. El Mazda CX-5 2020 (KXPT21) conserva su costo de compra de $6.200.000 como costo escrito a mano: puedes corregirlo en la ficha del auto o registrar una nota de compra nueva. Los descuentos de la nota ($180.000) ya no se cuentan aparte: quedan dentro de ese costo."
|
|
44713
|
+
* }
|
|
44577
44714
|
* }
|
|
44578
44715
|
* }
|
|
44579
44716
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -44132,6 +44132,8 @@ interface paths {
|
|
|
44132
44132
|
*
|
|
44133
44133
|
* It also carries the unit it bought, the same as each row of the list: `vehicle` is `{ id, make, model, year, registration_number }` or `null`, and `vehicle_count` says how many units the document acquired (`vehicle` is the FIRST of them when there are several, and `null` exactly when the count is `0`).
|
|
44134
44134
|
*
|
|
44135
|
+
* Since vitrina-app#7723 it also carries what the «Modificar» form opens with: `acquisition` (the car’s cost under this note, with `invoice_includes_iva` and `amount_paid_clp`, or `null`) and `retentions` (the note’s live «Descuentos», each with `description` and `net_clp`).
|
|
44136
|
+
*
|
|
44135
44137
|
* A document belonging to another workspace is a 404, indistinguishable from one that does not exist.
|
|
44136
44138
|
*/
|
|
44137
44139
|
get: {
|
|
@@ -44181,7 +44183,42 @@ interface paths {
|
|
|
44181
44183
|
* "year": 2020,
|
|
44182
44184
|
* "registration_number": "KXPT21"
|
|
44183
44185
|
* },
|
|
44184
|
-
* "vehicle_count": 1
|
|
44186
|
+
* "vehicle_count": 1,
|
|
44187
|
+
* "acquisition": {
|
|
44188
|
+
* "id": "7b0e1c52-3a1f-4d8e-9c2a-5f6b7c8d9e01",
|
|
44189
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
44190
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44191
|
+
* "kind": "compra",
|
|
44192
|
+
* "counterparty_contact_id": "22222222-0000-4000-8000-000000000003",
|
|
44193
|
+
* "acquired_on": "2026-09-12",
|
|
44194
|
+
* "purchase_note_id": "d5d5d5d5-0000-4000-8000-000000000001",
|
|
44195
|
+
* "consignment_contract_id": null,
|
|
44196
|
+
* "sale_note_id": null,
|
|
44197
|
+
* "net_clp": 6020000,
|
|
44198
|
+
* "tax_clp": null,
|
|
44199
|
+
* "tax_treatment": "no_gravado",
|
|
44200
|
+
* "borne_by": "automotora",
|
|
44201
|
+
* "generates_fiscal_credit": false,
|
|
44202
|
+
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44203
|
+
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44204
|
+
* "invoice_includes_iva": false,
|
|
44205
|
+
* "amount_paid_clp": 6020000
|
|
44206
|
+
* },
|
|
44207
|
+
* "retentions": [
|
|
44208
|
+
* {
|
|
44209
|
+
* "id": "9c1d2e3f-4a5b-4c6d-8e7f-0a1b2c3d4e5f",
|
|
44210
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44211
|
+
* "kind": "expense",
|
|
44212
|
+
* "description": "Multas",
|
|
44213
|
+
* "net_clp": 180000,
|
|
44214
|
+
* "tax_clp": null,
|
|
44215
|
+
* "tax_treatment": "no_gravado",
|
|
44216
|
+
* "incurred_on": "2026-09-12",
|
|
44217
|
+
* "purchase_note_id": "d5d5d5d5-0000-4000-8000-000000000001",
|
|
44218
|
+
* "retained": true,
|
|
44219
|
+
* "voided_at": null
|
|
44220
|
+
* }
|
|
44221
|
+
* ]
|
|
44185
44222
|
* }
|
|
44186
44223
|
* }
|
|
44187
44224
|
*/
|
|
@@ -44255,8 +44292,10 @@ interface paths {
|
|
|
44255
44292
|
options?: never;
|
|
44256
44293
|
head?: never;
|
|
44257
44294
|
/**
|
|
44258
|
-
*
|
|
44259
|
-
* @description
|
|
44295
|
+
* Modify a nota de compra
|
|
44296
|
+
* @description **Everything is editable until the note is voided** (vitrina-app#7723): seller, car, price, date, «Descuentos», forma de pago, observaciones and the «Compra con factura (incluye IVA)» tick. **The car’s cost follows in the same write**: the acquisition takes the new payout (price − Descuentos), the seller, the day and the tax split; `acquisition.retentions` replaces the Descuentos (the old cost lines are voided, never edited); `acquisition.vehicle_id` moves the cost and the Descuentos to another car (the old one is left without a cost). Send `invoice_includes_iva` on every save of the form. The answer is the note as `GET` returns it plus `previous` (what it said before); every change is also an audit-log row with who and when. Refusals (`error.details.code`): `purchase_note_voided` (409), `discounts_exceed_price` (400), `vehicle_has_documented_cost` (409), `vehicle_sold_by_other_seller` (409), `purchase_note_has_several_cars` (409, a legacy note that bought several cars: price, tick, car or Descuentos), `purchase_note_changed_meanwhile` (409).
|
|
44297
|
+
*
|
|
44298
|
+
* Corrects a LIVE document and **stamps it**: `corrected_at` and the acting principal are written onto the row, so a reader of the document can tell it has been changed since it was issued without joining an audit table. The folio and the status are never touched.
|
|
44260
44299
|
*
|
|
44261
44300
|
* **An ABSENT field is left alone; an explicit `null` CLEARS it.** On `tax_clp` that is the difference between "not recorded" and "no tax", which ADR 0058 §2 keeps apart — so correcting away an amount entered by mistake is expressible without being confused with zero.
|
|
44262
44301
|
*
|
|
@@ -44279,7 +44318,16 @@ interface paths {
|
|
|
44279
44318
|
content: {
|
|
44280
44319
|
/**
|
|
44281
44320
|
* @example {
|
|
44282
|
-
* "net_clp": 6150000
|
|
44321
|
+
* "net_clp": 6150000,
|
|
44322
|
+
* "invoice_includes_iva": false,
|
|
44323
|
+
* "acquisition": {
|
|
44324
|
+
* "retentions": [
|
|
44325
|
+
* {
|
|
44326
|
+
* "description": "Multas",
|
|
44327
|
+
* "net_clp": 180000
|
|
44328
|
+
* }
|
|
44329
|
+
* ]
|
|
44330
|
+
* }
|
|
44283
44331
|
* }
|
|
44284
44332
|
*/
|
|
44285
44333
|
"application/json": {
|
|
@@ -44304,6 +44352,30 @@ interface paths {
|
|
|
44304
44352
|
/** @enum {string} */
|
|
44305
44353
|
tax_treatment: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
44306
44354
|
}[];
|
|
44355
|
+
/** @description «Compra con factura (incluye IVA)». Mándalo en cada guardado del formulario. true: `net_clp` (o el precio actual si no viene) incluye IVA y se separa como al emitir. false: el precio completo es el costo, sin IVA aparte. Sin el campo, `net_clp` es el precio sin IVA y los campos de impuesto quedan como se indiquen. */
|
|
44356
|
+
invoice_includes_iva?: boolean;
|
|
44357
|
+
acquisition?: {
|
|
44358
|
+
/**
|
|
44359
|
+
* Format: uuid
|
|
44360
|
+
* @description Otro auto para la nota. Su costo y sus descuentos pasan a ese auto; el auto anterior queda sin costo de compra. Sin el campo, el auto no cambia.
|
|
44361
|
+
*/
|
|
44362
|
+
vehicle_id?: string;
|
|
44363
|
+
/** @description Los «Descuentos» pasan a ser exactamente esta lista (`[]` = ninguno). Sin el campo, no cambian. */
|
|
44364
|
+
retentions?: {
|
|
44365
|
+
/** @description Qué se descuenta («Multas», «Prenda», «Permiso de circulación»), hasta 200 caracteres. Se imprime en la nota de compra. */
|
|
44366
|
+
description?: string | null;
|
|
44367
|
+
/** Format: uuid */
|
|
44368
|
+
category_id?: string;
|
|
44369
|
+
net_clp: number;
|
|
44370
|
+
tax_clp?: number | null;
|
|
44371
|
+
/** @enum {string} */
|
|
44372
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
44373
|
+
incurred_on?: string | null;
|
|
44374
|
+
/** Format: uuid */
|
|
44375
|
+
supplier_contact_id?: string | null;
|
|
44376
|
+
document_ref?: string | null;
|
|
44377
|
+
}[];
|
|
44378
|
+
};
|
|
44307
44379
|
};
|
|
44308
44380
|
};
|
|
44309
44381
|
};
|
|
@@ -44336,7 +44408,57 @@ interface paths {
|
|
|
44336
44408
|
* "void_reason": null,
|
|
44337
44409
|
* "voided_by": null,
|
|
44338
44410
|
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44339
|
-
* "updated_at": "2026-09-12T10:15:00.000Z"
|
|
44411
|
+
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44412
|
+
* "lines": [],
|
|
44413
|
+
* "vehicle": {
|
|
44414
|
+
* "id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44415
|
+
* "make": "Mazda",
|
|
44416
|
+
* "model": "CX-5",
|
|
44417
|
+
* "year": 2020,
|
|
44418
|
+
* "registration_number": "KXPT21"
|
|
44419
|
+
* },
|
|
44420
|
+
* "vehicle_count": 1,
|
|
44421
|
+
* "acquisition": {
|
|
44422
|
+
* "id": "7b0e1c52-3a1f-4d8e-9c2a-5f6b7c8d9e01",
|
|
44423
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
44424
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44425
|
+
* "kind": "compra",
|
|
44426
|
+
* "counterparty_contact_id": "22222222-0000-4000-8000-000000000003",
|
|
44427
|
+
* "acquired_on": "2026-09-12",
|
|
44428
|
+
* "purchase_note_id": "d5d5d5d5-0000-4000-8000-000000000001",
|
|
44429
|
+
* "consignment_contract_id": null,
|
|
44430
|
+
* "sale_note_id": null,
|
|
44431
|
+
* "net_clp": 5970000,
|
|
44432
|
+
* "tax_clp": null,
|
|
44433
|
+
* "tax_treatment": "no_gravado",
|
|
44434
|
+
* "borne_by": "automotora",
|
|
44435
|
+
* "generates_fiscal_credit": false,
|
|
44436
|
+
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44437
|
+
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44438
|
+
* "invoice_includes_iva": false,
|
|
44439
|
+
* "amount_paid_clp": 5970000
|
|
44440
|
+
* },
|
|
44441
|
+
* "retentions": [
|
|
44442
|
+
* {
|
|
44443
|
+
* "id": "9c1d2e3f-4a5b-4c6d-8e7f-0a1b2c3d4e5f",
|
|
44444
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44445
|
+
* "kind": "expense",
|
|
44446
|
+
* "description": "Multas",
|
|
44447
|
+
* "net_clp": 180000,
|
|
44448
|
+
* "tax_clp": null,
|
|
44449
|
+
* "tax_treatment": "no_gravado",
|
|
44450
|
+
* "incurred_on": "2026-09-12",
|
|
44451
|
+
* "purchase_note_id": "d5d5d5d5-0000-4000-8000-000000000001",
|
|
44452
|
+
* "retained": true,
|
|
44453
|
+
* "voided_at": null
|
|
44454
|
+
* }
|
|
44455
|
+
* ],
|
|
44456
|
+
* "previous": {
|
|
44457
|
+
* "net_clp": 6200000,
|
|
44458
|
+
* "tax_clp": null,
|
|
44459
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44460
|
+
* "discounts_clp": 180000
|
|
44461
|
+
* }
|
|
44340
44462
|
* }
|
|
44341
44463
|
* }
|
|
44342
44464
|
*/
|
|
@@ -44518,6 +44640,8 @@ interface paths {
|
|
|
44518
44640
|
*
|
|
44519
44641
|
* The actor comes from the authenticated principal; a `voided_by` in the body is IGNORED rather than rejected — a self-declared actor is not an attestation. Voiding twice is a **409**: the first actor and reason stand.
|
|
44520
44642
|
*
|
|
44643
|
+
* **The car keeps its cost** (vitrina-app#7723): in the same transaction each car the note bought keeps the note’s total (payout + «Descuentos») as a plain Costo de compra, no longer linked to the note, and the Descuentos stop counting apart. That cost can then be corrected by typing it (`POST /vehicle-acquisitions`) or taken over by a new nota de compra. `void_outcome` says what happened per car, and `void_outcome.message` is ready to show as is. Voiding a voided note is a 409 `purchase_note_voided`.
|
|
44644
|
+
*
|
|
44521
44645
|
* Requires `purchase_notes:void`, which is a DIFFERENT authority from `purchase_notes:write` — holding the write scope does not permit a void.
|
|
44522
44646
|
*/
|
|
44523
44647
|
post: {
|
|
@@ -44573,7 +44697,20 @@ interface paths {
|
|
|
44573
44697
|
* "void_reason": "se anuló la compra: el vendedor desistió antes de firmar",
|
|
44574
44698
|
* "voided_by": "11111111-0000-4000-8000-000000000001",
|
|
44575
44699
|
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44576
|
-
* "updated_at": "2026-09-12T10:15:00.000Z"
|
|
44700
|
+
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44701
|
+
* "lines": [],
|
|
44702
|
+
* "void_outcome": {
|
|
44703
|
+
* "vehicles": [
|
|
44704
|
+
* {
|
|
44705
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
|
|
44706
|
+
* "acquisition_id": "7b0e1c52-3a1f-4d8e-9c2a-5f6b7c8d9e01",
|
|
44707
|
+
* "purchase_cost_clp": 6200000,
|
|
44708
|
+
* "invoice_includes_iva": false,
|
|
44709
|
+
* "discounts_clp": 180000
|
|
44710
|
+
* }
|
|
44711
|
+
* ],
|
|
44712
|
+
* "message": "Anulaste la nota de compra P-9. El Mazda CX-5 2020 (KXPT21) conserva su costo de compra de $6.200.000 como costo escrito a mano: puedes corregirlo en la ficha del auto o registrar una nota de compra nueva. Los descuentos de la nota ($180.000) ya no se cuentan aparte: quedan dentro de ese costo."
|
|
44713
|
+
* }
|
|
44577
44714
|
* }
|
|
44578
44715
|
* }
|
|
44579
44716
|
*/
|
package/package.json
CHANGED