@bisondesk/core-sdk 1.0.238 → 1.0.240

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.
Files changed (48) hide show
  1. package/lib/cjs/constants.js +4 -2
  2. package/lib/cjs/constants.js.map +1 -1
  3. package/lib/cjs/types/delivery-settings.js +3 -0
  4. package/lib/cjs/types/delivery-settings.js.map +1 -0
  5. package/lib/cjs/types/leasing-debtors.js +3 -0
  6. package/lib/cjs/types/leasing-debtors.js.map +1 -0
  7. package/lib/cjs/types/opportunities.js.map +1 -1
  8. package/lib/cjs/types/quotes.js +27 -7
  9. package/lib/cjs/types/quotes.js.map +1 -1
  10. package/lib/esm/constants.js +2 -0
  11. package/lib/esm/constants.js.map +1 -1
  12. package/lib/esm/types/delivery-settings.js +2 -0
  13. package/lib/esm/types/delivery-settings.js.map +1 -0
  14. package/lib/esm/types/leasing-debtors.js +2 -0
  15. package/lib/esm/types/leasing-debtors.js.map +1 -0
  16. package/lib/esm/types/opportunities.js.map +1 -1
  17. package/lib/esm/types/quotes.js +26 -6
  18. package/lib/esm/types/quotes.js.map +1 -1
  19. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  20. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  21. package/lib/types/constants.d.ts +2 -0
  22. package/lib/types/constants.d.ts.map +1 -1
  23. package/lib/types/types/delivery-settings.d.ts +57 -0
  24. package/lib/types/types/delivery-settings.d.ts.map +1 -0
  25. package/lib/types/types/leasing-debtors.d.ts +24 -0
  26. package/lib/types/types/leasing-debtors.d.ts.map +1 -0
  27. package/lib/types/types/leasing-search.d.ts +3 -0
  28. package/lib/types/types/leasing-search.d.ts.map +1 -1
  29. package/lib/types/types/leasing-settings.d.ts +18 -8
  30. package/lib/types/types/leasing-settings.d.ts.map +1 -1
  31. package/lib/types/types/opportunities.d.ts +142 -8
  32. package/lib/types/types/opportunities.d.ts.map +1 -1
  33. package/lib/types/types/quotes.d.ts +153 -19
  34. package/lib/types/types/quotes.d.ts.map +1 -1
  35. package/lib/types/types/settings.d.ts +4 -0
  36. package/lib/types/types/settings.d.ts.map +1 -1
  37. package/lib/types/types/tenants.d.ts +5 -1
  38. package/lib/types/types/tenants.d.ts.map +1 -1
  39. package/package.json +11 -6
  40. package/src/constants.ts +3 -0
  41. package/src/types/delivery-settings.ts +64 -0
  42. package/src/types/leasing-debtors.ts +28 -0
  43. package/src/types/leasing-search.ts +4 -0
  44. package/src/types/leasing-settings.ts +21 -8
  45. package/src/types/opportunities.ts +154 -8
  46. package/src/types/quotes.ts +162 -17
  47. package/src/types/settings.ts +4 -0
  48. package/src/types/tenants.ts +5 -1
@@ -1,9 +1,13 @@
1
- import { AttachmentValue } from '@bisondesk/commons-sdk/types';
1
+ import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';
2
2
  import { OpportunityType } from '../constants';
3
+ import { DeliveryParams } from './delivery-settings';
3
4
  import {
4
5
  CustomLeasingQuoteExtraInput,
6
+ CustomSalesQuoteExtraInput,
5
7
  LeasingDeliveryPackageInput,
6
8
  LeasingQuoteExtraInput,
9
+ LeasingQuoteParams,
10
+ SalesQuoteExtraInput,
7
11
  } from './leasing-settings';
8
12
  import { PricePercentageMode } from './utils';
9
13
 
@@ -12,6 +16,7 @@ export enum QuoteActions {
12
16
  VALIDATE = 'validate',
13
17
  DONWLOAD_PDFS = 'download-pdfs',
14
18
  CANCEL = 'cancel',
19
+ COMMERCIAL_REVIEW = 'commercial-review',
15
20
  }
16
21
 
17
22
  export enum QuoteStatus {
@@ -21,30 +26,48 @@ export enum QuoteStatus {
21
26
  ACCEPTED = 'accepted',
22
27
  REJECTED = 'rejected',
23
28
  CANCELLED = 'cancelled',
29
+ COMMERCIAL_REVIEW_REJECTED = 'commercialReviewRejected',
30
+ COMMERCIAL_REVIEW_ACCEPTED = 'commercialReviewAccepted',
24
31
  }
25
32
 
26
- export enum LeasingQuoteMetricsScore {
33
+ export enum QuoteMetricsScore {
27
34
  DANGER = 'danger',
28
35
  NEUTRAL = 'neutral',
29
36
  GOOD = 'good',
30
37
  }
38
+ export enum DeliveryTypes {
39
+ PICK_UP = 'pickUp',
40
+ ADDRESS = 'address',
41
+ PORT = 'port',
42
+ }
43
+
44
+ export enum SpoilerInfo {
45
+ MOUNT = 'mount',
46
+ UNMOUNT = 'unmount',
47
+ NO_ACTION = 'noAction',
48
+ }
31
49
 
32
- type BaseLeasingCalculatorInput = {
50
+ export enum TransportationMode {
51
+ BY_ROAD = 'byRoad',
52
+ ON_LOW_BED = 'onLowBed',
53
+ }
54
+
55
+ type BaseQuoteCalculatorInput = {
33
56
  branch: string;
34
57
  branchCountry: string;
35
58
  customerCountry: string;
36
59
  vehicleCategory: string;
60
+ currency: string;
61
+ bodywork?: string;
37
62
  };
38
63
 
39
- export type LeasingCalculatorDefaultInput = BaseLeasingCalculatorInput & {
64
+ export type LeasingCalculatorDefaultInput = BaseQuoteCalculatorInput & {
40
65
  salesPrice: string;
41
66
  purchasePrice: string;
42
67
  deliveryPackage?: LeasingQuoteExtraInput;
43
- extras?: LeasingQuoteExtraInput[];
44
- customRequests?: CustomLeasingQuoteExtraInput[];
45
68
  };
46
69
 
47
- export type LeasingCalculatorInput = BaseLeasingCalculatorInput & {
70
+ export type LeasingCalculatorInput = BaseQuoteCalculatorInput & {
48
71
  localLicensePlate: boolean;
49
72
  vanCourier: boolean;
50
73
  leasing: {
@@ -90,6 +113,60 @@ export type LeasingCalculatorInput = BaseLeasingCalculatorInput & {
90
113
  customRequests: CustomLeasingQuoteExtraInput[];
91
114
  };
92
115
 
116
+ type BaseDeliveryType = {
117
+ agreedPrice: string;
118
+ spoiler?: SpoilerInfo;
119
+ };
120
+
121
+ export type PickUpDeliveryType = BaseDeliveryType & {
122
+ type: DeliveryTypes.PICK_UP;
123
+ urgent: boolean;
124
+ transportationMode?: TransportationMode;
125
+ detailsBorderCrossing?: string;
126
+ detailsStacking?: string;
127
+ technicalControlNeeded: boolean;
128
+ insuranceNeeded: boolean;
129
+ licensePlateNeeded: boolean;
130
+ transitPlateNeeded: boolean;
131
+ };
132
+
133
+ export type AddressDeliveryType = BaseDeliveryType & {
134
+ type: DeliveryTypes.ADDRESS;
135
+ address: LocationValue;
136
+ distanceKm: string;
137
+ };
138
+
139
+ export type PortDeliverytype = BaseDeliveryType & {
140
+ type: DeliveryTypes.PORT;
141
+ portOriginId: string;
142
+ portDestinationId?: string;
143
+ shippingCompany?: string;
144
+ portToPortCostPrice: string;
145
+ portToPortMargin: string;
146
+ };
147
+
148
+ export type SalesCalculatorDefaultInput = BaseQuoteCalculatorInput & {
149
+ vehicle: {
150
+ agreedPrice: string;
151
+ purchasePrice: string;
152
+ comissionCost: string;
153
+ };
154
+ extras: SalesQuoteExtraInput[];
155
+ customRequests: CustomSalesQuoteExtraInput[];
156
+ };
157
+
158
+ export type SalesCalculatorInput = BaseQuoteCalculatorInput & {
159
+ vehicle: {
160
+ vatRate: string;
161
+ purchasePrice: string;
162
+ agreedPrice: string;
163
+ comissionCost: string;
164
+ };
165
+ delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;
166
+ extras: SalesQuoteExtraInput[];
167
+ customRequests: CustomSalesQuoteExtraInput[];
168
+ };
169
+
93
170
  export type LeasingCalculatorOutput = {
94
171
  vatApplicable: boolean;
95
172
  installment: string;
@@ -106,18 +183,18 @@ export type LeasingCalculatorOutput = {
106
183
  target: string;
107
184
  perYear: string;
108
185
  difference: string;
109
- score: LeasingQuoteMetricsScore;
186
+ score: QuoteMetricsScore;
110
187
  };
111
188
  cashflow: {
112
189
  deficit: string;
113
190
  balanced: boolean;
114
- score: LeasingQuoteMetricsScore;
191
+ score: QuoteMetricsScore;
115
192
  };
116
193
  profitability: {
117
194
  leasing: string;
118
195
  vehicle: string;
119
196
  total: string;
120
- score: LeasingQuoteMetricsScore;
197
+ score: QuoteMetricsScore;
121
198
  };
122
199
  taxes: {
123
200
  yearlyRetailPrice: string;
@@ -141,15 +218,50 @@ export type LeasingCalculatorOutput = {
141
218
  };
142
219
  };
143
220
 
144
- type BaseLeasingQuote = {
221
+ export type SalesCalculatorOutput = {
222
+ totalRetailAmount: string;
223
+ totalRetailAmountExclVat: string;
224
+ retailAmounts: {
225
+ vehicle: string;
226
+ delivery: string;
227
+ extras: string;
228
+ };
229
+ roi: { value: string; score: QuoteMetricsScore };
230
+ profit: { value: string; score: QuoteMetricsScore };
231
+ delivery: {
232
+ retailPrice?: string;
233
+ costPrice?: string;
234
+ cleaningNeeded: boolean;
235
+ cleaningNeededRetailPrice: string;
236
+ transportationToPortRetailPrice?: string;
237
+ };
238
+ costs: {
239
+ vehicle: string;
240
+ finalCostPrice: string;
241
+ extras: string;
242
+ delivery: string;
243
+ };
244
+ };
245
+
246
+ type BaseQuote = {
145
247
  opportunityId: string;
146
- calculatorInput: LeasingCalculatorInput;
147
- calculatorOutput: LeasingCalculatorOutput;
148
- type: OpportunityType;
149
248
  preferredLanguage: string;
150
- };
249
+ clientNotes?: string;
250
+ publicNotes?: string;
251
+ } & (
252
+ | {
253
+ type: OpportunityType.LEASING;
254
+ calculatorInput: LeasingCalculatorInput;
255
+ calculatorOutput: LeasingCalculatorOutput;
256
+ }
257
+ | {
258
+ type: OpportunityType.SALES;
259
+ calculatorInput: SalesCalculatorInput;
260
+ calculatorOutput: SalesCalculatorOutput;
261
+ }
262
+ );
151
263
 
152
- export type NewLeasingQuote = BaseLeasingQuote & {
264
+ export type NewQuote = BaseQuote & {
153
265
  id?: undefined;
154
266
  createdAt?: undefined;
155
267
  createdBy?: undefined;
@@ -158,7 +270,7 @@ export type NewLeasingQuote = BaseLeasingQuote & {
158
270
  active: true;
159
271
  };
160
272
 
161
- export type LeasingQuote = BaseLeasingQuote & {
273
+ export type Quote = BaseQuote & {
162
274
  id: string;
163
275
  createdAt: string;
164
276
  createdBy: string;
@@ -170,10 +282,13 @@ export type LeasingQuote = BaseLeasingQuote & {
170
282
  cancelledAt?: string;
171
283
  customerFeedbackAt?: string;
172
284
  customerFeedbackBy?: string;
285
+ commercialReviewAt?: string;
286
+ commercialReviewBy?: string;
173
287
  version: number;
174
288
  status: QuoteStatus;
175
289
  proformaPdf?: AttachmentValue;
176
290
  quotePdf?: AttachmentValue;
291
+ salesAgreementPdf?: AttachmentValue;
177
292
  active: boolean;
178
293
  contactId: string;
179
294
  vehicleId: string;
@@ -184,3 +299,33 @@ export type QuoteUpdate = {
184
299
  status?: QuoteStatus;
185
300
  active?: boolean;
186
301
  };
302
+
303
+ export type CalculatorLeasingIO = {
304
+ output: LeasingCalculatorOutput;
305
+ input: LeasingCalculatorInput;
306
+ };
307
+ export type CalculatorSalesIO = { output: SalesCalculatorOutput; input: SalesCalculatorInput };
308
+ export type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;
309
+
310
+ export type UsedVehiclesSalesParams = {
311
+ id: string;
312
+ modifiedAt: string;
313
+ modifiedBy: string;
314
+ countryCode: 'be';
315
+ name: string;
316
+ profitabilityDealGap: string;
317
+ exaDocumentCosts: string;
318
+ delivery?: DeliveryParams;
319
+ };
320
+
321
+ export type QuoteSettings = LeasingQuoteParams | UsedVehiclesSalesParams;
322
+
323
+ export type DeliveryLocationValue = Omit<LocationValue, 'addressLine1' | 'city'> & {
324
+ addressLine1: string;
325
+ city: string;
326
+ };
327
+
328
+ export type DeliveryRoutesRequest = {
329
+ origin: DeliveryLocationValue;
330
+ destination: DeliveryLocationValue;
331
+ };
@@ -31,6 +31,10 @@ export type HyperportalSettings = {
31
31
  contractDealDefinitionId: string;
32
32
  contractOwner: { [countryCode: string]: string };
33
33
  };
34
+ sales: {
35
+ active: boolean;
36
+ isaProcessDefinitionId: string;
37
+ };
34
38
  };
35
39
 
36
40
  export type HyperportalMachinesSettings = {
@@ -1,4 +1,4 @@
1
- import { Region } from '@bisondesk/commons-sdk/types';
1
+ import { LocationValue, Region } from '@bisondesk/commons-sdk/types';
2
2
 
3
3
  export type PublicTenant = {
4
4
  defaultCountry: string;
@@ -42,6 +42,10 @@ export type Branch = {
42
42
  currency: string;
43
43
  adminNumberPrefix: string;
44
44
  stockNumberPrefix: string;
45
+ vatRates: {
46
+ standard: string; //percentage value (e.g. 21)
47
+ };
48
+ location: LocationValue;
45
49
  };
46
50
 
47
51
  export type HdmsVehiclesSync = {