partnermax 0.2.0 → 0.2.1
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/CHANGELOG.md +60 -47
- package/LICENSE +201 -201
- package/README.md +370 -370
- package/api-promise.js +1 -1
- package/client.js +1 -1
- package/client.mjs +1 -1
- package/core/api-promise.js +1 -1
- package/core/api-promise.mjs +1 -1
- package/error.js +1 -1
- package/package.json +9 -15
- package/resource.js +1 -1
- package/resources/dealers/dealers.js +1 -1
- package/resources/dealers/nlt/nlt.js +1 -1
- package/resources/dealers/nlt.js +1 -1
- package/resources/dealers/vehicles/vehicles.js +1 -1
- package/resources/dealers/vehicles.js +1 -1
- package/resources/dealers.js +1 -1
- package/resources.js +1 -1
- package/src/api-promise.ts +2 -2
- package/src/client.ts +841 -841
- package/src/core/README.md +3 -3
- package/src/core/api-promise.ts +92 -92
- package/src/core/error.ts +130 -130
- package/src/core/resource.ts +11 -11
- package/src/core/uploads.ts +2 -2
- package/src/error.ts +2 -2
- package/src/index.ts +22 -22
- package/src/internal/README.md +3 -3
- package/src/internal/builtin-types.ts +93 -93
- package/src/internal/detect-platform.ts +196 -196
- package/src/internal/errors.ts +33 -33
- package/src/internal/headers.ts +97 -97
- package/src/internal/parse.ts +56 -56
- package/src/internal/request-options.ts +91 -91
- package/src/internal/shim-types.ts +26 -26
- package/src/internal/shims.ts +107 -107
- package/src/internal/to-file.ts +154 -154
- package/src/internal/types.ts +93 -93
- package/src/internal/uploads.ts +187 -187
- package/src/internal/utils/base64.ts +40 -40
- package/src/internal/utils/bytes.ts +32 -32
- package/src/internal/utils/env.ts +18 -18
- package/src/internal/utils/log.ts +128 -128
- package/src/internal/utils/path.ts +88 -88
- package/src/internal/utils/query.ts +23 -23
- package/src/internal/utils/sleep.ts +3 -3
- package/src/internal/utils/uuid.ts +17 -17
- package/src/internal/utils/values.ts +105 -105
- package/src/internal/utils.ts +9 -9
- package/src/lib/.keep +4 -4
- package/src/resource.ts +2 -2
- package/src/resources/dealers/dealers.ts +348 -348
- package/src/resources/dealers/index.ts +28 -28
- package/src/resources/dealers/nlt/index.ts +11 -11
- package/src/resources/dealers/nlt/nlt.ts +29 -29
- package/src/resources/dealers/nlt/offers.ts +427 -427
- package/src/resources/dealers/nlt-settings.ts +269 -269
- package/src/resources/dealers/nlt.ts +3 -3
- package/src/resources/dealers/vehicles/images.ts +153 -153
- package/src/resources/dealers/vehicles/index.ts +25 -25
- package/src/resources/dealers/vehicles/vehicles.ts +796 -796
- package/src/resources/dealers/vehicles.ts +3 -3
- package/src/resources/dealers.ts +3 -3
- package/src/resources/index.ts +12 -12
- package/src/resources/keys.ts +128 -128
- package/src/resources.ts +1 -1
- package/src/tsconfig.json +11 -11
- package/src/uploads.ts +2 -2
- package/src/version.ts +1 -1
- package/uploads.js +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,269 +1,269 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../core/resource';
|
|
4
|
-
import { APIPromise } from '../../core/api-promise';
|
|
5
|
-
import { buildHeaders } from '../../internal/headers';
|
|
6
|
-
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
-
import { path } from '../../internal/utils/path';
|
|
8
|
-
|
|
9
|
-
export class NltSettings extends APIResource {
|
|
10
|
-
/**
|
|
11
|
-
* Return current NLT economics for the dealer.
|
|
12
|
-
*/
|
|
13
|
-
retrieve(dealerID: string, options?: RequestOptions): APIPromise<NltSettings> {
|
|
14
|
-
return this._client.get(path`/v1/dealers/${dealerID}/nlt-settings`, options);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Set markup percent (0-10) and three down-payment tiers (strictly ascending).
|
|
19
|
-
*
|
|
20
|
-
* Validation:
|
|
21
|
-
*
|
|
22
|
-
* - `agency_markup_percent` ∈ [0, 10] (Pydantic).
|
|
23
|
-
* - `down_payment_tiers.{low,medium,high}` each
|
|
24
|
-
* `{percent_of_list (0–100), fixed_eur (≥0)}`. No strict-ascending check — the
|
|
25
|
-
* final EUR per tier is offer-dependent (`listino_imponibile * pct + eur`).
|
|
26
|
-
*
|
|
27
|
-
* Persistence:
|
|
28
|
-
*
|
|
29
|
-
* - `agency_markup_percent` → `dealer_public.nlt_agency_percent` (rounded to int;
|
|
30
|
-
* live column is `Integer NOT NULL DEFAULT 2`).
|
|
31
|
-
* - `down_payment_tiers` → `dealer_public.nlt_anticipi_config` JSONB, stored in
|
|
32
|
-
* apimax shape `[{"pct": <0..1>, "eur": <int>}, ...]`. The partner-facing
|
|
33
|
-
* `percent_of_list` (0–100) is divided by 100 to keep the column byte-compatible
|
|
34
|
-
* with the DealerMAX UI calculator that reads the same JSONB.
|
|
35
|
-
*
|
|
36
|
-
* There is NO `vat_treatment` field: VAT is per-offer (`nlt_offerte.solo_privati`)
|
|
37
|
-
* in the canonical DataMax pricing model, not per-dealer. The offer detail
|
|
38
|
-
* endpoint surfaces it per row instead.
|
|
39
|
-
*
|
|
40
|
-
* `Idempotency-Key` replay uses the shared endpoint helper; a re-applied identical
|
|
41
|
-
* PATCH is also a row-level no-op by construction.
|
|
42
|
-
*/
|
|
43
|
-
update(
|
|
44
|
-
dealerID: string,
|
|
45
|
-
params: NltSettingUpdateParams,
|
|
46
|
-
options?: RequestOptions,
|
|
47
|
-
): APIPromise<NltSettings> {
|
|
48
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
49
|
-
return this._client.patch(path`/v1/dealers/${dealerID}/nlt-settings`, {
|
|
50
|
-
body,
|
|
51
|
-
...options,
|
|
52
|
-
headers: buildHeaders([
|
|
53
|
-
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
54
|
-
options?.headers,
|
|
55
|
-
]),
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Three down-payment scenarios (basso / medio / alto).
|
|
62
|
-
*
|
|
63
|
-
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
64
|
-
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
65
|
-
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
66
|
-
* semantics (low/medium/high) are advisory — apimax/DealerMAX UI treats the 3
|
|
67
|
-
* positions as opaque slots ordered by intent.
|
|
68
|
-
*/
|
|
69
|
-
export interface DownPaymentTiers {
|
|
70
|
-
/**
|
|
71
|
-
* One down-payment tier — percent of list price + flat EUR.
|
|
72
|
-
*
|
|
73
|
-
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
74
|
-
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
75
|
-
* `listino_imponibile * pct + eur` (see
|
|
76
|
-
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
77
|
-
*
|
|
78
|
-
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
79
|
-
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
80
|
-
* byte-compatible with the DealerMAX UI calculator.
|
|
81
|
-
*/
|
|
82
|
-
high: DownPaymentTiers.High;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* One down-payment tier — percent of list price + flat EUR.
|
|
86
|
-
*
|
|
87
|
-
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
88
|
-
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
89
|
-
* `listino_imponibile * pct + eur` (see
|
|
90
|
-
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
91
|
-
*
|
|
92
|
-
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
93
|
-
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
94
|
-
* byte-compatible with the DealerMAX UI calculator.
|
|
95
|
-
*/
|
|
96
|
-
low: DownPaymentTiers.Low;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* One down-payment tier — percent of list price + flat EUR.
|
|
100
|
-
*
|
|
101
|
-
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
102
|
-
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
103
|
-
* `listino_imponibile * pct + eur` (see
|
|
104
|
-
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
105
|
-
*
|
|
106
|
-
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
107
|
-
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
108
|
-
* byte-compatible with the DealerMAX UI calculator.
|
|
109
|
-
*/
|
|
110
|
-
medium: DownPaymentTiers.Medium;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export namespace DownPaymentTiers {
|
|
114
|
-
/**
|
|
115
|
-
* One down-payment tier — percent of list price + flat EUR.
|
|
116
|
-
*
|
|
117
|
-
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
118
|
-
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
119
|
-
* `listino_imponibile * pct + eur` (see
|
|
120
|
-
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
121
|
-
*
|
|
122
|
-
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
123
|
-
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
124
|
-
* byte-compatible with the DealerMAX UI calculator.
|
|
125
|
-
*/
|
|
126
|
-
export interface High {
|
|
127
|
-
/**
|
|
128
|
-
* Flat EUR component added on top of the percentage (e.g. promo
|
|
129
|
-
* `0% + 500 EUR fissi`). Whole euros only.
|
|
130
|
-
*/
|
|
131
|
-
fixed_eur: number;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Percentage of the IVA-excluded list price applied as down payment for this tier.
|
|
135
|
-
* Range 0–100. Typical defaults: 0 (low), 12.5 (medium), 25 (high).
|
|
136
|
-
*/
|
|
137
|
-
percent_of_list: number;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* One down-payment tier — percent of list price + flat EUR.
|
|
142
|
-
*
|
|
143
|
-
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
144
|
-
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
145
|
-
* `listino_imponibile * pct + eur` (see
|
|
146
|
-
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
147
|
-
*
|
|
148
|
-
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
149
|
-
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
150
|
-
* byte-compatible with the DealerMAX UI calculator.
|
|
151
|
-
*/
|
|
152
|
-
export interface Low {
|
|
153
|
-
/**
|
|
154
|
-
* Flat EUR component added on top of the percentage (e.g. promo
|
|
155
|
-
* `0% + 500 EUR fissi`). Whole euros only.
|
|
156
|
-
*/
|
|
157
|
-
fixed_eur: number;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Percentage of the IVA-excluded list price applied as down payment for this tier.
|
|
161
|
-
* Range 0–100. Typical defaults: 0 (low), 12.5 (medium), 25 (high).
|
|
162
|
-
*/
|
|
163
|
-
percent_of_list: number;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* One down-payment tier — percent of list price + flat EUR.
|
|
168
|
-
*
|
|
169
|
-
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
170
|
-
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
171
|
-
* `listino_imponibile * pct + eur` (see
|
|
172
|
-
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
173
|
-
*
|
|
174
|
-
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
175
|
-
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
176
|
-
* byte-compatible with the DealerMAX UI calculator.
|
|
177
|
-
*/
|
|
178
|
-
export interface Medium {
|
|
179
|
-
/**
|
|
180
|
-
* Flat EUR component added on top of the percentage (e.g. promo
|
|
181
|
-
* `0% + 500 EUR fissi`). Whole euros only.
|
|
182
|
-
*/
|
|
183
|
-
fixed_eur: number;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Percentage of the IVA-excluded list price applied as down payment for this tier.
|
|
187
|
-
* Range 0–100. Typical defaults: 0 (low), 12.5 (medium), 25 (high).
|
|
188
|
-
*/
|
|
189
|
-
percent_of_list: number;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Response model for GET / PATCH /v1/dealers/{id}/nlt-settings.
|
|
195
|
-
*
|
|
196
|
-
* Note: there is no `vat_treatment` field — VAT is a property of the offer
|
|
197
|
-
* (`nlt_offerte.solo_privati`), not of the dealer. The offer detail returns the
|
|
198
|
-
* VAT treatment per row instead.
|
|
199
|
-
*/
|
|
200
|
-
export interface NltSettings {
|
|
201
|
-
agency_markup_percent: number;
|
|
202
|
-
|
|
203
|
-
dealer_id: string;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Three down-payment scenarios (basso / medio / alto).
|
|
207
|
-
*
|
|
208
|
-
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
209
|
-
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
210
|
-
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
211
|
-
* semantics (low/medium/high) are advisory — apimax/DealerMAX UI treats the 3
|
|
212
|
-
* positions as opaque slots ordered by intent.
|
|
213
|
-
*/
|
|
214
|
-
down_payment_tiers: DownPaymentTiers;
|
|
215
|
-
|
|
216
|
-
effective_from: string;
|
|
217
|
-
|
|
218
|
-
currency?: 'EUR';
|
|
219
|
-
|
|
220
|
-
image_mode?: 'branded' | 'scenario_locked' | 'scenario_seasonal';
|
|
221
|
-
|
|
222
|
-
image_scenario_locked?: 'mediterraneo' | 'cortina' | 'milano' | 'showroom' | 'building' | null;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export interface NltSettingUpdateParams {
|
|
226
|
-
/**
|
|
227
|
-
* Body param
|
|
228
|
-
*/
|
|
229
|
-
agency_markup_percent: number;
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Body param: Three down-payment scenarios (basso / medio / alto).
|
|
233
|
-
*
|
|
234
|
-
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
235
|
-
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
236
|
-
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
237
|
-
* semantics (low/medium/high) are advisory — apimax/DealerMAX UI treats the 3
|
|
238
|
-
* positions as opaque slots ordered by intent.
|
|
239
|
-
*/
|
|
240
|
-
down_payment_tiers: DownPaymentTiers;
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Body param
|
|
244
|
-
*/
|
|
245
|
-
currency?: 'EUR';
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Body param
|
|
249
|
-
*/
|
|
250
|
-
image_mode?: 'branded' | 'scenario_locked' | 'scenario_seasonal';
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Body param
|
|
254
|
-
*/
|
|
255
|
-
image_scenario_locked?: 'mediterraneo' | 'cortina' | 'milano' | 'showroom' | 'building' | null;
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Header param
|
|
259
|
-
*/
|
|
260
|
-
'Idempotency-Key'?: string;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
export declare namespace NltSettings {
|
|
264
|
-
export {
|
|
265
|
-
type DownPaymentTiers as DownPaymentTiers,
|
|
266
|
-
type NltSettings as NltSettings,
|
|
267
|
-
type NltSettingUpdateParams as NltSettingUpdateParams,
|
|
268
|
-
};
|
|
269
|
-
}
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { path } from '../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class NltSettings extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Return current NLT economics for the dealer.
|
|
12
|
+
*/
|
|
13
|
+
retrieve(dealerID: string, options?: RequestOptions): APIPromise<NltSettings> {
|
|
14
|
+
return this._client.get(path`/v1/dealers/${dealerID}/nlt-settings`, options);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Set markup percent (0-10) and three down-payment tiers (strictly ascending).
|
|
19
|
+
*
|
|
20
|
+
* Validation:
|
|
21
|
+
*
|
|
22
|
+
* - `agency_markup_percent` ∈ [0, 10] (Pydantic).
|
|
23
|
+
* - `down_payment_tiers.{low,medium,high}` each
|
|
24
|
+
* `{percent_of_list (0–100), fixed_eur (≥0)}`. No strict-ascending check — the
|
|
25
|
+
* final EUR per tier is offer-dependent (`listino_imponibile * pct + eur`).
|
|
26
|
+
*
|
|
27
|
+
* Persistence:
|
|
28
|
+
*
|
|
29
|
+
* - `agency_markup_percent` → `dealer_public.nlt_agency_percent` (rounded to int;
|
|
30
|
+
* live column is `Integer NOT NULL DEFAULT 2`).
|
|
31
|
+
* - `down_payment_tiers` → `dealer_public.nlt_anticipi_config` JSONB, stored in
|
|
32
|
+
* apimax shape `[{"pct": <0..1>, "eur": <int>}, ...]`. The partner-facing
|
|
33
|
+
* `percent_of_list` (0–100) is divided by 100 to keep the column byte-compatible
|
|
34
|
+
* with the DealerMAX UI calculator that reads the same JSONB.
|
|
35
|
+
*
|
|
36
|
+
* There is NO `vat_treatment` field: VAT is per-offer (`nlt_offerte.solo_privati`)
|
|
37
|
+
* in the canonical DataMax pricing model, not per-dealer. The offer detail
|
|
38
|
+
* endpoint surfaces it per row instead.
|
|
39
|
+
*
|
|
40
|
+
* `Idempotency-Key` replay uses the shared endpoint helper; a re-applied identical
|
|
41
|
+
* PATCH is also a row-level no-op by construction.
|
|
42
|
+
*/
|
|
43
|
+
update(
|
|
44
|
+
dealerID: string,
|
|
45
|
+
params: NltSettingUpdateParams,
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<NltSettings> {
|
|
48
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
49
|
+
return this._client.patch(path`/v1/dealers/${dealerID}/nlt-settings`, {
|
|
50
|
+
body,
|
|
51
|
+
...options,
|
|
52
|
+
headers: buildHeaders([
|
|
53
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
54
|
+
options?.headers,
|
|
55
|
+
]),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Three down-payment scenarios (basso / medio / alto).
|
|
62
|
+
*
|
|
63
|
+
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
64
|
+
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
65
|
+
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
66
|
+
* semantics (low/medium/high) are advisory — apimax/DealerMAX UI treats the 3
|
|
67
|
+
* positions as opaque slots ordered by intent.
|
|
68
|
+
*/
|
|
69
|
+
export interface DownPaymentTiers {
|
|
70
|
+
/**
|
|
71
|
+
* One down-payment tier — percent of list price + flat EUR.
|
|
72
|
+
*
|
|
73
|
+
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
74
|
+
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
75
|
+
* `listino_imponibile * pct + eur` (see
|
|
76
|
+
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
77
|
+
*
|
|
78
|
+
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
79
|
+
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
80
|
+
* byte-compatible with the DealerMAX UI calculator.
|
|
81
|
+
*/
|
|
82
|
+
high: DownPaymentTiers.High;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* One down-payment tier — percent of list price + flat EUR.
|
|
86
|
+
*
|
|
87
|
+
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
88
|
+
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
89
|
+
* `listino_imponibile * pct + eur` (see
|
|
90
|
+
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
91
|
+
*
|
|
92
|
+
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
93
|
+
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
94
|
+
* byte-compatible with the DealerMAX UI calculator.
|
|
95
|
+
*/
|
|
96
|
+
low: DownPaymentTiers.Low;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* One down-payment tier — percent of list price + flat EUR.
|
|
100
|
+
*
|
|
101
|
+
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
102
|
+
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
103
|
+
* `listino_imponibile * pct + eur` (see
|
|
104
|
+
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
105
|
+
*
|
|
106
|
+
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
107
|
+
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
108
|
+
* byte-compatible with the DealerMAX UI calculator.
|
|
109
|
+
*/
|
|
110
|
+
medium: DownPaymentTiers.Medium;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export namespace DownPaymentTiers {
|
|
114
|
+
/**
|
|
115
|
+
* One down-payment tier — percent of list price + flat EUR.
|
|
116
|
+
*
|
|
117
|
+
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
118
|
+
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
119
|
+
* `listino_imponibile * pct + eur` (see
|
|
120
|
+
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
121
|
+
*
|
|
122
|
+
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
123
|
+
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
124
|
+
* byte-compatible with the DealerMAX UI calculator.
|
|
125
|
+
*/
|
|
126
|
+
export interface High {
|
|
127
|
+
/**
|
|
128
|
+
* Flat EUR component added on top of the percentage (e.g. promo
|
|
129
|
+
* `0% + 500 EUR fissi`). Whole euros only.
|
|
130
|
+
*/
|
|
131
|
+
fixed_eur: number;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Percentage of the IVA-excluded list price applied as down payment for this tier.
|
|
135
|
+
* Range 0–100. Typical defaults: 0 (low), 12.5 (medium), 25 (high).
|
|
136
|
+
*/
|
|
137
|
+
percent_of_list: number;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* One down-payment tier — percent of list price + flat EUR.
|
|
142
|
+
*
|
|
143
|
+
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
144
|
+
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
145
|
+
* `listino_imponibile * pct + eur` (see
|
|
146
|
+
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
147
|
+
*
|
|
148
|
+
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
149
|
+
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
150
|
+
* byte-compatible with the DealerMAX UI calculator.
|
|
151
|
+
*/
|
|
152
|
+
export interface Low {
|
|
153
|
+
/**
|
|
154
|
+
* Flat EUR component added on top of the percentage (e.g. promo
|
|
155
|
+
* `0% + 500 EUR fissi`). Whole euros only.
|
|
156
|
+
*/
|
|
157
|
+
fixed_eur: number;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Percentage of the IVA-excluded list price applied as down payment for this tier.
|
|
161
|
+
* Range 0–100. Typical defaults: 0 (low), 12.5 (medium), 25 (high).
|
|
162
|
+
*/
|
|
163
|
+
percent_of_list: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* One down-payment tier — percent of list price + flat EUR.
|
|
168
|
+
*
|
|
169
|
+
* apimax: `dealer_public.nlt_anticipi_config` is a JSONB list of three
|
|
170
|
+
* `{"pct": <0..1>, "eur": <int>}` entries. The final EUR applied to a deal is
|
|
171
|
+
* `listino_imponibile * pct + eur` (see
|
|
172
|
+
* `apimax/app/services/nlt/calculator.py::calcola_anticipo_eur`).
|
|
173
|
+
*
|
|
174
|
+
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
175
|
+
* `12.5`, not `0.125`); the router persists `pct = percent_of_list / 100` to stay
|
|
176
|
+
* byte-compatible with the DealerMAX UI calculator.
|
|
177
|
+
*/
|
|
178
|
+
export interface Medium {
|
|
179
|
+
/**
|
|
180
|
+
* Flat EUR component added on top of the percentage (e.g. promo
|
|
181
|
+
* `0% + 500 EUR fissi`). Whole euros only.
|
|
182
|
+
*/
|
|
183
|
+
fixed_eur: number;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Percentage of the IVA-excluded list price applied as down payment for this tier.
|
|
187
|
+
* Range 0–100. Typical defaults: 0 (low), 12.5 (medium), 25 (high).
|
|
188
|
+
*/
|
|
189
|
+
percent_of_list: number;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Response model for GET / PATCH /v1/dealers/{id}/nlt-settings.
|
|
195
|
+
*
|
|
196
|
+
* Note: there is no `vat_treatment` field — VAT is a property of the offer
|
|
197
|
+
* (`nlt_offerte.solo_privati`), not of the dealer. The offer detail returns the
|
|
198
|
+
* VAT treatment per row instead.
|
|
199
|
+
*/
|
|
200
|
+
export interface NltSettings {
|
|
201
|
+
agency_markup_percent: number;
|
|
202
|
+
|
|
203
|
+
dealer_id: string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Three down-payment scenarios (basso / medio / alto).
|
|
207
|
+
*
|
|
208
|
+
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
209
|
+
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
210
|
+
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
211
|
+
* semantics (low/medium/high) are advisory — apimax/DealerMAX UI treats the 3
|
|
212
|
+
* positions as opaque slots ordered by intent.
|
|
213
|
+
*/
|
|
214
|
+
down_payment_tiers: DownPaymentTiers;
|
|
215
|
+
|
|
216
|
+
effective_from: string;
|
|
217
|
+
|
|
218
|
+
currency?: 'EUR';
|
|
219
|
+
|
|
220
|
+
image_mode?: 'branded' | 'scenario_locked' | 'scenario_seasonal';
|
|
221
|
+
|
|
222
|
+
image_scenario_locked?: 'mediterraneo' | 'cortina' | 'milano' | 'showroom' | 'building' | null;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface NltSettingUpdateParams {
|
|
226
|
+
/**
|
|
227
|
+
* Body param
|
|
228
|
+
*/
|
|
229
|
+
agency_markup_percent: number;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Body param: Three down-payment scenarios (basso / medio / alto).
|
|
233
|
+
*
|
|
234
|
+
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
235
|
+
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
236
|
+
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
237
|
+
* semantics (low/medium/high) are advisory — apimax/DealerMAX UI treats the 3
|
|
238
|
+
* positions as opaque slots ordered by intent.
|
|
239
|
+
*/
|
|
240
|
+
down_payment_tiers: DownPaymentTiers;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Body param
|
|
244
|
+
*/
|
|
245
|
+
currency?: 'EUR';
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Body param
|
|
249
|
+
*/
|
|
250
|
+
image_mode?: 'branded' | 'scenario_locked' | 'scenario_seasonal';
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Body param
|
|
254
|
+
*/
|
|
255
|
+
image_scenario_locked?: 'mediterraneo' | 'cortina' | 'milano' | 'showroom' | 'building' | null;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Header param
|
|
259
|
+
*/
|
|
260
|
+
'Idempotency-Key'?: string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export declare namespace NltSettings {
|
|
264
|
+
export {
|
|
265
|
+
type DownPaymentTiers as DownPaymentTiers,
|
|
266
|
+
type NltSettings as NltSettings,
|
|
267
|
+
type NltSettingUpdateParams as NltSettingUpdateParams,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export * from './nlt/index';
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export * from './nlt/index';
|