@vitrina/api 17.101.0 → 17.101.2
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 +46 -3
- package/dist/index.d.ts +46 -3
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -42030,6 +42030,8 @@ interface paths {
|
|
|
42030
42030
|
* Approve a nota de venta (the sale fan-out)
|
|
42031
42031
|
* @description **Below the floor without `price_approval:approve` (app#7589):** **409** `details.reason: price_approval_required` with `details.price_approval_pending` and `details.price_approval_id`. When none was pending the call files one in the caller's name first, so the answer always says the approval is requested: «No puedes cerrar la venta V-41 todavía: el precio está bajo el mínimo y un administrador tiene que aprobarlo primero. La aprobación del precio ya está pedida.» The answer carries `price_approval` like every note read.
|
|
42032
42032
|
*
|
|
42033
|
+
* **Closed by a member holding `price_approval:approve` (app#7704):** the note’s pending price request (if any, and not filed by that same member) is resolved `approved` by them in the same transaction, audited as `price_approvals.decide`; it leaves the approval queue and its count.
|
|
42034
|
+
*
|
|
42033
42035
|
* Approves the document — the instant it becomes **legally valid** (BR-485) and the instant every consequence of the sale fires. All of it happens in **ONE database transaction**, so either all of it happened or none of it did:
|
|
42034
42036
|
*
|
|
42035
42037
|
* * the document is stamped with WHO approved it and WHEN (BR-484);
|
|
@@ -42307,6 +42309,8 @@ interface paths {
|
|
|
42307
42309
|
* Void a nota de venta
|
|
42308
42310
|
* @description Voids the document. It is **never deleted and it KEEPS ITS FOLIO** (ADR 0058 §10): the row records the time, the reason and the acting principal and remains listable. There is deliberately no `DELETE` verb on this resource.
|
|
42309
42311
|
*
|
|
42312
|
+
* Its pending price requests are withdrawn in the same transaction (app#7704): resolved `rejected` by the voider with a note saying the sale was voided, audited as `price_approvals.decide`; they leave the approval queue and its count.
|
|
42313
|
+
*
|
|
42310
42314
|
* `void_reason` is mandatory and must contain VISIBLE text — a reason made only of whitespace, a U+00A0 or a zero-width space is refused at the edge and by a table CHECK, because a reason nobody can see is not a reason.
|
|
42311
42315
|
*
|
|
42312
42316
|
* 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.
|
|
@@ -43960,7 +43964,13 @@ interface paths {
|
|
|
43960
43964
|
};
|
|
43961
43965
|
/**
|
|
43962
43966
|
* List notas de compra
|
|
43963
|
-
* @description
|
|
43967
|
+
* @description **Every row carries `vehicle_ref`, the car it names**, read in ONE tenant-scoped batch for the page so a client never fetches the cars one by one: `{ id, title, make, model, version, year, registration_number, deleted }` (`registration_number` is the patente). It is served whatever the car’s state — sold, inactive, merged away or removed from Stock (`deleted: true`, last known name and plate kept) — and to any caller who may read the list, without `marketplace:read` and whatever sucursal the car sits at. `null` only when the row names no car or the car row is gone.
|
|
43968
|
+
*
|
|
43969
|
+
* **Every row carries `contact_ref`, the person it names** (the buyer of a nota de venta or cotización, the holder of a reserva, the owner of a consignación), read in ONE tenant-scoped batch for the page so a client never fetches the contacts one by one: `{ id, name, tax_id, tax_id_kind, archived }`. `name` is the display name; `archived: true` = archived or merged away (the name is kept). `tax_id` / `tax_id_kind` (the RUT) are `null` unless the caller also holds `contacts:read`. `null` only when the row names nobody or the contact row is gone.
|
|
43970
|
+
*
|
|
43971
|
+
* Here `contact_ref` is the SELLER (`seller_contact_id`) and `vehicle_ref` the first unit the document bought (the same car as `vehicle`).
|
|
43972
|
+
*
|
|
43973
|
+
* The dealership’s PURCHASE documents, newest first by `issued_at`. A nota de compra is the instrument that CREATES a cost — the unit’s cost basis comes from it, linked through `vehicle_acquisition.purchase_note_id`.
|
|
43964
43974
|
*
|
|
43965
43975
|
* **Voided documents are INCLUDED by default** — a voided nota de compra keeps its folio and stays listable so "where is nota de compra #47?" has an answer (ADR 0058 §10, BR-650–655). Pass `exclude_voided=true` to see only live ones; only the literal string `true` opts in, so `exclude_voided=false` does not hide them.
|
|
43966
43976
|
*
|
|
@@ -44018,7 +44028,32 @@ interface paths {
|
|
|
44018
44028
|
* "voided_by": null,
|
|
44019
44029
|
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44020
44030
|
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44021
|
-
* "sale_note_display_id": null
|
|
44031
|
+
* "sale_note_display_id": null,
|
|
44032
|
+
* "vehicle": {
|
|
44033
|
+
* "id": "f2a1c3d4-5b6e-4f70-8a91-b2c3d4e5f6a7",
|
|
44034
|
+
* "make": "Volvo",
|
|
44035
|
+
* "model": "S60",
|
|
44036
|
+
* "year": 2019,
|
|
44037
|
+
* "registration_number": "GDSL82"
|
|
44038
|
+
* },
|
|
44039
|
+
* "vehicle_count": 1,
|
|
44040
|
+
* "vehicle_ref": {
|
|
44041
|
+
* "id": "f2a1c3d4-5b6e-4f70-8a91-b2c3d4e5f6a7",
|
|
44042
|
+
* "title": null,
|
|
44043
|
+
* "make": "Volvo",
|
|
44044
|
+
* "model": "S60",
|
|
44045
|
+
* "version": "2.0 T5 Momentum",
|
|
44046
|
+
* "year": 2019,
|
|
44047
|
+
* "registration_number": "GDSL82",
|
|
44048
|
+
* "deleted": false
|
|
44049
|
+
* },
|
|
44050
|
+
* "contact_ref": {
|
|
44051
|
+
* "id": "22222222-0000-4000-8000-000000000003",
|
|
44052
|
+
* "name": "María José Fuentes",
|
|
44053
|
+
* "tax_id": "15432100-4",
|
|
44054
|
+
* "tax_id_kind": "rut",
|
|
44055
|
+
* "archived": false
|
|
44056
|
+
* }
|
|
44022
44057
|
* }
|
|
44023
44058
|
* ],
|
|
44024
44059
|
* "meta": {
|
|
@@ -49953,6 +49988,8 @@ interface paths {
|
|
|
49953
49988
|
* **Every row carries `subject`** (app#7589), the document the approval is about, read in one batch for the page: `{ kind: quote|reservation|sale_note, id, display_id, contact_ref, unit_label, unit_plate }`. `contact_ref` is the person, as on every dealer list (its RUT only with `contacts:read`); `unit_label` / `unit_plate` are the unit the cotización froze (null on a reserva or nota de venta). `null` only when the document row is gone.
|
|
49954
49989
|
*
|
|
49955
49990
|
* Oldest-first. Cost fields (e.g. `floor_price_snapshot_clp`) are ABSENT from the response unless the caller also holds `dealership_economics:read`.
|
|
49991
|
+
*
|
|
49992
|
+
* `status=pending` lists only requests still waiting (app#7704): a request on a voided nota de venta, or an ordinary request on a nota de venta that was closed anyway, is not listed nor counted in `meta.total`.
|
|
49956
49993
|
*/
|
|
49957
49994
|
get: {
|
|
49958
49995
|
parameters: {
|
|
@@ -185067,6 +185104,8 @@ interface paths {
|
|
|
185067
185104
|
* Filter by `vehicle_id` and/or `estado`, with `limit` / `offset`. No total is returned — the response carries the rows and nothing else.
|
|
185068
185105
|
*
|
|
185069
185106
|
* Each row also carries (app#7589) `dueno_name` (the consignante, `null` without one) and `liquidacion`: the booked settlement as `{ id, settlement_mode, amount_venta_clp, comision_type, comision_value, comision_amount_clp, comision_iva_clp, comision_minima_applied, monto_owner_clp, deducciones_clp, payout_method, paid_at }`, or `null` when the contract has none (a sale not settled yet, a return that moved no money). `comision_minima_applied: true` = the Comisión mínima won over the percentage: read the commission as «Comisión mínima». A list screen needs no per-contract `GET /consignments/{id}/liquidacion`.
|
|
185107
|
+
*
|
|
185108
|
+
* And (app#7704) `contract_document`: the mandato currently issued for the contract as `{ id, rendered_at }` (the `current` artefact of `GET /consignments/{id}/contract`), or `null` when none was ever issued, which is «Contrato sin emitir». Read in one batch for the page: a list screen needs no per-contract `GET /consignments/{id}/contract`.
|
|
185070
185109
|
*/
|
|
185071
185110
|
get: {
|
|
185072
185111
|
parameters: {
|
|
@@ -185134,6 +185173,10 @@ interface paths {
|
|
|
185134
185173
|
* "tax_id": "15432100-4",
|
|
185135
185174
|
* "tax_id_kind": "rut",
|
|
185136
185175
|
* "archived": false
|
|
185176
|
+
* },
|
|
185177
|
+
* "contract_document": {
|
|
185178
|
+
* "id": "6f0e2d1c-3b4a-4c5d-8e6f-7a8b9c0d1e2f",
|
|
185179
|
+
* "rendered_at": "2026-08-20T10:05:00.000Z"
|
|
185137
185180
|
* }
|
|
185138
185181
|
* }
|
|
185139
185182
|
* ],
|
|
@@ -185660,7 +185703,7 @@ interface paths {
|
|
|
185660
185703
|
*
|
|
185661
185704
|
* Moving `vencimiento` RE-ARMS the expiry reminder: the "already reminded" stamp is cleared, so a pushed-out date produces a fresh nudge rather than staying silent.
|
|
185662
185705
|
*
|
|
185663
|
-
* Supplying `minimo_clp` RENEGOTIATES the mínimo rather than editing a column: it appends an immutable revision to the contract’s terms history (`GET /consignments/{id}/terms`), dated `minimo_effective_on` or today. `precio_cliente_clp` is the same field under its new name. Sending the value already governing, with no `minimo_effective_on`, is a no-op (a form may resend every field)
|
|
185706
|
+
* Supplying `minimo_clp` RENEGOTIATES the mínimo rather than editing a column: it appends an immutable revision to the contract’s terms history (`GET /consignments/{id}/terms`), dated `minimo_effective_on` or today. `precio_cliente_clp` is the same field under its new name. Sending the value already governing, with no `minimo_effective_on`, is a no-op (a form may resend every field). A different value on a date that already has a revision, today or later, CORRECTS it (app#7704): that revision is marked replaced and the new value governs the same date, so the date keeps one revision with the last value (the audit row keeps the previous one). A date already past is never rewritten: a second revision there is a **409**.
|
|
185664
185707
|
*
|
|
185665
185708
|
* A raised Precio cliente writes through to the vehicle’s floor while the contract is active. Withdrawing it (null) clears the floor only while the floor still holds the withdrawn price, so a floor the dealer set by hand is kept; the contract ending never clears it.
|
|
185666
185709
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -42030,6 +42030,8 @@ interface paths {
|
|
|
42030
42030
|
* Approve a nota de venta (the sale fan-out)
|
|
42031
42031
|
* @description **Below the floor without `price_approval:approve` (app#7589):** **409** `details.reason: price_approval_required` with `details.price_approval_pending` and `details.price_approval_id`. When none was pending the call files one in the caller's name first, so the answer always says the approval is requested: «No puedes cerrar la venta V-41 todavía: el precio está bajo el mínimo y un administrador tiene que aprobarlo primero. La aprobación del precio ya está pedida.» The answer carries `price_approval` like every note read.
|
|
42032
42032
|
*
|
|
42033
|
+
* **Closed by a member holding `price_approval:approve` (app#7704):** the note’s pending price request (if any, and not filed by that same member) is resolved `approved` by them in the same transaction, audited as `price_approvals.decide`; it leaves the approval queue and its count.
|
|
42034
|
+
*
|
|
42033
42035
|
* Approves the document — the instant it becomes **legally valid** (BR-485) and the instant every consequence of the sale fires. All of it happens in **ONE database transaction**, so either all of it happened or none of it did:
|
|
42034
42036
|
*
|
|
42035
42037
|
* * the document is stamped with WHO approved it and WHEN (BR-484);
|
|
@@ -42307,6 +42309,8 @@ interface paths {
|
|
|
42307
42309
|
* Void a nota de venta
|
|
42308
42310
|
* @description Voids the document. It is **never deleted and it KEEPS ITS FOLIO** (ADR 0058 §10): the row records the time, the reason and the acting principal and remains listable. There is deliberately no `DELETE` verb on this resource.
|
|
42309
42311
|
*
|
|
42312
|
+
* Its pending price requests are withdrawn in the same transaction (app#7704): resolved `rejected` by the voider with a note saying the sale was voided, audited as `price_approvals.decide`; they leave the approval queue and its count.
|
|
42313
|
+
*
|
|
42310
42314
|
* `void_reason` is mandatory and must contain VISIBLE text — a reason made only of whitespace, a U+00A0 or a zero-width space is refused at the edge and by a table CHECK, because a reason nobody can see is not a reason.
|
|
42311
42315
|
*
|
|
42312
42316
|
* 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.
|
|
@@ -43960,7 +43964,13 @@ interface paths {
|
|
|
43960
43964
|
};
|
|
43961
43965
|
/**
|
|
43962
43966
|
* List notas de compra
|
|
43963
|
-
* @description
|
|
43967
|
+
* @description **Every row carries `vehicle_ref`, the car it names**, read in ONE tenant-scoped batch for the page so a client never fetches the cars one by one: `{ id, title, make, model, version, year, registration_number, deleted }` (`registration_number` is the patente). It is served whatever the car’s state — sold, inactive, merged away or removed from Stock (`deleted: true`, last known name and plate kept) — and to any caller who may read the list, without `marketplace:read` and whatever sucursal the car sits at. `null` only when the row names no car or the car row is gone.
|
|
43968
|
+
*
|
|
43969
|
+
* **Every row carries `contact_ref`, the person it names** (the buyer of a nota de venta or cotización, the holder of a reserva, the owner of a consignación), read in ONE tenant-scoped batch for the page so a client never fetches the contacts one by one: `{ id, name, tax_id, tax_id_kind, archived }`. `name` is the display name; `archived: true` = archived or merged away (the name is kept). `tax_id` / `tax_id_kind` (the RUT) are `null` unless the caller also holds `contacts:read`. `null` only when the row names nobody or the contact row is gone.
|
|
43970
|
+
*
|
|
43971
|
+
* Here `contact_ref` is the SELLER (`seller_contact_id`) and `vehicle_ref` the first unit the document bought (the same car as `vehicle`).
|
|
43972
|
+
*
|
|
43973
|
+
* The dealership’s PURCHASE documents, newest first by `issued_at`. A nota de compra is the instrument that CREATES a cost — the unit’s cost basis comes from it, linked through `vehicle_acquisition.purchase_note_id`.
|
|
43964
43974
|
*
|
|
43965
43975
|
* **Voided documents are INCLUDED by default** — a voided nota de compra keeps its folio and stays listable so "where is nota de compra #47?" has an answer (ADR 0058 §10, BR-650–655). Pass `exclude_voided=true` to see only live ones; only the literal string `true` opts in, so `exclude_voided=false` does not hide them.
|
|
43966
43976
|
*
|
|
@@ -44018,7 +44028,32 @@ interface paths {
|
|
|
44018
44028
|
* "voided_by": null,
|
|
44019
44029
|
* "created_at": "2026-09-12T10:15:00.000Z",
|
|
44020
44030
|
* "updated_at": "2026-09-12T10:15:00.000Z",
|
|
44021
|
-
* "sale_note_display_id": null
|
|
44031
|
+
* "sale_note_display_id": null,
|
|
44032
|
+
* "vehicle": {
|
|
44033
|
+
* "id": "f2a1c3d4-5b6e-4f70-8a91-b2c3d4e5f6a7",
|
|
44034
|
+
* "make": "Volvo",
|
|
44035
|
+
* "model": "S60",
|
|
44036
|
+
* "year": 2019,
|
|
44037
|
+
* "registration_number": "GDSL82"
|
|
44038
|
+
* },
|
|
44039
|
+
* "vehicle_count": 1,
|
|
44040
|
+
* "vehicle_ref": {
|
|
44041
|
+
* "id": "f2a1c3d4-5b6e-4f70-8a91-b2c3d4e5f6a7",
|
|
44042
|
+
* "title": null,
|
|
44043
|
+
* "make": "Volvo",
|
|
44044
|
+
* "model": "S60",
|
|
44045
|
+
* "version": "2.0 T5 Momentum",
|
|
44046
|
+
* "year": 2019,
|
|
44047
|
+
* "registration_number": "GDSL82",
|
|
44048
|
+
* "deleted": false
|
|
44049
|
+
* },
|
|
44050
|
+
* "contact_ref": {
|
|
44051
|
+
* "id": "22222222-0000-4000-8000-000000000003",
|
|
44052
|
+
* "name": "María José Fuentes",
|
|
44053
|
+
* "tax_id": "15432100-4",
|
|
44054
|
+
* "tax_id_kind": "rut",
|
|
44055
|
+
* "archived": false
|
|
44056
|
+
* }
|
|
44022
44057
|
* }
|
|
44023
44058
|
* ],
|
|
44024
44059
|
* "meta": {
|
|
@@ -49953,6 +49988,8 @@ interface paths {
|
|
|
49953
49988
|
* **Every row carries `subject`** (app#7589), the document the approval is about, read in one batch for the page: `{ kind: quote|reservation|sale_note, id, display_id, contact_ref, unit_label, unit_plate }`. `contact_ref` is the person, as on every dealer list (its RUT only with `contacts:read`); `unit_label` / `unit_plate` are the unit the cotización froze (null on a reserva or nota de venta). `null` only when the document row is gone.
|
|
49954
49989
|
*
|
|
49955
49990
|
* Oldest-first. Cost fields (e.g. `floor_price_snapshot_clp`) are ABSENT from the response unless the caller also holds `dealership_economics:read`.
|
|
49991
|
+
*
|
|
49992
|
+
* `status=pending` lists only requests still waiting (app#7704): a request on a voided nota de venta, or an ordinary request on a nota de venta that was closed anyway, is not listed nor counted in `meta.total`.
|
|
49956
49993
|
*/
|
|
49957
49994
|
get: {
|
|
49958
49995
|
parameters: {
|
|
@@ -185067,6 +185104,8 @@ interface paths {
|
|
|
185067
185104
|
* Filter by `vehicle_id` and/or `estado`, with `limit` / `offset`. No total is returned — the response carries the rows and nothing else.
|
|
185068
185105
|
*
|
|
185069
185106
|
* Each row also carries (app#7589) `dueno_name` (the consignante, `null` without one) and `liquidacion`: the booked settlement as `{ id, settlement_mode, amount_venta_clp, comision_type, comision_value, comision_amount_clp, comision_iva_clp, comision_minima_applied, monto_owner_clp, deducciones_clp, payout_method, paid_at }`, or `null` when the contract has none (a sale not settled yet, a return that moved no money). `comision_minima_applied: true` = the Comisión mínima won over the percentage: read the commission as «Comisión mínima». A list screen needs no per-contract `GET /consignments/{id}/liquidacion`.
|
|
185107
|
+
*
|
|
185108
|
+
* And (app#7704) `contract_document`: the mandato currently issued for the contract as `{ id, rendered_at }` (the `current` artefact of `GET /consignments/{id}/contract`), or `null` when none was ever issued, which is «Contrato sin emitir». Read in one batch for the page: a list screen needs no per-contract `GET /consignments/{id}/contract`.
|
|
185070
185109
|
*/
|
|
185071
185110
|
get: {
|
|
185072
185111
|
parameters: {
|
|
@@ -185134,6 +185173,10 @@ interface paths {
|
|
|
185134
185173
|
* "tax_id": "15432100-4",
|
|
185135
185174
|
* "tax_id_kind": "rut",
|
|
185136
185175
|
* "archived": false
|
|
185176
|
+
* },
|
|
185177
|
+
* "contract_document": {
|
|
185178
|
+
* "id": "6f0e2d1c-3b4a-4c5d-8e6f-7a8b9c0d1e2f",
|
|
185179
|
+
* "rendered_at": "2026-08-20T10:05:00.000Z"
|
|
185137
185180
|
* }
|
|
185138
185181
|
* }
|
|
185139
185182
|
* ],
|
|
@@ -185660,7 +185703,7 @@ interface paths {
|
|
|
185660
185703
|
*
|
|
185661
185704
|
* Moving `vencimiento` RE-ARMS the expiry reminder: the "already reminded" stamp is cleared, so a pushed-out date produces a fresh nudge rather than staying silent.
|
|
185662
185705
|
*
|
|
185663
|
-
* Supplying `minimo_clp` RENEGOTIATES the mínimo rather than editing a column: it appends an immutable revision to the contract’s terms history (`GET /consignments/{id}/terms`), dated `minimo_effective_on` or today. `precio_cliente_clp` is the same field under its new name. Sending the value already governing, with no `minimo_effective_on`, is a no-op (a form may resend every field)
|
|
185706
|
+
* Supplying `minimo_clp` RENEGOTIATES the mínimo rather than editing a column: it appends an immutable revision to the contract’s terms history (`GET /consignments/{id}/terms`), dated `minimo_effective_on` or today. `precio_cliente_clp` is the same field under its new name. Sending the value already governing, with no `minimo_effective_on`, is a no-op (a form may resend every field). A different value on a date that already has a revision, today or later, CORRECTS it (app#7704): that revision is marked replaced and the new value governs the same date, so the date keeps one revision with the last value (the audit row keeps the previous one). A date already past is never rewritten: a second revision there is a **409**.
|
|
185664
185707
|
*
|
|
185665
185708
|
* A raised Precio cliente writes through to the vehicle’s floor while the contract is active. Withdrawing it (null) clears the floor only while the floor still holds the withdrawn price, so a floor the dealer set by hand is kept; the contract ending never clears it.
|
|
185666
185709
|
*
|
package/package.json
CHANGED