@vitrina/api 11.37.0 → 11.38.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
@@ -15030,7 +15030,9 @@ interface paths {
15030
15030
  put?: never;
15031
15031
  /**
15032
15032
  * Create a vehicle (manual stock)
15033
- * @description plate_normalized is server-derived from registration_number; a plate already claimed by another ACTIVE vehicle of the tenant returns 409 (conflicto de patente). A plate the Chilean grammar cannot read derives plate_normalized = null, so the DB backstop cannot see it: the service then compares the RAW value (upper/trim) against the tenant active stock and answers the SAME 409, and flags the unit under attributes.curated.needsReview = ["plate"] with curated.plateReason = "plate_unrecognized". The plate is never refused on its own merits (allow-and-flag, ADR 0022) — only a duplicate is.
15033
+ * @description plate_normalized is server-derived from registration_number; a plate already claimed by another ACTIVE vehicle of the tenant returns 409 (conflicto de patente).
15034
+ *
15035
+ * **Plate format.** For a road-registered type (`auto`, `camion`) a non-empty registration_number must be a Chilean plate: AB1234 (old series), BCDF12 (new series: consonants only, no M/N/Q), or for motorcycles AB123 / BCD12; separators, case and a trailing registry check digit are tolerated. Anything else is a 400 VALIDATION_ERROR with `details.reason = "plate_format_invalid"` and a Spanish `fieldErrors.registration_number`. An empty value and a pending declaration («en trámite») stay legal; `maquinaria`/`nautico` are not checked. Stock syncs from portals and feeds do not pass through this check.
15034
15036
  *
15035
15037
  * **Publish in the same call (`publish_to`).** Optional. Name the marketplaces this vehicle should go to — portal slugs such as `chileautos` / `mercadolibre`, or integration ids from GET /marketplaces — and it is published right after it is saved, through the same path as POST /vehicles/{id}/publish. Omitted or `[]` saves only; there is no default. Every entry is validated first: a portal with no connected account, a slug matching several accounts, or an id from another workspace answers **422 and nothing is saved**. Once saved, the vehicle stays saved: a portal that fails to publish is an `error` entry in `publications`, never a failed request (still 201). The response then carries `publications`, one `PublishOutcome` per account (`published`, `pending` for queued transports such as `chileautos_panel` and Facebook Marketplace, `already_published`, or `error` with the reason). `publications` is absent when `publish_to` was not sent.
15036
15038
  */
@@ -15630,7 +15632,7 @@ interface paths {
15630
15632
  };
15631
15633
  /**
15632
15634
  * Update a vehicle
15633
- * @description Updating registration_number re-derives plate_normalized; a collision with another ACTIVE vehicle of the tenant returns 409 (conflicto de patente).
15635
+ * @description Updating registration_number re-derives plate_normalized; a collision with another ACTIVE vehicle of the tenant returns 409 (conflicto de patente). A CHANGED plate is held to the same Chilean formats as on POST /vehicles (400 `plate_format_invalid`); re-sending the stored value unchanged is never refused.
15634
15636
  *
15635
15637
  * **`publish_to` only ADDS portals.** Same contract as on POST /vehicles (validated before the edit is written; 422 writes nothing; a portal failure is an `error` entry in `publications`, never a failed request). A portal where the vehicle is already live or has a queued publish is a no-op (`already_published`) — never a second ad, so an ERP may safely retry. A portal LEFT OUT of `publish_to` is NOT unpublished: removal is DELETE /vehicles/{id}/publications/{pubId}. A body with only `publish_to` publishes without editing the vehicle.
15636
15638
  */
@@ -38176,7 +38178,7 @@ interface paths {
38176
38178
  };
38177
38179
  /**
38178
38180
  * Export the deals and their margins (xlsx / csv)
38179
- * @description One row per live nota de venta in the window, with every settlement column: folio, date, status, patente, vehicle, regime, seller, buyer, buyer origin channel, leads, days in stock, published price, discount (amount and %), sale price, add-ons, revenue, purchase cost, gross margin, additional costs, commissions, net margin and `Completo`. A figure that is not recorded or not computable is an EMPTY cell, never 0.
38181
+ * @description One row per live nota de venta in the window, with every settlement column: folio, date, status, patente, vehicle, regime, seller, buyer, buyer origin channel, leads, days in stock, published price, discount (amount and %), total paid (with IVA), IVA, net sale price, retained add-ons, net revenue, purchase cost, gross margin, additional costs, commissions, net margin, pass-through add-ons (neutral) and `Completo`. A figure that is not recorded or not computable is an EMPTY cell, never 0.
38180
38182
  *
38181
38183
  * Pass `period` (`YYYY-MM`, the Margen screen’s month) OR `from`/`to` (`YYYY-MM-DD`, inclusive, on the dealership’s calendar) — one of the two is required (400 otherwise), never both. `format` is `xlsx` (default) or `csv`. **413** over 2000 deals. Requires `dealership_economics:read`.
38182
38184
  */
@@ -38334,7 +38336,8 @@ interface paths {
38334
38336
  * "total_clp": 11900000,
38335
38337
  * "discount_clp": 590000,
38336
38338
  * "discount_pct": 4.7,
38337
- * "add_on_charges_clp": 189900
38339
+ * "add_on_charges_clp": 100000,
38340
+ * "pass_through_clp": 89900
38338
38341
  * },
38339
38342
  * "basis": {
38340
38343
  * "regime": "propia",
@@ -38411,23 +38414,24 @@ interface paths {
38411
38414
  * "issued_at": "2026-09-19T13:00:00.000Z",
38412
38415
  * "period": "2026-09",
38413
38416
  * "regime": "propia",
38414
- * "ingresos_clp": 12089900,
38417
+ * "ingresos_clp": 12000000,
38415
38418
  * "revenue_terms": {
38416
38419
  * "precio_venta_clp": 11900000,
38417
- * "add_on_charges_clp": 189900,
38420
+ * "add_on_charges_clp": 100000,
38421
+ * "pass_through_clp": 89900,
38418
38422
  * "dealer_take_clp": null
38419
38423
  * },
38420
38424
  * "costo_venta_clp": 9800000,
38421
- * "margen_bruto_clp": 2289900,
38425
+ * "margen_bruto_clp": 2200000,
38422
38426
  * "deductions": {
38423
- * "comisiones_vendedores_clp": 229000,
38424
- * "gastos_adicionales_clp": 579900,
38427
+ * "comisiones_vendedores_clp": 220000,
38428
+ * "gastos_adicionales_clp": 490000,
38425
38429
  * "gastos_unidad_clp": 640000,
38426
38430
  * "ingresos_unidad_clp": 150000,
38427
- * "desembolsos_add_on_clp": 89900,
38431
+ * "desembolsos_add_on_clp": 0,
38428
38432
  * "gastos_fijos_clp": null
38429
38433
  * },
38430
- * "margen_neto_clp": 1481000,
38434
+ * "margen_neto_clp": 1490000,
38431
38435
  * "settlement": null,
38432
38436
  * "cost_rollup": {
38433
38437
  * "acquisition_net_clp": 9800000,
@@ -38468,16 +38472,16 @@ interface paths {
38468
38472
  * "name": "Carla Rojas",
38469
38473
  * "role": "closer",
38470
38474
  * "commission_rate_bp": 800,
38471
- * "commission_basis_clp": 2289900,
38472
- * "commission_clp": 183192
38475
+ * "commission_basis_clp": 2200000,
38476
+ * "commission_clp": 176000
38473
38477
  * },
38474
38478
  * {
38475
38479
  * "user_id": "a1a1a1a1-0000-4000-8000-000000000002",
38476
38480
  * "name": "Diego Muñoz",
38477
38481
  * "role": "collaborator",
38478
38482
  * "commission_rate_bp": 200,
38479
- * "commission_basis_clp": 2289900,
38480
- * "commission_clp": 45798
38483
+ * "commission_basis_clp": 2200000,
38484
+ * "commission_clp": 44000
38481
38485
  * }
38482
38486
  * ],
38483
38487
  * "salesperson": {
package/dist/index.d.ts CHANGED
@@ -15030,7 +15030,9 @@ interface paths {
15030
15030
  put?: never;
15031
15031
  /**
15032
15032
  * Create a vehicle (manual stock)
15033
- * @description plate_normalized is server-derived from registration_number; a plate already claimed by another ACTIVE vehicle of the tenant returns 409 (conflicto de patente). A plate the Chilean grammar cannot read derives plate_normalized = null, so the DB backstop cannot see it: the service then compares the RAW value (upper/trim) against the tenant active stock and answers the SAME 409, and flags the unit under attributes.curated.needsReview = ["plate"] with curated.plateReason = "plate_unrecognized". The plate is never refused on its own merits (allow-and-flag, ADR 0022) — only a duplicate is.
15033
+ * @description plate_normalized is server-derived from registration_number; a plate already claimed by another ACTIVE vehicle of the tenant returns 409 (conflicto de patente).
15034
+ *
15035
+ * **Plate format.** For a road-registered type (`auto`, `camion`) a non-empty registration_number must be a Chilean plate: AB1234 (old series), BCDF12 (new series: consonants only, no M/N/Q), or for motorcycles AB123 / BCD12; separators, case and a trailing registry check digit are tolerated. Anything else is a 400 VALIDATION_ERROR with `details.reason = "plate_format_invalid"` and a Spanish `fieldErrors.registration_number`. An empty value and a pending declaration («en trámite») stay legal; `maquinaria`/`nautico` are not checked. Stock syncs from portals and feeds do not pass through this check.
15034
15036
  *
15035
15037
  * **Publish in the same call (`publish_to`).** Optional. Name the marketplaces this vehicle should go to — portal slugs such as `chileautos` / `mercadolibre`, or integration ids from GET /marketplaces — and it is published right after it is saved, through the same path as POST /vehicles/{id}/publish. Omitted or `[]` saves only; there is no default. Every entry is validated first: a portal with no connected account, a slug matching several accounts, or an id from another workspace answers **422 and nothing is saved**. Once saved, the vehicle stays saved: a portal that fails to publish is an `error` entry in `publications`, never a failed request (still 201). The response then carries `publications`, one `PublishOutcome` per account (`published`, `pending` for queued transports such as `chileautos_panel` and Facebook Marketplace, `already_published`, or `error` with the reason). `publications` is absent when `publish_to` was not sent.
15036
15038
  */
@@ -15630,7 +15632,7 @@ interface paths {
15630
15632
  };
15631
15633
  /**
15632
15634
  * Update a vehicle
15633
- * @description Updating registration_number re-derives plate_normalized; a collision with another ACTIVE vehicle of the tenant returns 409 (conflicto de patente).
15635
+ * @description Updating registration_number re-derives plate_normalized; a collision with another ACTIVE vehicle of the tenant returns 409 (conflicto de patente). A CHANGED plate is held to the same Chilean formats as on POST /vehicles (400 `plate_format_invalid`); re-sending the stored value unchanged is never refused.
15634
15636
  *
15635
15637
  * **`publish_to` only ADDS portals.** Same contract as on POST /vehicles (validated before the edit is written; 422 writes nothing; a portal failure is an `error` entry in `publications`, never a failed request). A portal where the vehicle is already live or has a queued publish is a no-op (`already_published`) — never a second ad, so an ERP may safely retry. A portal LEFT OUT of `publish_to` is NOT unpublished: removal is DELETE /vehicles/{id}/publications/{pubId}. A body with only `publish_to` publishes without editing the vehicle.
15636
15638
  */
@@ -38176,7 +38178,7 @@ interface paths {
38176
38178
  };
38177
38179
  /**
38178
38180
  * Export the deals and their margins (xlsx / csv)
38179
- * @description One row per live nota de venta in the window, with every settlement column: folio, date, status, patente, vehicle, regime, seller, buyer, buyer origin channel, leads, days in stock, published price, discount (amount and %), sale price, add-ons, revenue, purchase cost, gross margin, additional costs, commissions, net margin and `Completo`. A figure that is not recorded or not computable is an EMPTY cell, never 0.
38181
+ * @description One row per live nota de venta in the window, with every settlement column: folio, date, status, patente, vehicle, regime, seller, buyer, buyer origin channel, leads, days in stock, published price, discount (amount and %), total paid (with IVA), IVA, net sale price, retained add-ons, net revenue, purchase cost, gross margin, additional costs, commissions, net margin, pass-through add-ons (neutral) and `Completo`. A figure that is not recorded or not computable is an EMPTY cell, never 0.
38180
38182
  *
38181
38183
  * Pass `period` (`YYYY-MM`, the Margen screen’s month) OR `from`/`to` (`YYYY-MM-DD`, inclusive, on the dealership’s calendar) — one of the two is required (400 otherwise), never both. `format` is `xlsx` (default) or `csv`. **413** over 2000 deals. Requires `dealership_economics:read`.
38182
38184
  */
@@ -38334,7 +38336,8 @@ interface paths {
38334
38336
  * "total_clp": 11900000,
38335
38337
  * "discount_clp": 590000,
38336
38338
  * "discount_pct": 4.7,
38337
- * "add_on_charges_clp": 189900
38339
+ * "add_on_charges_clp": 100000,
38340
+ * "pass_through_clp": 89900
38338
38341
  * },
38339
38342
  * "basis": {
38340
38343
  * "regime": "propia",
@@ -38411,23 +38414,24 @@ interface paths {
38411
38414
  * "issued_at": "2026-09-19T13:00:00.000Z",
38412
38415
  * "period": "2026-09",
38413
38416
  * "regime": "propia",
38414
- * "ingresos_clp": 12089900,
38417
+ * "ingresos_clp": 12000000,
38415
38418
  * "revenue_terms": {
38416
38419
  * "precio_venta_clp": 11900000,
38417
- * "add_on_charges_clp": 189900,
38420
+ * "add_on_charges_clp": 100000,
38421
+ * "pass_through_clp": 89900,
38418
38422
  * "dealer_take_clp": null
38419
38423
  * },
38420
38424
  * "costo_venta_clp": 9800000,
38421
- * "margen_bruto_clp": 2289900,
38425
+ * "margen_bruto_clp": 2200000,
38422
38426
  * "deductions": {
38423
- * "comisiones_vendedores_clp": 229000,
38424
- * "gastos_adicionales_clp": 579900,
38427
+ * "comisiones_vendedores_clp": 220000,
38428
+ * "gastos_adicionales_clp": 490000,
38425
38429
  * "gastos_unidad_clp": 640000,
38426
38430
  * "ingresos_unidad_clp": 150000,
38427
- * "desembolsos_add_on_clp": 89900,
38431
+ * "desembolsos_add_on_clp": 0,
38428
38432
  * "gastos_fijos_clp": null
38429
38433
  * },
38430
- * "margen_neto_clp": 1481000,
38434
+ * "margen_neto_clp": 1490000,
38431
38435
  * "settlement": null,
38432
38436
  * "cost_rollup": {
38433
38437
  * "acquisition_net_clp": 9800000,
@@ -38468,16 +38472,16 @@ interface paths {
38468
38472
  * "name": "Carla Rojas",
38469
38473
  * "role": "closer",
38470
38474
  * "commission_rate_bp": 800,
38471
- * "commission_basis_clp": 2289900,
38472
- * "commission_clp": 183192
38475
+ * "commission_basis_clp": 2200000,
38476
+ * "commission_clp": 176000
38473
38477
  * },
38474
38478
  * {
38475
38479
  * "user_id": "a1a1a1a1-0000-4000-8000-000000000002",
38476
38480
  * "name": "Diego Muñoz",
38477
38481
  * "role": "collaborator",
38478
38482
  * "commission_rate_bp": 200,
38479
- * "commission_basis_clp": 2289900,
38480
- * "commission_clp": 45798
38483
+ * "commission_basis_clp": 2200000,
38484
+ * "commission_clp": 44000
38481
38485
  * }
38482
38486
  * ],
38483
38487
  * "salesperson": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "11.37.0",
3
+ "version": "11.38.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",