@vitrina/api 17.89.0 → 17.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -18772,6 +18772,8 @@ interface paths {
18772
18772
  *
18773
18773
  * **Costo de compra in the same call (`purchase_cost_clp`).** Optional (vitrina-app#7719). The amount the dealership paid, recorded as the car’s Costo de compra exactly as `POST /vehicle-acquisitions` with `kind: "compra"` would; `invoice_includes_iva: true` says it includes IVA («Compra con factura»). Needs `dealership_economics:write`: without it the call is a **403 and nothing is saved**. The response then carries `acquisition` (the recorded row, the same shape `POST /vehicle-acquisitions` returns, shown only to callers holding `dealership_economics:read`); `acquisition: null` means the car was saved but its cost was not, and it can be typed on the car’s page. Both fields are create-only.
18774
18774
  *
18775
+ * **Creating a car by its plate alone.** Every field is optional: a form that creates the car from inside another document (the nota de compra, the «Auto en parte de pago» of a sale) sends `registration_number` plus whatever marca, modelo and año the dealer has (`GET /pricing/decode-plate` fills them when it knows the plate; its 404 means it does not). Without `publish_to` the car is on no portal. A plate another active car of the workspace already has is a **409 `CONFLICT`** whose `error.details` names that car: `vehicle_id` (the one to offer instead), `vehicle_ids` (every holder, newest first) and `vehicle_status` (its Estado comercial; `vendido` is a sold car still holding the plate, not one a document can take). A hidden car (`active: false`, not sold, not deleted) holding the plate answers the same 409 with `reason: "plate_inactive_holder"` and the same three fields: offer that car (it is made public again with `PUT /vehicles/{id} { active: true }`) instead of creating a second one. A sold car never blocks: a returning plate is a new car. Nothing is created on a 409.
18776
+ *
18775
18777
  * **Sanity range.** A price fans out to every connected portal, so a typo is stopped here. `price_amount` must be between 100.000 and 2.000.000.000 CLP (a UF price is bounded at the day's UF; other currencies are not bounded) and `odometer_value` between 0 and 2.000.000; `null` clears either and is always accepted. Outside the range: **422 `VEHICLE_VALUE_OUT_OF_RANGE`**, with a Spanish `message`, `field_errors.<field>` and `details.violations[]` (`field`, `reason` = `price_out_of_range` | `km_out_of_range`, `value`, `min`, `max`, `currency`). A price change beyond 10x up or down from the current price answers **422 `PRICE_CHANGE_CONFIRMATION_REQUIRED`** (`details.reason` = `large_price_change`, `current_price`, `requested_price`, `currency`, `factor`, `confirm_flag`) unless the body carries `confirm_large_price_change: true`; ask the user, then resend the same body with it. Nothing is written on either 422.
18776
18778
  *
18777
18779
  * **Normalization and `catalog_match`.** On create and update, `make` and `model` that equal an entry of GET /vehicles/catalog/brands and /catalog/models up to case, accents, spaces and hyphens are stored in the catalog's spelling ("toyota" → "Toyota", "mercedes benz" → "Mercedes-Benz", "rav 4" → "RAV4"); `fuel_type`, `gear_type` and `body_style` are stored as vocabulary codes ("Bencina" → `gasolina`, "Automática" → `automatica`, "Station Wagon" → `wagon`; codes: fuel `gasolina|diesel|hibrido|electrico|gnc|glp|otro`, gear `mecanica|automatica|otro`, body `sedan|hatchback|suv|camioneta|coupe|wagon|furgon|convertible|minivan|otro`; for `vehicle_type: moto` body_style is the «Tipo de moto» instead: `moto_calle|moto_deportiva|moto_touring|moto_trail|moto_enduro|moto_scooter|moto_custom|moto_cuatrimoto|moto_otro`, and "Trail" / "BODY.MOTORCYCLE.TRAIL" snap to `moto_trail`). Nothing is invented: a value with no match is stored exactly as sent. The response (and GET /vehicles/{id}) carries `catalog_match`: `make` / `model` are `matched` | `unmatched` | `missing` (`not_applicable` for a non-`auto` vehicle_type); `version` adds `approximate` (word overlap with a catalog version, same displacement) and `catalog_version` names the catalog version it matched or most resembles; `fuel_type` / `gear_type` / `body_style` are `matched` | `unmatched` | `missing`; `warnings[]` lists `{ field, code, message }` for everything not matched, with a Spanish `message` ready to show (codes: `make_missing`, `make_not_in_catalog`, `model_missing`, `model_not_in_catalog`, `version_approximate`, `version_not_in_catalog`, `fuel_type_not_recognized`, `gear_type_not_recognized`, `body_style_not_recognized`). A make or model that is not matched still saves, but Chileautos publishes it without a technical sheet (ficha). `catalog_match` is null only when the catalog could not be loaded. Example of an unmatched push: {"make":"matched","model":"unmatched","version":"unmatched","catalog_version":null,"fuel_type":"unmatched","gear_type":"matched","body_style":"missing","warnings":[{"field":"model","code":"model_not_in_catalog","message":"Modelo 'Rav-4 xx' no está en el catálogo de Toyota (GET /vehicles/catalog/models); Chileautos lo publicará sin ficha."},{"field":"fuel_type","code":"fuel_type_not_recognized","message":"Combustible 'Hidrógeno' no se reconoce; valores aceptados: gasolina, diesel, hibrido, electrico, gnc, glp, otro."}]}
package/dist/index.d.ts CHANGED
@@ -18772,6 +18772,8 @@ interface paths {
18772
18772
  *
18773
18773
  * **Costo de compra in the same call (`purchase_cost_clp`).** Optional (vitrina-app#7719). The amount the dealership paid, recorded as the car’s Costo de compra exactly as `POST /vehicle-acquisitions` with `kind: "compra"` would; `invoice_includes_iva: true` says it includes IVA («Compra con factura»). Needs `dealership_economics:write`: without it the call is a **403 and nothing is saved**. The response then carries `acquisition` (the recorded row, the same shape `POST /vehicle-acquisitions` returns, shown only to callers holding `dealership_economics:read`); `acquisition: null` means the car was saved but its cost was not, and it can be typed on the car’s page. Both fields are create-only.
18774
18774
  *
18775
+ * **Creating a car by its plate alone.** Every field is optional: a form that creates the car from inside another document (the nota de compra, the «Auto en parte de pago» of a sale) sends `registration_number` plus whatever marca, modelo and año the dealer has (`GET /pricing/decode-plate` fills them when it knows the plate; its 404 means it does not). Without `publish_to` the car is on no portal. A plate another active car of the workspace already has is a **409 `CONFLICT`** whose `error.details` names that car: `vehicle_id` (the one to offer instead), `vehicle_ids` (every holder, newest first) and `vehicle_status` (its Estado comercial; `vendido` is a sold car still holding the plate, not one a document can take). A hidden car (`active: false`, not sold, not deleted) holding the plate answers the same 409 with `reason: "plate_inactive_holder"` and the same three fields: offer that car (it is made public again with `PUT /vehicles/{id} { active: true }`) instead of creating a second one. A sold car never blocks: a returning plate is a new car. Nothing is created on a 409.
18776
+ *
18775
18777
  * **Sanity range.** A price fans out to every connected portal, so a typo is stopped here. `price_amount` must be between 100.000 and 2.000.000.000 CLP (a UF price is bounded at the day's UF; other currencies are not bounded) and `odometer_value` between 0 and 2.000.000; `null` clears either and is always accepted. Outside the range: **422 `VEHICLE_VALUE_OUT_OF_RANGE`**, with a Spanish `message`, `field_errors.<field>` and `details.violations[]` (`field`, `reason` = `price_out_of_range` | `km_out_of_range`, `value`, `min`, `max`, `currency`). A price change beyond 10x up or down from the current price answers **422 `PRICE_CHANGE_CONFIRMATION_REQUIRED`** (`details.reason` = `large_price_change`, `current_price`, `requested_price`, `currency`, `factor`, `confirm_flag`) unless the body carries `confirm_large_price_change: true`; ask the user, then resend the same body with it. Nothing is written on either 422.
18776
18778
  *
18777
18779
  * **Normalization and `catalog_match`.** On create and update, `make` and `model` that equal an entry of GET /vehicles/catalog/brands and /catalog/models up to case, accents, spaces and hyphens are stored in the catalog's spelling ("toyota" → "Toyota", "mercedes benz" → "Mercedes-Benz", "rav 4" → "RAV4"); `fuel_type`, `gear_type` and `body_style` are stored as vocabulary codes ("Bencina" → `gasolina`, "Automática" → `automatica`, "Station Wagon" → `wagon`; codes: fuel `gasolina|diesel|hibrido|electrico|gnc|glp|otro`, gear `mecanica|automatica|otro`, body `sedan|hatchback|suv|camioneta|coupe|wagon|furgon|convertible|minivan|otro`; for `vehicle_type: moto` body_style is the «Tipo de moto» instead: `moto_calle|moto_deportiva|moto_touring|moto_trail|moto_enduro|moto_scooter|moto_custom|moto_cuatrimoto|moto_otro`, and "Trail" / "BODY.MOTORCYCLE.TRAIL" snap to `moto_trail`). Nothing is invented: a value with no match is stored exactly as sent. The response (and GET /vehicles/{id}) carries `catalog_match`: `make` / `model` are `matched` | `unmatched` | `missing` (`not_applicable` for a non-`auto` vehicle_type); `version` adds `approximate` (word overlap with a catalog version, same displacement) and `catalog_version` names the catalog version it matched or most resembles; `fuel_type` / `gear_type` / `body_style` are `matched` | `unmatched` | `missing`; `warnings[]` lists `{ field, code, message }` for everything not matched, with a Spanish `message` ready to show (codes: `make_missing`, `make_not_in_catalog`, `model_missing`, `model_not_in_catalog`, `version_approximate`, `version_not_in_catalog`, `fuel_type_not_recognized`, `gear_type_not_recognized`, `body_style_not_recognized`). A make or model that is not matched still saves, but Chileautos publishes it without a technical sheet (ficha). `catalog_match` is null only when the catalog could not be loaded. Example of an unmatched push: {"make":"matched","model":"unmatched","version":"unmatched","catalog_version":null,"fuel_type":"unmatched","gear_type":"matched","body_style":"missing","warnings":[{"field":"model","code":"model_not_in_catalog","message":"Modelo 'Rav-4 xx' no está en el catálogo de Toyota (GET /vehicles/catalog/models); Chileautos lo publicará sin ficha."},{"field":"fuel_type","code":"fuel_type_not_recognized","message":"Combustible 'Hidrógeno' no se reconoce; valores aceptados: gasolina, diesel, hibrido, electrico, gnc, glp, otro."}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "17.89.0",
3
+ "version": "17.90.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",