@vitrina/api 17.32.1 → 17.37.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 +16 -12
- package/dist/index.d.ts +16 -12
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -38143,7 +38143,7 @@ interface paths {
|
|
|
38143
38143
|
*
|
|
38144
38144
|
* `approved_by` and `approved_at` are all-or-nothing. Timestamps accept either UTC (`…Z`) or an explicit offset (`…-04:00`, Chile). 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.
|
|
38145
38145
|
*
|
|
38146
|
-
* **`funding` IS THE BALANCE GATE (ERP S9-5, BR-418)** — where the money for this sale comes from.
|
|
38146
|
+
* **`funding` IS THE BALANCE GATE (ERP S9-5, BR-418)** — where the money for this sale comes from. Its payments are validated BEFORE anything is written (a malformed row is a **400** with **no folio consumed**) and written into the SAME transaction as the document — so a payment the database refuses rolls `V-n` back rather than burning it on a half-recorded sale. `price + Σ statutory add-ons` is weighed against `Σ these payments + retoma + credit`: **a plan that comes up short still issues** (201) — the usual case of a sale issued with only the deposit — and the note reads `funding.standing: "short"` with `funding.gap_clp` on `GET /sale-notes/{id}`; record the rest later with `POST /document-payments`. **Over-funding is allowed** and comes back labelled as `saldo_a_favor_del_cliente_clp`; it is never an error and is never silently clamped. A plan stated against a document with no `tax_clp` is a **400** (the balance cannot be computed: an unrecorded IVA is not zero).
|
|
38147
38147
|
*
|
|
38148
38148
|
* There is deliberately **no `retoma_clp` and no `credit_clp`** inside `funding`: a hand-typed figure for either would be an unbacked claim the gate then counts as money. **Omitting `funding` is not a bypass** — the document issues as it always has and reads `short` on `GET /sale-notes/{id}` with the gap stated. Use `POST /sale-notes/funding/preview` to see the gap before committing to the issue.
|
|
38149
38149
|
*
|
|
@@ -148132,7 +148132,9 @@ interface paths {
|
|
|
148132
148132
|
* Sell the car and settle with the owner
|
|
148133
148133
|
* @description One atomic action doing two things: moves the contract to `vendido`, and produces the **Liquidación** — sale price minus commission equals the amount owed to the owner, minus every retained cost line the owner bears (derived from the car's cost ledger, never sent; a 409 if they exceed the payout), plus the payment record. Requires `amount_venta_clp`; `paid_at` records when the owner was actually paid.
|
|
148134
148134
|
*
|
|
148135
|
-
* **
|
|
148135
|
+
* **Only the medio de pago is required**: `payout_method` (transferencia, vale_vista or cheque). `payout_bank`, `payout_account` (the cuenta de destino — only its last four digits are stored and returned as `payout_account_last4`), `payout_operation_number` and `payout_paid_by` («pagado por», an active member of the workspace; defaults to whoever registers it) are optional. What was recorded prints on the liquidación with the payment and registration dates.
|
|
148136
|
+
*
|
|
148137
|
+
* **The commission can be set for this sale**: `comision_amount_clp` (net of IVA) replaces what the contract’s terms would compute — a minimum commission, a figure renegotiated at closing. The liquidación then records a fixed commission of that amount; the contract keeps its terms. To charge the owner an additional cost, record it on the car’s cost ledger with a `dueno` share before settling.
|
|
148136
148138
|
*
|
|
148137
148139
|
* Legal only from `activo`; anything else is a 409. Answers 201 with the contract and the Liquidación.
|
|
148138
148140
|
*
|
|
@@ -148167,22 +148169,24 @@ interface paths {
|
|
|
148167
148169
|
amount_venta_clp: number;
|
|
148168
148170
|
/** Format: date-time */
|
|
148169
148171
|
paid_at?: string;
|
|
148172
|
+
/** @description Comisión acordada para ESTA venta, neta de IVA, en pesos. Opcional: si se omite, se calcula con los términos del contrato. Cuando se envía, la liquidación la registra como comisión fija (el contrato no cambia) y el «+ IVA» sigue siendo el del contrato. No puede superar `amount_venta_clp`. */
|
|
148173
|
+
comision_amount_clp?: number;
|
|
148170
148174
|
/**
|
|
148171
|
-
* @description Medio de pago al consignante: `transferencia`, `vale_vista` o `cheque`.
|
|
148175
|
+
* @description Medio de pago al consignante: `transferencia`, `vale_vista` o `cheque`. Es el único dato del pago que se exige.
|
|
148172
148176
|
* @enum {string}
|
|
148173
148177
|
*/
|
|
148174
148178
|
payout_method: "transferencia" | "vale_vista" | "cheque";
|
|
148175
|
-
/** @description Banco por el que se pagó. */
|
|
148176
|
-
payout_bank
|
|
148177
|
-
/** @description Cuenta de destino. Solo se guardan sus últimos 4 dígitos (`payout_account_last4`), que es lo que muestran la app y la liquidación. */
|
|
148178
|
-
payout_account
|
|
148179
|
-
/** @description Número de operación del pago. */
|
|
148180
|
-
payout_operation_number
|
|
148179
|
+
/** @description Banco por el que se pagó. Opcional. */
|
|
148180
|
+
payout_bank?: string;
|
|
148181
|
+
/** @description Cuenta de destino. Opcional. Solo se guardan sus últimos 4 dígitos (`payout_account_last4`), que es lo que muestran la app y la liquidación; si se envía, necesita al menos 4 dígitos. */
|
|
148182
|
+
payout_account?: string;
|
|
148183
|
+
/** @description Número de operación del pago. Opcional. */
|
|
148184
|
+
payout_operation_number?: string;
|
|
148181
148185
|
/**
|
|
148182
148186
|
* Format: uuid
|
|
148183
|
-
* @description «Pagado por»: id de usuario de un miembro activo del equipo.
|
|
148187
|
+
* @description «Pagado por»: id de usuario de un miembro activo del equipo. Opcional: si se omite, queda quien registra la liquidación.
|
|
148184
148188
|
*/
|
|
148185
|
-
payout_paid_by
|
|
148189
|
+
payout_paid_by?: string;
|
|
148186
148190
|
};
|
|
148187
148191
|
};
|
|
148188
148192
|
};
|
|
@@ -148322,7 +148326,7 @@ interface paths {
|
|
|
148322
148326
|
* Fetch the settlement record
|
|
148323
148327
|
* @description The persisted Liquidación for a contract. It only exists once the contract has been sold — this is a read of a record, not a projection computed on demand, so the figures are what was agreed at settlement even if the terms changed afterwards.
|
|
148324
148328
|
*
|
|
148325
|
-
* It carries how the owner was paid (`payout_*`, with `payout_paid_by_name` resolved for display). On a liquidación registered before the payout fields
|
|
148329
|
+
* It carries how the owner was paid (`payout_*`, with `payout_paid_by_name` resolved for display). On a liquidación registered before the payout fields existed they are all `null`; since then `payout_method` is always set and each of the others is `null` when it was not recorded.
|
|
148326
148330
|
*
|
|
148327
148331
|
* `deducciones_clp` is the Σ of the dueño share of every retained cost line the settlement discharged, and `deductions` lists them one by one (`cost_entry_id`, `label`, `entry_date`, `dueno_clp`). Selling a consigned car deducts them all: `monto_owner_clp` is `amount_venta_clp` minus the comisión minus `deducciones_clp`.
|
|
148328
148332
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -38143,7 +38143,7 @@ interface paths {
|
|
|
38143
38143
|
*
|
|
38144
38144
|
* `approved_by` and `approved_at` are all-or-nothing. Timestamps accept either UTC (`…Z`) or an explicit offset (`…-04:00`, Chile). 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.
|
|
38145
38145
|
*
|
|
38146
|
-
* **`funding` IS THE BALANCE GATE (ERP S9-5, BR-418)** — where the money for this sale comes from.
|
|
38146
|
+
* **`funding` IS THE BALANCE GATE (ERP S9-5, BR-418)** — where the money for this sale comes from. Its payments are validated BEFORE anything is written (a malformed row is a **400** with **no folio consumed**) and written into the SAME transaction as the document — so a payment the database refuses rolls `V-n` back rather than burning it on a half-recorded sale. `price + Σ statutory add-ons` is weighed against `Σ these payments + retoma + credit`: **a plan that comes up short still issues** (201) — the usual case of a sale issued with only the deposit — and the note reads `funding.standing: "short"` with `funding.gap_clp` on `GET /sale-notes/{id}`; record the rest later with `POST /document-payments`. **Over-funding is allowed** and comes back labelled as `saldo_a_favor_del_cliente_clp`; it is never an error and is never silently clamped. A plan stated against a document with no `tax_clp` is a **400** (the balance cannot be computed: an unrecorded IVA is not zero).
|
|
38147
38147
|
*
|
|
38148
38148
|
* There is deliberately **no `retoma_clp` and no `credit_clp`** inside `funding`: a hand-typed figure for either would be an unbacked claim the gate then counts as money. **Omitting `funding` is not a bypass** — the document issues as it always has and reads `short` on `GET /sale-notes/{id}` with the gap stated. Use `POST /sale-notes/funding/preview` to see the gap before committing to the issue.
|
|
38149
38149
|
*
|
|
@@ -148132,7 +148132,9 @@ interface paths {
|
|
|
148132
148132
|
* Sell the car and settle with the owner
|
|
148133
148133
|
* @description One atomic action doing two things: moves the contract to `vendido`, and produces the **Liquidación** — sale price minus commission equals the amount owed to the owner, minus every retained cost line the owner bears (derived from the car's cost ledger, never sent; a 409 if they exceed the payout), plus the payment record. Requires `amount_venta_clp`; `paid_at` records when the owner was actually paid.
|
|
148134
148134
|
*
|
|
148135
|
-
* **
|
|
148135
|
+
* **Only the medio de pago is required**: `payout_method` (transferencia, vale_vista or cheque). `payout_bank`, `payout_account` (the cuenta de destino — only its last four digits are stored and returned as `payout_account_last4`), `payout_operation_number` and `payout_paid_by` («pagado por», an active member of the workspace; defaults to whoever registers it) are optional. What was recorded prints on the liquidación with the payment and registration dates.
|
|
148136
|
+
*
|
|
148137
|
+
* **The commission can be set for this sale**: `comision_amount_clp` (net of IVA) replaces what the contract’s terms would compute — a minimum commission, a figure renegotiated at closing. The liquidación then records a fixed commission of that amount; the contract keeps its terms. To charge the owner an additional cost, record it on the car’s cost ledger with a `dueno` share before settling.
|
|
148136
148138
|
*
|
|
148137
148139
|
* Legal only from `activo`; anything else is a 409. Answers 201 with the contract and the Liquidación.
|
|
148138
148140
|
*
|
|
@@ -148167,22 +148169,24 @@ interface paths {
|
|
|
148167
148169
|
amount_venta_clp: number;
|
|
148168
148170
|
/** Format: date-time */
|
|
148169
148171
|
paid_at?: string;
|
|
148172
|
+
/** @description Comisión acordada para ESTA venta, neta de IVA, en pesos. Opcional: si se omite, se calcula con los términos del contrato. Cuando se envía, la liquidación la registra como comisión fija (el contrato no cambia) y el «+ IVA» sigue siendo el del contrato. No puede superar `amount_venta_clp`. */
|
|
148173
|
+
comision_amount_clp?: number;
|
|
148170
148174
|
/**
|
|
148171
|
-
* @description Medio de pago al consignante: `transferencia`, `vale_vista` o `cheque`.
|
|
148175
|
+
* @description Medio de pago al consignante: `transferencia`, `vale_vista` o `cheque`. Es el único dato del pago que se exige.
|
|
148172
148176
|
* @enum {string}
|
|
148173
148177
|
*/
|
|
148174
148178
|
payout_method: "transferencia" | "vale_vista" | "cheque";
|
|
148175
|
-
/** @description Banco por el que se pagó. */
|
|
148176
|
-
payout_bank
|
|
148177
|
-
/** @description Cuenta de destino. Solo se guardan sus últimos 4 dígitos (`payout_account_last4`), que es lo que muestran la app y la liquidación. */
|
|
148178
|
-
payout_account
|
|
148179
|
-
/** @description Número de operación del pago. */
|
|
148180
|
-
payout_operation_number
|
|
148179
|
+
/** @description Banco por el que se pagó. Opcional. */
|
|
148180
|
+
payout_bank?: string;
|
|
148181
|
+
/** @description Cuenta de destino. Opcional. Solo se guardan sus últimos 4 dígitos (`payout_account_last4`), que es lo que muestran la app y la liquidación; si se envía, necesita al menos 4 dígitos. */
|
|
148182
|
+
payout_account?: string;
|
|
148183
|
+
/** @description Número de operación del pago. Opcional. */
|
|
148184
|
+
payout_operation_number?: string;
|
|
148181
148185
|
/**
|
|
148182
148186
|
* Format: uuid
|
|
148183
|
-
* @description «Pagado por»: id de usuario de un miembro activo del equipo.
|
|
148187
|
+
* @description «Pagado por»: id de usuario de un miembro activo del equipo. Opcional: si se omite, queda quien registra la liquidación.
|
|
148184
148188
|
*/
|
|
148185
|
-
payout_paid_by
|
|
148189
|
+
payout_paid_by?: string;
|
|
148186
148190
|
};
|
|
148187
148191
|
};
|
|
148188
148192
|
};
|
|
@@ -148322,7 +148326,7 @@ interface paths {
|
|
|
148322
148326
|
* Fetch the settlement record
|
|
148323
148327
|
* @description The persisted Liquidación for a contract. It only exists once the contract has been sold — this is a read of a record, not a projection computed on demand, so the figures are what was agreed at settlement even if the terms changed afterwards.
|
|
148324
148328
|
*
|
|
148325
|
-
* It carries how the owner was paid (`payout_*`, with `payout_paid_by_name` resolved for display). On a liquidación registered before the payout fields
|
|
148329
|
+
* It carries how the owner was paid (`payout_*`, with `payout_paid_by_name` resolved for display). On a liquidación registered before the payout fields existed they are all `null`; since then `payout_method` is always set and each of the others is `null` when it was not recorded.
|
|
148326
148330
|
*
|
|
148327
148331
|
* `deducciones_clp` is the Σ of the dueño share of every retained cost line the settlement discharged, and `deductions` lists them one by one (`cost_entry_id`, `label`, `entry_date`, `dueno_clp`). Selling a consigned car deducts them all: `monto_owner_clp` is `amount_venta_clp` minus the comisión minus `deducciones_clp`.
|
|
148328
148332
|
*/
|
package/package.json
CHANGED