@vitrina/api 14.50.1 → 14.50.3

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
@@ -38915,6 +38915,516 @@ interface paths {
38915
38915
  patch?: never;
38916
38916
  trace?: never;
38917
38917
  };
38918
+ "/iva": {
38919
+ parameters: {
38920
+ query?: never;
38921
+ header?: never;
38922
+ path?: never;
38923
+ cookie?: never;
38924
+ };
38925
+ /**
38926
+ * Read the IVA rate and the dealership default regime
38927
+ * @description Returns the **pinned platform rate** and the dealership’s default regime.
38928
+ *
38929
+ * `rate` is `{ bps: 1900, percent: 19, configurable: false, copy }`. The rate is **law, not a setting** — there is no endpoint that changes it, and `copy` is the string the UI must render beside it so an operator can see that it is fixed rather than a field somebody forgot to enable.
38930
+ *
38931
+ * `tenant_default.configured = false` means **nobody has chosen yet**, which is a different claim from having chosen `afecto`. A unit taken into stock while the default is unconfigured captures nothing, and resolves as `platform_fallback`.
38932
+ */
38933
+ get: {
38934
+ parameters: {
38935
+ query?: never;
38936
+ header?: never;
38937
+ path?: never;
38938
+ cookie?: never;
38939
+ };
38940
+ requestBody?: never;
38941
+ responses: {
38942
+ /** @description The pinned rate + the dealership default regime */
38943
+ 200: {
38944
+ headers: {
38945
+ [name: string]: unknown;
38946
+ };
38947
+ content: {
38948
+ /**
38949
+ * @example {
38950
+ * "data": {
38951
+ * "rate": {
38952
+ * "bps": 1900,
38953
+ * "percent": 19,
38954
+ * "configurable": false,
38955
+ * "copy": "IVA legal de Chile (19%). No es configurable: aplica a todos los cálculos fiscales de la plataforma."
38956
+ * },
38957
+ * "tenant_default": {
38958
+ * "regime": "exento",
38959
+ * "configured": true
38960
+ * }
38961
+ * }
38962
+ * }
38963
+ */
38964
+ "application/json": {
38965
+ data?: unknown;
38966
+ meta?: {
38967
+ [key: string]: unknown;
38968
+ };
38969
+ };
38970
+ };
38971
+ };
38972
+ /** @description Validation error */
38973
+ 400: {
38974
+ headers: {
38975
+ [name: string]: unknown;
38976
+ };
38977
+ content: {
38978
+ "application/json": components["schemas"]["Error"];
38979
+ };
38980
+ };
38981
+ /** @description Unauthorized */
38982
+ 401: {
38983
+ headers: {
38984
+ [name: string]: unknown;
38985
+ };
38986
+ content: {
38987
+ "application/json": components["schemas"]["Error"];
38988
+ };
38989
+ };
38990
+ /** @description Forbidden */
38991
+ 403: {
38992
+ headers: {
38993
+ [name: string]: unknown;
38994
+ };
38995
+ content: {
38996
+ "application/json": components["schemas"]["Error"];
38997
+ };
38998
+ };
38999
+ /** @description Not found */
39000
+ 404: {
39001
+ headers: {
39002
+ [name: string]: unknown;
39003
+ };
39004
+ content: {
39005
+ "application/json": components["schemas"]["Error"];
39006
+ };
39007
+ };
39008
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
39009
+ 409: {
39010
+ headers: {
39011
+ [name: string]: unknown;
39012
+ };
39013
+ content: {
39014
+ "application/json": components["schemas"]["Error"];
39015
+ };
39016
+ };
39017
+ /** @description Rate limited */
39018
+ 429: {
39019
+ headers: {
39020
+ [name: string]: unknown;
39021
+ };
39022
+ content: {
39023
+ "application/json": components["schemas"]["Error"];
39024
+ };
39025
+ };
39026
+ };
39027
+ };
39028
+ put?: never;
39029
+ post?: never;
39030
+ delete?: never;
39031
+ options?: never;
39032
+ head?: never;
39033
+ patch?: never;
39034
+ trace?: never;
39035
+ };
39036
+ "/iva/tenant-default": {
39037
+ parameters: {
39038
+ query?: never;
39039
+ header?: never;
39040
+ path?: never;
39041
+ cookie?: never;
39042
+ };
39043
+ get?: never;
39044
+ /**
39045
+ * Set the dealership default IVA regime
39046
+ * @description Sets the regime **new** units inherit when they enter stock (`afecto` | `exento`).
39047
+ *
39048
+ * **It is not retroactive.** A unit captures the default at intake and keeps it, so changing this moves the default for the next car and rewrites nothing that already resolved a regime — including closed months. Units that never captured one (imported before this existed) do follow it, and `GET /iva/vehicles/{id}` reports that as `source: tenant_default` rather than passing it off as a decision.
39049
+ *
39050
+ * The body is `.strict()`: an unknown key is a **400**, because `regimen` is one character from `regime` and a silently discarded key is a caller who believes the dealership switched regimes when it did not. Clearing the default is deliberately NOT offered — that is a state to arrive at by never configuring, not one to navigate to.
39051
+ */
39052
+ put: {
39053
+ parameters: {
39054
+ query?: never;
39055
+ header?: never;
39056
+ path?: never;
39057
+ cookie?: never;
39058
+ };
39059
+ requestBody?: {
39060
+ content: {
39061
+ /**
39062
+ * @example {
39063
+ * "regime": "exento"
39064
+ * }
39065
+ */
39066
+ "application/json": {
39067
+ /** @enum {string} */
39068
+ regime: "afecto" | "exento";
39069
+ };
39070
+ };
39071
+ };
39072
+ responses: {
39073
+ /** @description The stored dealership default */
39074
+ 200: {
39075
+ headers: {
39076
+ [name: string]: unknown;
39077
+ };
39078
+ content: {
39079
+ /**
39080
+ * @example {
39081
+ * "data": {
39082
+ * "regime": "exento",
39083
+ * "configured": true
39084
+ * }
39085
+ * }
39086
+ */
39087
+ "application/json": {
39088
+ data?: unknown;
39089
+ meta?: {
39090
+ [key: string]: unknown;
39091
+ };
39092
+ };
39093
+ };
39094
+ };
39095
+ /** @description Validation error */
39096
+ 400: {
39097
+ headers: {
39098
+ [name: string]: unknown;
39099
+ };
39100
+ content: {
39101
+ "application/json": components["schemas"]["Error"];
39102
+ };
39103
+ };
39104
+ /** @description Unauthorized */
39105
+ 401: {
39106
+ headers: {
39107
+ [name: string]: unknown;
39108
+ };
39109
+ content: {
39110
+ "application/json": components["schemas"]["Error"];
39111
+ };
39112
+ };
39113
+ /** @description Forbidden */
39114
+ 403: {
39115
+ headers: {
39116
+ [name: string]: unknown;
39117
+ };
39118
+ content: {
39119
+ "application/json": components["schemas"]["Error"];
39120
+ };
39121
+ };
39122
+ /** @description Not found */
39123
+ 404: {
39124
+ headers: {
39125
+ [name: string]: unknown;
39126
+ };
39127
+ content: {
39128
+ "application/json": components["schemas"]["Error"];
39129
+ };
39130
+ };
39131
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
39132
+ 409: {
39133
+ headers: {
39134
+ [name: string]: unknown;
39135
+ };
39136
+ content: {
39137
+ "application/json": components["schemas"]["Error"];
39138
+ };
39139
+ };
39140
+ /** @description Rate limited */
39141
+ 429: {
39142
+ headers: {
39143
+ [name: string]: unknown;
39144
+ };
39145
+ content: {
39146
+ "application/json": components["schemas"]["Error"];
39147
+ };
39148
+ };
39149
+ };
39150
+ };
39151
+ post?: never;
39152
+ delete?: never;
39153
+ options?: never;
39154
+ head?: never;
39155
+ patch?: never;
39156
+ trace?: never;
39157
+ };
39158
+ "/iva/vehicles/{id}": {
39159
+ parameters: {
39160
+ query?: never;
39161
+ header?: never;
39162
+ path?: never;
39163
+ cookie?: never;
39164
+ };
39165
+ /**
39166
+ * Resolve the IVA regime for one unit
39167
+ * @description The unit’s financial-view payload: `stored_regime` (the raw column — `null` when this car never captured one), the resolved `regime`, and `source`, which says where the answer came from:
39168
+ *
39169
+ * * `vehicle` — captured on the unit. A change to the dealership default **cannot** move it.
39170
+ * * `tenant_default` — inherited, so it **will** move if the default moves.
39171
+ * * `platform_fallback` — nobody has decided at either grain; `determined` is `false`.
39172
+ *
39173
+ * Also returns `debito` (`applies` + `rate_bps`) and `badge` — `label`, `qualifier` and the débito **consequence** spelled out in one sentence, which is the half worth showing: the regime only matters because of what it does to the margin.
39174
+ *
39175
+ * A vehicle in another workspace, soft-deleted, merged away, or nonexistent is a **404**, all four identically.
39176
+ */
39177
+ get: {
39178
+ parameters: {
39179
+ query?: never;
39180
+ header?: never;
39181
+ path: {
39182
+ id: string;
39183
+ };
39184
+ cookie?: never;
39185
+ };
39186
+ requestBody?: never;
39187
+ responses: {
39188
+ /** @description The resolved regime for the unit */
39189
+ 200: {
39190
+ headers: {
39191
+ [name: string]: unknown;
39192
+ };
39193
+ content: {
39194
+ /**
39195
+ * @example {
39196
+ * "data": {
39197
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
39198
+ * "stored_regime": null,
39199
+ * "tenant_default": {
39200
+ * "regime": "exento",
39201
+ * "configured": true
39202
+ * },
39203
+ * "regime": "exento",
39204
+ * "source": "tenant_default",
39205
+ * "determined": true,
39206
+ * "captured": false,
39207
+ * "debito": {
39208
+ * "applies": false,
39209
+ * "rate_bps": 0
39210
+ * },
39211
+ * "rate": {
39212
+ * "bps": 1900,
39213
+ * "percent": 19,
39214
+ * "configurable": false,
39215
+ * "copy": "IVA legal de Chile (19%). No es configurable: aplica a todos los cálculos fiscales de la plataforma."
39216
+ * },
39217
+ * "badge": {
39218
+ * "label": "Exento",
39219
+ * "qualifier": "sin IVA",
39220
+ * "consequence": "La venta no genera débito fiscal de IVA (venta de autos usados, exenta en Chile): no se descuenta IVA del margen al calcular la comisión ni el neto del vendedor."
39221
+ * }
39222
+ * }
39223
+ * }
39224
+ */
39225
+ "application/json": {
39226
+ data?: unknown;
39227
+ meta?: {
39228
+ [key: string]: unknown;
39229
+ };
39230
+ };
39231
+ };
39232
+ };
39233
+ /** @description Validation error */
39234
+ 400: {
39235
+ headers: {
39236
+ [name: string]: unknown;
39237
+ };
39238
+ content: {
39239
+ "application/json": components["schemas"]["Error"];
39240
+ };
39241
+ };
39242
+ /** @description Unauthorized */
39243
+ 401: {
39244
+ headers: {
39245
+ [name: string]: unknown;
39246
+ };
39247
+ content: {
39248
+ "application/json": components["schemas"]["Error"];
39249
+ };
39250
+ };
39251
+ /** @description Forbidden */
39252
+ 403: {
39253
+ headers: {
39254
+ [name: string]: unknown;
39255
+ };
39256
+ content: {
39257
+ "application/json": components["schemas"]["Error"];
39258
+ };
39259
+ };
39260
+ /** @description Not found */
39261
+ 404: {
39262
+ headers: {
39263
+ [name: string]: unknown;
39264
+ };
39265
+ content: {
39266
+ "application/json": components["schemas"]["Error"];
39267
+ };
39268
+ };
39269
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
39270
+ 409: {
39271
+ headers: {
39272
+ [name: string]: unknown;
39273
+ };
39274
+ content: {
39275
+ "application/json": components["schemas"]["Error"];
39276
+ };
39277
+ };
39278
+ /** @description Rate limited */
39279
+ 429: {
39280
+ headers: {
39281
+ [name: string]: unknown;
39282
+ };
39283
+ content: {
39284
+ "application/json": components["schemas"]["Error"];
39285
+ };
39286
+ };
39287
+ };
39288
+ };
39289
+ /**
39290
+ * Override or clear one unit’s IVA regime
39291
+ * @description Sets this car’s **own** regime, overriding whatever it inherited — the ordinary case being one used car in an otherwise afecto lot, or the reverse.
39292
+ *
39293
+ * `regime: null` **clears** the override so the unit inherits the dealership default again. That is a real operation, not a no-op, and it is the only way back from an override set by mistake. Omitting the key entirely is a **400** — clearing an override and sending an empty body must not be the same request.
39294
+ *
39295
+ * Requires `dealership_economics:write`, **not** `marketplace:write`: a regime decides whether a stored amount is net or gross, so it is not editable by every principal who can edit stock.
39296
+ */
39297
+ put: {
39298
+ parameters: {
39299
+ query?: never;
39300
+ header?: never;
39301
+ path: {
39302
+ id: string;
39303
+ };
39304
+ cookie?: never;
39305
+ };
39306
+ requestBody?: {
39307
+ content: {
39308
+ /**
39309
+ * @example {
39310
+ * "regime": "afecto"
39311
+ * }
39312
+ */
39313
+ "application/json": {
39314
+ /** @enum {string|null} */
39315
+ regime: "afecto" | "exento" | null;
39316
+ };
39317
+ };
39318
+ };
39319
+ responses: {
39320
+ /** @description The resolved regime after the write */
39321
+ 200: {
39322
+ headers: {
39323
+ [name: string]: unknown;
39324
+ };
39325
+ content: {
39326
+ /**
39327
+ * @example {
39328
+ * "data": {
39329
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
39330
+ * "stored_regime": "afecto",
39331
+ * "tenant_default": {
39332
+ * "regime": "exento",
39333
+ * "configured": true
39334
+ * },
39335
+ * "regime": "afecto",
39336
+ * "source": "vehicle",
39337
+ * "determined": true,
39338
+ * "captured": true,
39339
+ * "debito": {
39340
+ * "applies": true,
39341
+ * "rate_bps": 1900
39342
+ * },
39343
+ * "rate": {
39344
+ * "bps": 1900,
39345
+ * "percent": 19,
39346
+ * "configurable": false,
39347
+ * "copy": "IVA legal de Chile (19%). No es configurable: aplica a todos los cálculos fiscales de la plataforma."
39348
+ * },
39349
+ * "badge": {
39350
+ * "label": "Afecto",
39351
+ * "qualifier": "con IVA",
39352
+ * "consequence": "La venta genera débito fiscal de IVA (19%): se descuenta IVA del margen al calcular la comisión y el neto del vendedor."
39353
+ * }
39354
+ * }
39355
+ * }
39356
+ */
39357
+ "application/json": {
39358
+ data?: unknown;
39359
+ meta?: {
39360
+ [key: string]: unknown;
39361
+ };
39362
+ };
39363
+ };
39364
+ };
39365
+ /** @description Validation error */
39366
+ 400: {
39367
+ headers: {
39368
+ [name: string]: unknown;
39369
+ };
39370
+ content: {
39371
+ "application/json": components["schemas"]["Error"];
39372
+ };
39373
+ };
39374
+ /** @description Unauthorized */
39375
+ 401: {
39376
+ headers: {
39377
+ [name: string]: unknown;
39378
+ };
39379
+ content: {
39380
+ "application/json": components["schemas"]["Error"];
39381
+ };
39382
+ };
39383
+ /** @description Forbidden */
39384
+ 403: {
39385
+ headers: {
39386
+ [name: string]: unknown;
39387
+ };
39388
+ content: {
39389
+ "application/json": components["schemas"]["Error"];
39390
+ };
39391
+ };
39392
+ /** @description Not found */
39393
+ 404: {
39394
+ headers: {
39395
+ [name: string]: unknown;
39396
+ };
39397
+ content: {
39398
+ "application/json": components["schemas"]["Error"];
39399
+ };
39400
+ };
39401
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
39402
+ 409: {
39403
+ headers: {
39404
+ [name: string]: unknown;
39405
+ };
39406
+ content: {
39407
+ "application/json": components["schemas"]["Error"];
39408
+ };
39409
+ };
39410
+ /** @description Rate limited */
39411
+ 429: {
39412
+ headers: {
39413
+ [name: string]: unknown;
39414
+ };
39415
+ content: {
39416
+ "application/json": components["schemas"]["Error"];
39417
+ };
39418
+ };
39419
+ };
39420
+ };
39421
+ post?: never;
39422
+ delete?: never;
39423
+ options?: never;
39424
+ head?: never;
39425
+ patch?: never;
39426
+ trace?: never;
39427
+ };
38918
39428
  "/purchase-notes": {
38919
39429
  parameters: {
38920
39430
  query?: never;
package/dist/index.d.ts CHANGED
@@ -38915,6 +38915,516 @@ interface paths {
38915
38915
  patch?: never;
38916
38916
  trace?: never;
38917
38917
  };
38918
+ "/iva": {
38919
+ parameters: {
38920
+ query?: never;
38921
+ header?: never;
38922
+ path?: never;
38923
+ cookie?: never;
38924
+ };
38925
+ /**
38926
+ * Read the IVA rate and the dealership default regime
38927
+ * @description Returns the **pinned platform rate** and the dealership’s default regime.
38928
+ *
38929
+ * `rate` is `{ bps: 1900, percent: 19, configurable: false, copy }`. The rate is **law, not a setting** — there is no endpoint that changes it, and `copy` is the string the UI must render beside it so an operator can see that it is fixed rather than a field somebody forgot to enable.
38930
+ *
38931
+ * `tenant_default.configured = false` means **nobody has chosen yet**, which is a different claim from having chosen `afecto`. A unit taken into stock while the default is unconfigured captures nothing, and resolves as `platform_fallback`.
38932
+ */
38933
+ get: {
38934
+ parameters: {
38935
+ query?: never;
38936
+ header?: never;
38937
+ path?: never;
38938
+ cookie?: never;
38939
+ };
38940
+ requestBody?: never;
38941
+ responses: {
38942
+ /** @description The pinned rate + the dealership default regime */
38943
+ 200: {
38944
+ headers: {
38945
+ [name: string]: unknown;
38946
+ };
38947
+ content: {
38948
+ /**
38949
+ * @example {
38950
+ * "data": {
38951
+ * "rate": {
38952
+ * "bps": 1900,
38953
+ * "percent": 19,
38954
+ * "configurable": false,
38955
+ * "copy": "IVA legal de Chile (19%). No es configurable: aplica a todos los cálculos fiscales de la plataforma."
38956
+ * },
38957
+ * "tenant_default": {
38958
+ * "regime": "exento",
38959
+ * "configured": true
38960
+ * }
38961
+ * }
38962
+ * }
38963
+ */
38964
+ "application/json": {
38965
+ data?: unknown;
38966
+ meta?: {
38967
+ [key: string]: unknown;
38968
+ };
38969
+ };
38970
+ };
38971
+ };
38972
+ /** @description Validation error */
38973
+ 400: {
38974
+ headers: {
38975
+ [name: string]: unknown;
38976
+ };
38977
+ content: {
38978
+ "application/json": components["schemas"]["Error"];
38979
+ };
38980
+ };
38981
+ /** @description Unauthorized */
38982
+ 401: {
38983
+ headers: {
38984
+ [name: string]: unknown;
38985
+ };
38986
+ content: {
38987
+ "application/json": components["schemas"]["Error"];
38988
+ };
38989
+ };
38990
+ /** @description Forbidden */
38991
+ 403: {
38992
+ headers: {
38993
+ [name: string]: unknown;
38994
+ };
38995
+ content: {
38996
+ "application/json": components["schemas"]["Error"];
38997
+ };
38998
+ };
38999
+ /** @description Not found */
39000
+ 404: {
39001
+ headers: {
39002
+ [name: string]: unknown;
39003
+ };
39004
+ content: {
39005
+ "application/json": components["schemas"]["Error"];
39006
+ };
39007
+ };
39008
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
39009
+ 409: {
39010
+ headers: {
39011
+ [name: string]: unknown;
39012
+ };
39013
+ content: {
39014
+ "application/json": components["schemas"]["Error"];
39015
+ };
39016
+ };
39017
+ /** @description Rate limited */
39018
+ 429: {
39019
+ headers: {
39020
+ [name: string]: unknown;
39021
+ };
39022
+ content: {
39023
+ "application/json": components["schemas"]["Error"];
39024
+ };
39025
+ };
39026
+ };
39027
+ };
39028
+ put?: never;
39029
+ post?: never;
39030
+ delete?: never;
39031
+ options?: never;
39032
+ head?: never;
39033
+ patch?: never;
39034
+ trace?: never;
39035
+ };
39036
+ "/iva/tenant-default": {
39037
+ parameters: {
39038
+ query?: never;
39039
+ header?: never;
39040
+ path?: never;
39041
+ cookie?: never;
39042
+ };
39043
+ get?: never;
39044
+ /**
39045
+ * Set the dealership default IVA regime
39046
+ * @description Sets the regime **new** units inherit when they enter stock (`afecto` | `exento`).
39047
+ *
39048
+ * **It is not retroactive.** A unit captures the default at intake and keeps it, so changing this moves the default for the next car and rewrites nothing that already resolved a regime — including closed months. Units that never captured one (imported before this existed) do follow it, and `GET /iva/vehicles/{id}` reports that as `source: tenant_default` rather than passing it off as a decision.
39049
+ *
39050
+ * The body is `.strict()`: an unknown key is a **400**, because `regimen` is one character from `regime` and a silently discarded key is a caller who believes the dealership switched regimes when it did not. Clearing the default is deliberately NOT offered — that is a state to arrive at by never configuring, not one to navigate to.
39051
+ */
39052
+ put: {
39053
+ parameters: {
39054
+ query?: never;
39055
+ header?: never;
39056
+ path?: never;
39057
+ cookie?: never;
39058
+ };
39059
+ requestBody?: {
39060
+ content: {
39061
+ /**
39062
+ * @example {
39063
+ * "regime": "exento"
39064
+ * }
39065
+ */
39066
+ "application/json": {
39067
+ /** @enum {string} */
39068
+ regime: "afecto" | "exento";
39069
+ };
39070
+ };
39071
+ };
39072
+ responses: {
39073
+ /** @description The stored dealership default */
39074
+ 200: {
39075
+ headers: {
39076
+ [name: string]: unknown;
39077
+ };
39078
+ content: {
39079
+ /**
39080
+ * @example {
39081
+ * "data": {
39082
+ * "regime": "exento",
39083
+ * "configured": true
39084
+ * }
39085
+ * }
39086
+ */
39087
+ "application/json": {
39088
+ data?: unknown;
39089
+ meta?: {
39090
+ [key: string]: unknown;
39091
+ };
39092
+ };
39093
+ };
39094
+ };
39095
+ /** @description Validation error */
39096
+ 400: {
39097
+ headers: {
39098
+ [name: string]: unknown;
39099
+ };
39100
+ content: {
39101
+ "application/json": components["schemas"]["Error"];
39102
+ };
39103
+ };
39104
+ /** @description Unauthorized */
39105
+ 401: {
39106
+ headers: {
39107
+ [name: string]: unknown;
39108
+ };
39109
+ content: {
39110
+ "application/json": components["schemas"]["Error"];
39111
+ };
39112
+ };
39113
+ /** @description Forbidden */
39114
+ 403: {
39115
+ headers: {
39116
+ [name: string]: unknown;
39117
+ };
39118
+ content: {
39119
+ "application/json": components["schemas"]["Error"];
39120
+ };
39121
+ };
39122
+ /** @description Not found */
39123
+ 404: {
39124
+ headers: {
39125
+ [name: string]: unknown;
39126
+ };
39127
+ content: {
39128
+ "application/json": components["schemas"]["Error"];
39129
+ };
39130
+ };
39131
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
39132
+ 409: {
39133
+ headers: {
39134
+ [name: string]: unknown;
39135
+ };
39136
+ content: {
39137
+ "application/json": components["schemas"]["Error"];
39138
+ };
39139
+ };
39140
+ /** @description Rate limited */
39141
+ 429: {
39142
+ headers: {
39143
+ [name: string]: unknown;
39144
+ };
39145
+ content: {
39146
+ "application/json": components["schemas"]["Error"];
39147
+ };
39148
+ };
39149
+ };
39150
+ };
39151
+ post?: never;
39152
+ delete?: never;
39153
+ options?: never;
39154
+ head?: never;
39155
+ patch?: never;
39156
+ trace?: never;
39157
+ };
39158
+ "/iva/vehicles/{id}": {
39159
+ parameters: {
39160
+ query?: never;
39161
+ header?: never;
39162
+ path?: never;
39163
+ cookie?: never;
39164
+ };
39165
+ /**
39166
+ * Resolve the IVA regime for one unit
39167
+ * @description The unit’s financial-view payload: `stored_regime` (the raw column — `null` when this car never captured one), the resolved `regime`, and `source`, which says where the answer came from:
39168
+ *
39169
+ * * `vehicle` — captured on the unit. A change to the dealership default **cannot** move it.
39170
+ * * `tenant_default` — inherited, so it **will** move if the default moves.
39171
+ * * `platform_fallback` — nobody has decided at either grain; `determined` is `false`.
39172
+ *
39173
+ * Also returns `debito` (`applies` + `rate_bps`) and `badge` — `label`, `qualifier` and the débito **consequence** spelled out in one sentence, which is the half worth showing: the regime only matters because of what it does to the margin.
39174
+ *
39175
+ * A vehicle in another workspace, soft-deleted, merged away, or nonexistent is a **404**, all four identically.
39176
+ */
39177
+ get: {
39178
+ parameters: {
39179
+ query?: never;
39180
+ header?: never;
39181
+ path: {
39182
+ id: string;
39183
+ };
39184
+ cookie?: never;
39185
+ };
39186
+ requestBody?: never;
39187
+ responses: {
39188
+ /** @description The resolved regime for the unit */
39189
+ 200: {
39190
+ headers: {
39191
+ [name: string]: unknown;
39192
+ };
39193
+ content: {
39194
+ /**
39195
+ * @example {
39196
+ * "data": {
39197
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
39198
+ * "stored_regime": null,
39199
+ * "tenant_default": {
39200
+ * "regime": "exento",
39201
+ * "configured": true
39202
+ * },
39203
+ * "regime": "exento",
39204
+ * "source": "tenant_default",
39205
+ * "determined": true,
39206
+ * "captured": false,
39207
+ * "debito": {
39208
+ * "applies": false,
39209
+ * "rate_bps": 0
39210
+ * },
39211
+ * "rate": {
39212
+ * "bps": 1900,
39213
+ * "percent": 19,
39214
+ * "configurable": false,
39215
+ * "copy": "IVA legal de Chile (19%). No es configurable: aplica a todos los cálculos fiscales de la plataforma."
39216
+ * },
39217
+ * "badge": {
39218
+ * "label": "Exento",
39219
+ * "qualifier": "sin IVA",
39220
+ * "consequence": "La venta no genera débito fiscal de IVA (venta de autos usados, exenta en Chile): no se descuenta IVA del margen al calcular la comisión ni el neto del vendedor."
39221
+ * }
39222
+ * }
39223
+ * }
39224
+ */
39225
+ "application/json": {
39226
+ data?: unknown;
39227
+ meta?: {
39228
+ [key: string]: unknown;
39229
+ };
39230
+ };
39231
+ };
39232
+ };
39233
+ /** @description Validation error */
39234
+ 400: {
39235
+ headers: {
39236
+ [name: string]: unknown;
39237
+ };
39238
+ content: {
39239
+ "application/json": components["schemas"]["Error"];
39240
+ };
39241
+ };
39242
+ /** @description Unauthorized */
39243
+ 401: {
39244
+ headers: {
39245
+ [name: string]: unknown;
39246
+ };
39247
+ content: {
39248
+ "application/json": components["schemas"]["Error"];
39249
+ };
39250
+ };
39251
+ /** @description Forbidden */
39252
+ 403: {
39253
+ headers: {
39254
+ [name: string]: unknown;
39255
+ };
39256
+ content: {
39257
+ "application/json": components["schemas"]["Error"];
39258
+ };
39259
+ };
39260
+ /** @description Not found */
39261
+ 404: {
39262
+ headers: {
39263
+ [name: string]: unknown;
39264
+ };
39265
+ content: {
39266
+ "application/json": components["schemas"]["Error"];
39267
+ };
39268
+ };
39269
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
39270
+ 409: {
39271
+ headers: {
39272
+ [name: string]: unknown;
39273
+ };
39274
+ content: {
39275
+ "application/json": components["schemas"]["Error"];
39276
+ };
39277
+ };
39278
+ /** @description Rate limited */
39279
+ 429: {
39280
+ headers: {
39281
+ [name: string]: unknown;
39282
+ };
39283
+ content: {
39284
+ "application/json": components["schemas"]["Error"];
39285
+ };
39286
+ };
39287
+ };
39288
+ };
39289
+ /**
39290
+ * Override or clear one unit’s IVA regime
39291
+ * @description Sets this car’s **own** regime, overriding whatever it inherited — the ordinary case being one used car in an otherwise afecto lot, or the reverse.
39292
+ *
39293
+ * `regime: null` **clears** the override so the unit inherits the dealership default again. That is a real operation, not a no-op, and it is the only way back from an override set by mistake. Omitting the key entirely is a **400** — clearing an override and sending an empty body must not be the same request.
39294
+ *
39295
+ * Requires `dealership_economics:write`, **not** `marketplace:write`: a regime decides whether a stored amount is net or gross, so it is not editable by every principal who can edit stock.
39296
+ */
39297
+ put: {
39298
+ parameters: {
39299
+ query?: never;
39300
+ header?: never;
39301
+ path: {
39302
+ id: string;
39303
+ };
39304
+ cookie?: never;
39305
+ };
39306
+ requestBody?: {
39307
+ content: {
39308
+ /**
39309
+ * @example {
39310
+ * "regime": "afecto"
39311
+ * }
39312
+ */
39313
+ "application/json": {
39314
+ /** @enum {string|null} */
39315
+ regime: "afecto" | "exento" | null;
39316
+ };
39317
+ };
39318
+ };
39319
+ responses: {
39320
+ /** @description The resolved regime after the write */
39321
+ 200: {
39322
+ headers: {
39323
+ [name: string]: unknown;
39324
+ };
39325
+ content: {
39326
+ /**
39327
+ * @example {
39328
+ * "data": {
39329
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
39330
+ * "stored_regime": "afecto",
39331
+ * "tenant_default": {
39332
+ * "regime": "exento",
39333
+ * "configured": true
39334
+ * },
39335
+ * "regime": "afecto",
39336
+ * "source": "vehicle",
39337
+ * "determined": true,
39338
+ * "captured": true,
39339
+ * "debito": {
39340
+ * "applies": true,
39341
+ * "rate_bps": 1900
39342
+ * },
39343
+ * "rate": {
39344
+ * "bps": 1900,
39345
+ * "percent": 19,
39346
+ * "configurable": false,
39347
+ * "copy": "IVA legal de Chile (19%). No es configurable: aplica a todos los cálculos fiscales de la plataforma."
39348
+ * },
39349
+ * "badge": {
39350
+ * "label": "Afecto",
39351
+ * "qualifier": "con IVA",
39352
+ * "consequence": "La venta genera débito fiscal de IVA (19%): se descuenta IVA del margen al calcular la comisión y el neto del vendedor."
39353
+ * }
39354
+ * }
39355
+ * }
39356
+ */
39357
+ "application/json": {
39358
+ data?: unknown;
39359
+ meta?: {
39360
+ [key: string]: unknown;
39361
+ };
39362
+ };
39363
+ };
39364
+ };
39365
+ /** @description Validation error */
39366
+ 400: {
39367
+ headers: {
39368
+ [name: string]: unknown;
39369
+ };
39370
+ content: {
39371
+ "application/json": components["schemas"]["Error"];
39372
+ };
39373
+ };
39374
+ /** @description Unauthorized */
39375
+ 401: {
39376
+ headers: {
39377
+ [name: string]: unknown;
39378
+ };
39379
+ content: {
39380
+ "application/json": components["schemas"]["Error"];
39381
+ };
39382
+ };
39383
+ /** @description Forbidden */
39384
+ 403: {
39385
+ headers: {
39386
+ [name: string]: unknown;
39387
+ };
39388
+ content: {
39389
+ "application/json": components["schemas"]["Error"];
39390
+ };
39391
+ };
39392
+ /** @description Not found */
39393
+ 404: {
39394
+ headers: {
39395
+ [name: string]: unknown;
39396
+ };
39397
+ content: {
39398
+ "application/json": components["schemas"]["Error"];
39399
+ };
39400
+ };
39401
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
39402
+ 409: {
39403
+ headers: {
39404
+ [name: string]: unknown;
39405
+ };
39406
+ content: {
39407
+ "application/json": components["schemas"]["Error"];
39408
+ };
39409
+ };
39410
+ /** @description Rate limited */
39411
+ 429: {
39412
+ headers: {
39413
+ [name: string]: unknown;
39414
+ };
39415
+ content: {
39416
+ "application/json": components["schemas"]["Error"];
39417
+ };
39418
+ };
39419
+ };
39420
+ };
39421
+ post?: never;
39422
+ delete?: never;
39423
+ options?: never;
39424
+ head?: never;
39425
+ patch?: never;
39426
+ trace?: never;
39427
+ };
38918
39428
  "/purchase-notes": {
38919
39429
  parameters: {
38920
39430
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "14.50.1",
3
+ "version": "14.50.3",
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",