partnermax 0.2.1 → 0.2.2
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 +15 -0
- package/README.md +41 -17
- package/client.d.mts +9 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -3
- package/client.d.ts.map +1 -1
- package/client.js +11 -1
- package/client.js.map +1 -1
- package/client.mjs +11 -1
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +57 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +57 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +108 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +102 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +11 -1
- package/pagination.d.mts +3 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +3 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +3 -0
- package/pagination.mjs.map +1 -0
- package/resources/dealers/dealers.d.mts +7 -71
- package/resources/dealers/dealers.d.mts.map +1 -1
- package/resources/dealers/dealers.d.ts +7 -71
- package/resources/dealers/dealers.d.ts.map +1 -1
- package/resources/dealers/dealers.js +2 -15
- package/resources/dealers/dealers.js.map +1 -1
- package/resources/dealers/dealers.mjs +2 -15
- package/resources/dealers/dealers.mjs.map +1 -1
- package/resources/dealers/index.d.mts +2 -2
- package/resources/dealers/index.d.mts.map +1 -1
- package/resources/dealers/index.d.ts +2 -2
- package/resources/dealers/index.d.ts.map +1 -1
- package/resources/dealers/index.js.map +1 -1
- package/resources/dealers/index.mjs.map +1 -1
- package/resources/dealers/nlt/index.d.mts +1 -1
- package/resources/dealers/nlt/index.d.mts.map +1 -1
- package/resources/dealers/nlt/index.d.ts +1 -1
- package/resources/dealers/nlt/index.d.ts.map +1 -1
- package/resources/dealers/nlt/nlt.d.mts +2 -2
- package/resources/dealers/nlt/nlt.d.mts.map +1 -1
- package/resources/dealers/nlt/nlt.d.ts +2 -2
- package/resources/dealers/nlt/nlt.d.ts.map +1 -1
- package/resources/dealers/nlt/offers.d.mts +55 -78
- package/resources/dealers/nlt/offers.d.mts.map +1 -1
- package/resources/dealers/nlt/offers.d.ts +55 -78
- package/resources/dealers/nlt/offers.d.ts.map +1 -1
- package/resources/dealers/nlt/offers.js +9 -11
- package/resources/dealers/nlt/offers.js.map +1 -1
- package/resources/dealers/nlt/offers.mjs +9 -11
- package/resources/dealers/nlt/offers.mjs.map +1 -1
- package/resources/dealers/nlt-settings.d.mts +24 -64
- package/resources/dealers/nlt-settings.d.mts.map +1 -1
- package/resources/dealers/nlt-settings.d.ts +24 -64
- package/resources/dealers/nlt-settings.d.ts.map +1 -1
- package/resources/dealers/nlt-settings.js +4 -13
- package/resources/dealers/nlt-settings.js.map +1 -1
- package/resources/dealers/nlt-settings.mjs +4 -13
- package/resources/dealers/nlt-settings.mjs.map +1 -1
- package/resources/dealers/vehicles/images.d.mts +3 -2
- package/resources/dealers/vehicles/images.d.mts.map +1 -1
- package/resources/dealers/vehicles/images.d.ts +3 -2
- package/resources/dealers/vehicles/images.d.ts.map +1 -1
- package/resources/dealers/vehicles/images.js +3 -2
- package/resources/dealers/vehicles/images.js.map +1 -1
- package/resources/dealers/vehicles/images.mjs +3 -2
- package/resources/dealers/vehicles/images.mjs.map +1 -1
- package/resources/dealers/vehicles/index.d.mts +1 -1
- package/resources/dealers/vehicles/index.d.mts.map +1 -1
- package/resources/dealers/vehicles/index.d.ts +1 -1
- package/resources/dealers/vehicles/index.d.ts.map +1 -1
- package/resources/dealers/vehicles/index.js.map +1 -1
- package/resources/dealers/vehicles/index.mjs.map +1 -1
- package/resources/dealers/vehicles/vehicles.d.mts +57 -70
- package/resources/dealers/vehicles/vehicles.d.mts.map +1 -1
- package/resources/dealers/vehicles/vehicles.d.ts +57 -70
- package/resources/dealers/vehicles/vehicles.d.ts.map +1 -1
- package/resources/dealers/vehicles/vehicles.js +18 -18
- package/resources/dealers/vehicles/vehicles.js.map +1 -1
- package/resources/dealers/vehicles/vehicles.mjs +18 -18
- package/resources/dealers/vehicles/vehicles.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/keys.d.mts +7 -6
- package/resources/keys.d.mts.map +1 -1
- package/resources/keys.d.ts +7 -6
- package/resources/keys.d.ts.map +1 -1
- package/resources/keys.js +7 -6
- package/resources/keys.js.map +1 -1
- package/resources/keys.mjs +7 -6
- package/resources/keys.mjs.map +1 -1
- package/src/client.ts +32 -5
- package/src/core/pagination.ts +170 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/dealers/dealers.ts +9 -97
- package/src/resources/dealers/index.ts +2 -2
- package/src/resources/dealers/nlt/index.ts +1 -1
- package/src/resources/dealers/nlt/nlt.ts +2 -2
- package/src/resources/dealers/nlt/offers.ts +60 -84
- package/src/resources/dealers/nlt-settings.ts +24 -64
- package/src/resources/dealers/vehicles/images.ts +3 -2
- package/src/resources/dealers/vehicles/index.ts +1 -0
- package/src/resources/dealers/vehicles/vehicles.ts +62 -72
- package/src/resources/index.ts +1 -2
- package/src/resources/keys.ts +7 -6
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
|
|
5
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
6
7
|
import { path } from '../../../internal/utils/path';
|
|
7
8
|
|
|
@@ -22,33 +23,32 @@ export class Offers extends APIResource {
|
|
|
22
23
|
/**
|
|
23
24
|
* Listing of NLT offers with monthly canon repriced for this dealer.
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* row lets us know if there's a next page without a second COUNT(\*) query.
|
|
30
|
-
* 3. Apply text/enum filters server-side via SQL where possible (brand, segment,
|
|
31
|
-
* fuel) and the numeric `canone_max_eur` filter in Python after the pricing
|
|
32
|
-
* pass (the DB has no "displayed canon" column; we synthesize it per dealer).
|
|
33
|
-
* 4. For each surviving offer, price the (duration, km) cells the caller filtered
|
|
34
|
-
* to (if specified) or all 18, pick the cheapest cell as the headline.
|
|
26
|
+
* The response is cursor-paginated and dealer-aware: filters are applied to the
|
|
27
|
+
* shared NLT catalogue, then each returned offer is repriced with the dealer's
|
|
28
|
+
* configured mark-up, down-payment tiers, duration, and yearly-km filters. The
|
|
29
|
+
* headline canon is the cheapest eligible priced cell.
|
|
35
30
|
*/
|
|
36
31
|
list(
|
|
37
32
|
dealerID: string,
|
|
38
33
|
query: OfferListParams | null | undefined = {},
|
|
39
34
|
options?: RequestOptions,
|
|
40
|
-
):
|
|
41
|
-
return this._client.
|
|
35
|
+
): PagePromise<NltOfferSummariesCursorPage, NltOfferSummary> {
|
|
36
|
+
return this._client.getAPIList(path`/v1/dealers/${dealerID}/nlt/offers`, CursorPage<NltOfferSummary>, {
|
|
37
|
+
query,
|
|
38
|
+
...options,
|
|
39
|
+
});
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
|
|
43
|
+
export type NltOfferSummariesCursorPage = CursorPage<NltOfferSummary>;
|
|
44
|
+
|
|
45
45
|
/**
|
|
46
46
|
* Single row in the offers list. Pricing is dealer-aware.
|
|
47
47
|
*
|
|
48
|
-
* Field names: American English snake_case. Values
|
|
49
|
-
* (`fuel_type: "Benzina"`, `segment: "SUV piccoli"`). No enum
|
|
50
|
-
*
|
|
51
|
-
* partner client sees the same string in both listing and detail.
|
|
48
|
+
* Field names: American English snake_case. Values use DealerMAX's Italian
|
|
49
|
+
* catalogue vocabulary (`fuel_type: "Benzina"`, `segment: "SUV piccoli"`). No enum
|
|
50
|
+
* normalization — labels are surfaced verbatim, exactly as the detail endpoint
|
|
51
|
+
* does, so the partner client sees the same string in both listing and detail.
|
|
52
52
|
*/
|
|
53
53
|
export interface NltOfferSummary {
|
|
54
54
|
brand: string;
|
|
@@ -87,10 +87,9 @@ export interface NltOfferSummary {
|
|
|
87
87
|
/**
|
|
88
88
|
* Full offer detail.
|
|
89
89
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* KEYS because they are `mnet_dettagli` column names (raw DB).
|
|
90
|
+
* Field names use American-English snake_case for the partner SDK contract. Values
|
|
91
|
+
* stay Italian raw where the underlying automotive catalogue uses Italian labels.
|
|
92
|
+
* The dict `technical_details` keeps Italian domain keys.
|
|
94
93
|
*/
|
|
95
94
|
export interface OfferRetrieveResponse {
|
|
96
95
|
found: boolean;
|
|
@@ -106,7 +105,7 @@ export interface OfferRetrieveResponse {
|
|
|
106
105
|
vat_included: boolean;
|
|
107
106
|
|
|
108
107
|
/**
|
|
109
|
-
* Container for optional add-ons
|
|
108
|
+
* Container for optional add-ons.
|
|
110
109
|
*/
|
|
111
110
|
available_addons?: OfferRetrieveResponse.AvailableAddons;
|
|
112
111
|
|
|
@@ -119,17 +118,16 @@ export interface OfferRetrieveResponse {
|
|
|
119
118
|
/**
|
|
120
119
|
* Three down-payment scenarios in EUR (whole amounts).
|
|
121
120
|
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
121
|
+
* Keys use American-English snake_case for the partnermax SDK: `zero`, `medium`,
|
|
122
|
+
* `standard`.
|
|
124
123
|
*/
|
|
125
124
|
down_payment_scenarios_eur?: OfferRetrieveResponse.DownPaymentScenariosEur | null;
|
|
126
125
|
|
|
127
126
|
/**
|
|
128
127
|
* Italian labels paired 1:1 with `NltDownPaymentScenariosEur`.
|
|
129
128
|
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* "Anticipo 12,5%" / "Anticipo 25%").
|
|
129
|
+
* Values stay in Italian raw ("Senza anticipo" / "Anticipo 12,5%" / "Anticipo
|
|
130
|
+
* 25%") so partner UIs match DealerMAX consumer-facing copy.
|
|
133
131
|
*/
|
|
134
132
|
down_payment_scenarios_labels?: OfferRetrieveResponse.DownPaymentScenariosLabels | null;
|
|
135
133
|
|
|
@@ -184,12 +182,11 @@ export interface OfferRetrieveResponse {
|
|
|
184
182
|
|
|
185
183
|
export namespace OfferRetrieveResponse {
|
|
186
184
|
/**
|
|
187
|
-
* Container for optional add-ons
|
|
185
|
+
* Container for optional add-ons.
|
|
188
186
|
*/
|
|
189
187
|
export interface AvailableAddons {
|
|
190
188
|
/**
|
|
191
|
-
* Replacement-vehicle add-on lookup
|
|
192
|
-
* `addons_disponibili.auto_sostitutiva`).
|
|
189
|
+
* Replacement-vehicle add-on lookup.
|
|
193
190
|
*
|
|
194
191
|
* Always category B (utilitaria) per founder decision — the spoken "average
|
|
195
192
|
* customer" segment.
|
|
@@ -197,19 +194,18 @@ export namespace OfferRetrieveResponse {
|
|
|
197
194
|
replacement_vehicle?: AvailableAddons.ReplacementVehicle | null;
|
|
198
195
|
|
|
199
196
|
/**
|
|
200
|
-
* Tyre-replacement add-on lookup
|
|
197
|
+
* Tyre-replacement add-on lookup.
|
|
201
198
|
*
|
|
202
|
-
* Populated when
|
|
203
|
-
*
|
|
204
|
-
*
|
|
199
|
+
* Populated when the catalogue carries a parseable tyre diameter and a
|
|
200
|
+
* DealerMAX-managed tyre package exists for that diameter. Null otherwise.
|
|
201
|
+
* Replacement rule: 1 set of 4 tyres every 30 000 km, rounded up.
|
|
205
202
|
*/
|
|
206
203
|
tires?: AvailableAddons.Tires | null;
|
|
207
204
|
}
|
|
208
205
|
|
|
209
206
|
export namespace AvailableAddons {
|
|
210
207
|
/**
|
|
211
|
-
* Replacement-vehicle add-on lookup
|
|
212
|
-
* `addons_disponibili.auto_sostitutiva`).
|
|
208
|
+
* Replacement-vehicle add-on lookup.
|
|
213
209
|
*
|
|
214
210
|
* Always category B (utilitaria) per founder decision — the spoken "average
|
|
215
211
|
* customer" segment.
|
|
@@ -223,11 +219,11 @@ export namespace OfferRetrieveResponse {
|
|
|
223
219
|
}
|
|
224
220
|
|
|
225
221
|
/**
|
|
226
|
-
* Tyre-replacement add-on lookup
|
|
222
|
+
* Tyre-replacement add-on lookup.
|
|
227
223
|
*
|
|
228
|
-
* Populated when
|
|
229
|
-
*
|
|
230
|
-
*
|
|
224
|
+
* Populated when the catalogue carries a parseable tyre diameter and a
|
|
225
|
+
* DealerMAX-managed tyre package exists for that diameter. Null otherwise.
|
|
226
|
+
* Replacement rule: 1 set of 4 tyres every 30 000 km, rounded up.
|
|
231
227
|
*/
|
|
232
228
|
export interface Tires {
|
|
233
229
|
diameter_in: number;
|
|
@@ -241,8 +237,8 @@ export namespace OfferRetrieveResponse {
|
|
|
241
237
|
/**
|
|
242
238
|
* Three down-payment scenarios in EUR (whole amounts).
|
|
243
239
|
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
240
|
+
* Keys use American-English snake_case for the partnermax SDK: `zero`, `medium`,
|
|
241
|
+
* `standard`.
|
|
246
242
|
*/
|
|
247
243
|
export interface DownPaymentScenariosEur {
|
|
248
244
|
medium: number;
|
|
@@ -255,9 +251,8 @@ export namespace OfferRetrieveResponse {
|
|
|
255
251
|
/**
|
|
256
252
|
* Italian labels paired 1:1 with `NltDownPaymentScenariosEur`.
|
|
257
253
|
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
* "Anticipo 12,5%" / "Anticipo 25%").
|
|
254
|
+
* Values stay in Italian raw ("Senza anticipo" / "Anticipo 12,5%" / "Anticipo
|
|
255
|
+
* 25%") so partner UIs match DealerMAX consumer-facing copy.
|
|
261
256
|
*/
|
|
262
257
|
export interface DownPaymentScenariosLabels {
|
|
263
258
|
medium: string;
|
|
@@ -270,10 +265,9 @@ export namespace OfferRetrieveResponse {
|
|
|
270
265
|
/**
|
|
271
266
|
* One Italian Q&A entry derived per-offer.
|
|
272
267
|
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
* surfaces them all, 1:1.
|
|
268
|
+
* Generated from the same grounded offer payload used by DealerMAX consumer-facing
|
|
269
|
+
* surfaces: dimensions, fuel, transmission, CO2, monthly canon, available
|
|
270
|
+
* durations, VAT inclusion, down-payment tiers, etc.
|
|
277
271
|
*/
|
|
278
272
|
export interface Faq {
|
|
279
273
|
answer: string;
|
|
@@ -282,7 +276,7 @@ export namespace OfferRetrieveResponse {
|
|
|
282
276
|
}
|
|
283
277
|
|
|
284
278
|
/**
|
|
285
|
-
* One image in the offer gallery
|
|
279
|
+
* One image in the offer gallery.
|
|
286
280
|
*/
|
|
287
281
|
export interface Gallery {
|
|
288
282
|
is_cover: boolean;
|
|
@@ -291,7 +285,7 @@ export namespace OfferRetrieveResponse {
|
|
|
291
285
|
}
|
|
292
286
|
|
|
293
287
|
/**
|
|
294
|
-
* One accessory bundled with the offer
|
|
288
|
+
* One accessory bundled with the offer.
|
|
295
289
|
*/
|
|
296
290
|
export interface IncludedAccessory {
|
|
297
291
|
code: string;
|
|
@@ -304,10 +298,9 @@ export namespace OfferRetrieveResponse {
|
|
|
304
298
|
/**
|
|
305
299
|
* One NLT service normally included in the canone.
|
|
306
300
|
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
* Bollo, Pneumatici, Veicolo in anticipo, Vettura sostitutiva). Not per-offer.
|
|
301
|
+
* Same set of services across the network (Assicurazione RCA / Kasco /
|
|
302
|
+
* Incendio-Furto, Manutenzione, Assistenza Stradale, Bollo, Pneumatici, Veicolo in
|
|
303
|
+
* anticipo, Vettura sostitutiva). Not per-offer.
|
|
311
304
|
*/
|
|
312
305
|
export interface IncludedService {
|
|
313
306
|
name: string;
|
|
@@ -316,15 +309,15 @@ export namespace OfferRetrieveResponse {
|
|
|
316
309
|
}
|
|
317
310
|
|
|
318
311
|
/**
|
|
319
|
-
* One network dealer's quote for this offer
|
|
312
|
+
* One network dealer's quote for this offer.
|
|
320
313
|
*
|
|
321
|
-
* Sorted by `min_monthly_canon_eur ASC`. In
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
314
|
+
* Sorted by `min_monthly_canon_eur ASC`. In PartnerMAX this list is scoped to the
|
|
315
|
+
* calling partner's `partner_dealers` rows and returns the partner-owned
|
|
316
|
+
* `external_dealer_id`. Legacy `dlr_<id>` values remain only for compatibility
|
|
317
|
+
* callers.
|
|
325
318
|
*/
|
|
326
319
|
export interface NetworkOffer {
|
|
327
|
-
dealer_id:
|
|
320
|
+
dealer_id: string;
|
|
328
321
|
|
|
329
322
|
dealer_name: string;
|
|
330
323
|
|
|
@@ -348,10 +341,9 @@ export namespace OfferRetrieveResponse {
|
|
|
348
341
|
/**
|
|
349
342
|
* One priced cell of the 18-combination matrix.
|
|
350
343
|
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
* the list may contain fewer than 18 rows.
|
|
344
|
+
* Reflects the dealer-aware pricing formula applied to each (duration, yearly-km)
|
|
345
|
+
* combination. Cells with implausible canons are filtered upstream, so the list
|
|
346
|
+
* may contain fewer than 18 rows.
|
|
355
347
|
*/
|
|
356
348
|
export interface Quotation {
|
|
357
349
|
duration_months: number;
|
|
@@ -362,10 +354,9 @@ export namespace OfferRetrieveResponse {
|
|
|
362
354
|
}
|
|
363
355
|
|
|
364
356
|
/**
|
|
365
|
-
* Category tag for an offer
|
|
357
|
+
* Category tag for an offer.
|
|
366
358
|
*
|
|
367
|
-
*
|
|
368
|
-
* "Promo", "Stock pronto", "GreenChoice".
|
|
359
|
+
* Examples in production: "Promo", "Stock pronto", "GreenChoice".
|
|
369
360
|
*/
|
|
370
361
|
export interface Tag {
|
|
371
362
|
name: string;
|
|
@@ -376,36 +367,21 @@ export namespace OfferRetrieveResponse {
|
|
|
376
367
|
}
|
|
377
368
|
}
|
|
378
369
|
|
|
379
|
-
/**
|
|
380
|
-
* Cursor-paginated list of offer summaries.
|
|
381
|
-
*/
|
|
382
|
-
export interface OfferListResponse {
|
|
383
|
-
data: Array<NltOfferSummary>;
|
|
384
|
-
|
|
385
|
-
has_more: boolean;
|
|
386
|
-
|
|
387
|
-
next_cursor?: string | null;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
370
|
export interface OfferRetrieveParams {
|
|
391
371
|
dealer_id: string;
|
|
392
372
|
}
|
|
393
373
|
|
|
394
|
-
export interface OfferListParams {
|
|
374
|
+
export interface OfferListParams extends CursorPageParams {
|
|
395
375
|
brand?: string | null;
|
|
396
376
|
|
|
397
377
|
canone_max_eur?: number | null;
|
|
398
378
|
|
|
399
|
-
cursor?: string | null;
|
|
400
|
-
|
|
401
379
|
duration_months?: number | null;
|
|
402
380
|
|
|
403
381
|
fuel_type?: string | null;
|
|
404
382
|
|
|
405
383
|
km_per_year?: number | null;
|
|
406
384
|
|
|
407
|
-
limit?: number;
|
|
408
|
-
|
|
409
385
|
segment?: string | null;
|
|
410
386
|
|
|
411
387
|
/**
|
|
@@ -420,7 +396,7 @@ export declare namespace Offers {
|
|
|
420
396
|
export {
|
|
421
397
|
type NltOfferSummary as NltOfferSummary,
|
|
422
398
|
type OfferRetrieveResponse as OfferRetrieveResponse,
|
|
423
|
-
type
|
|
399
|
+
type NltOfferSummariesCursorPage as NltOfferSummariesCursorPage,
|
|
424
400
|
type OfferRetrieveParams as OfferRetrieveParams,
|
|
425
401
|
type OfferListParams as OfferListParams,
|
|
426
402
|
};
|
|
@@ -15,7 +15,7 @@ export class NltSettings extends APIResource {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Set markup percent (0-10)
|
|
18
|
+
* Set markup percent (0-10), three down-payment tiers, and image mode.
|
|
19
19
|
*
|
|
20
20
|
* Validation:
|
|
21
21
|
*
|
|
@@ -24,18 +24,9 @@ export class NltSettings extends APIResource {
|
|
|
24
24
|
* `{percent_of_list (0–100), fixed_eur (≥0)}`. No strict-ascending check — the
|
|
25
25
|
* final EUR per tier is offer-dependent (`listino_imponibile * pct + eur`).
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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.
|
|
27
|
+
* The stored economics are immediately used by DealerMAX's dealer-aware NLT
|
|
28
|
+
* calculator. There is NO `vat_treatment` field: VAT is per-offer, not per-dealer.
|
|
29
|
+
* The offer detail endpoint surfaces it per row instead.
|
|
39
30
|
*
|
|
40
31
|
* `Idempotency-Key` replay uses the shared endpoint helper; a re-applied identical
|
|
41
32
|
* PATCH is also a row-level no-op by construction.
|
|
@@ -63,49 +54,34 @@ export class NltSettings extends APIResource {
|
|
|
63
54
|
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
64
55
|
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
65
56
|
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
66
|
-
* semantics (low/medium/high) are advisory —
|
|
67
|
-
*
|
|
57
|
+
* semantics (low/medium/high) are advisory — DealerMAX UI treats the 3 positions
|
|
58
|
+
* as opaque slots ordered by intent.
|
|
68
59
|
*/
|
|
69
60
|
export interface DownPaymentTiers {
|
|
70
61
|
/**
|
|
71
62
|
* One down-payment tier — percent of list price + flat EUR.
|
|
72
63
|
*
|
|
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
64
|
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
79
|
-
* `12.5`, not `0.125`)
|
|
80
|
-
*
|
|
65
|
+
* `12.5`, not `0.125`). The final EUR applied to a deal is computed from the
|
|
66
|
+
* offer's IVA-excluded list price plus the flat component.
|
|
81
67
|
*/
|
|
82
68
|
high: DownPaymentTiers.High;
|
|
83
69
|
|
|
84
70
|
/**
|
|
85
71
|
* One down-payment tier — percent of list price + flat EUR.
|
|
86
72
|
*
|
|
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
73
|
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
93
|
-
* `12.5`, not `0.125`)
|
|
94
|
-
*
|
|
74
|
+
* `12.5`, not `0.125`). The final EUR applied to a deal is computed from the
|
|
75
|
+
* offer's IVA-excluded list price plus the flat component.
|
|
95
76
|
*/
|
|
96
77
|
low: DownPaymentTiers.Low;
|
|
97
78
|
|
|
98
79
|
/**
|
|
99
80
|
* One down-payment tier — percent of list price + flat EUR.
|
|
100
81
|
*
|
|
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
82
|
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
107
|
-
* `12.5`, not `0.125`)
|
|
108
|
-
*
|
|
83
|
+
* `12.5`, not `0.125`). The final EUR applied to a deal is computed from the
|
|
84
|
+
* offer's IVA-excluded list price plus the flat component.
|
|
109
85
|
*/
|
|
110
86
|
medium: DownPaymentTiers.Medium;
|
|
111
87
|
}
|
|
@@ -114,14 +90,9 @@ export namespace DownPaymentTiers {
|
|
|
114
90
|
/**
|
|
115
91
|
* One down-payment tier — percent of list price + flat EUR.
|
|
116
92
|
*
|
|
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
93
|
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
123
|
-
* `12.5`, not `0.125`)
|
|
124
|
-
*
|
|
94
|
+
* `12.5`, not `0.125`). The final EUR applied to a deal is computed from the
|
|
95
|
+
* offer's IVA-excluded list price plus the flat component.
|
|
125
96
|
*/
|
|
126
97
|
export interface High {
|
|
127
98
|
/**
|
|
@@ -140,14 +111,9 @@ export namespace DownPaymentTiers {
|
|
|
140
111
|
/**
|
|
141
112
|
* One down-payment tier — percent of list price + flat EUR.
|
|
142
113
|
*
|
|
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
114
|
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
149
|
-
* `12.5`, not `0.125`)
|
|
150
|
-
*
|
|
115
|
+
* `12.5`, not `0.125`). The final EUR applied to a deal is computed from the
|
|
116
|
+
* offer's IVA-excluded list price plus the flat component.
|
|
151
117
|
*/
|
|
152
118
|
export interface Low {
|
|
153
119
|
/**
|
|
@@ -166,14 +132,9 @@ export namespace DownPaymentTiers {
|
|
|
166
132
|
/**
|
|
167
133
|
* One down-payment tier — percent of list price + flat EUR.
|
|
168
134
|
*
|
|
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
135
|
* Partnermax API exposes `percent_of_list` as a 0–100 number (UI-friendly: write
|
|
175
|
-
* `12.5`, not `0.125`)
|
|
176
|
-
*
|
|
136
|
+
* `12.5`, not `0.125`). The final EUR applied to a deal is computed from the
|
|
137
|
+
* offer's IVA-excluded list price plus the flat component.
|
|
177
138
|
*/
|
|
178
139
|
export interface Medium {
|
|
179
140
|
/**
|
|
@@ -193,9 +154,8 @@ export namespace DownPaymentTiers {
|
|
|
193
154
|
/**
|
|
194
155
|
* Response model for GET / PATCH /v1/dealers/{id}/nlt-settings.
|
|
195
156
|
*
|
|
196
|
-
* Note: there is no `vat_treatment` field — VAT is a property of the offer
|
|
197
|
-
*
|
|
198
|
-
* VAT treatment per row instead.
|
|
157
|
+
* Note: there is no `vat_treatment` field — VAT is a property of the offer, not of
|
|
158
|
+
* the dealer. The offer detail returns the VAT treatment per row instead.
|
|
199
159
|
*/
|
|
200
160
|
export interface NltSettings {
|
|
201
161
|
agency_markup_percent: number;
|
|
@@ -208,8 +168,8 @@ export interface NltSettings {
|
|
|
208
168
|
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
209
169
|
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
210
170
|
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
211
|
-
* semantics (low/medium/high) are advisory —
|
|
212
|
-
*
|
|
171
|
+
* semantics (low/medium/high) are advisory — DealerMAX UI treats the 3 positions
|
|
172
|
+
* as opaque slots ordered by intent.
|
|
213
173
|
*/
|
|
214
174
|
down_payment_tiers: DownPaymentTiers;
|
|
215
175
|
|
|
@@ -234,8 +194,8 @@ export interface NltSettingUpdateParams {
|
|
|
234
194
|
* No strict-ascending validation: the final EUR amount depends on the offer's list
|
|
235
195
|
* price (`tier.percent_of_list / 100 * listino_imponibile + tier.fixed_eur`), so a
|
|
236
196
|
* tier that looks larger by % can produce a smaller EUR on cheap vehicles. Label
|
|
237
|
-
* semantics (low/medium/high) are advisory —
|
|
238
|
-
*
|
|
197
|
+
* semantics (low/medium/high) are advisory — DealerMAX UI treats the 3 positions
|
|
198
|
+
* as opaque slots ordered by intent.
|
|
239
199
|
*/
|
|
240
200
|
down_payment_tiers: DownPaymentTiers;
|
|
241
201
|
|
|
@@ -38,8 +38,9 @@ export class Images extends APIResource {
|
|
|
38
38
|
* List every photo attached to a vehicle, ordered by `position`.
|
|
39
39
|
*
|
|
40
40
|
* No pagination — a vehicle is capped at 20 photos so the full list always fits in
|
|
41
|
-
* a single response. `position=1` is the cover
|
|
42
|
-
* re-order
|
|
41
|
+
* a single response. `position=1` is the cover. There is no single-image
|
|
42
|
+
* retrieve/update route in v1: retrieve through this list and replace/re-order by
|
|
43
|
+
* deleting and re-posting the affected images.
|
|
43
44
|
*/
|
|
44
45
|
list(vehicleID: string, params: ImageListParams, options?: RequestOptions): APIPromise<VehicleImageList> {
|
|
45
46
|
const { dealer_id } = params;
|