@bisondesk/core-sdk 1.0.239 → 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.
- package/lib/cjs/constants.js +3 -2
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/types/delivery-settings.js +3 -0
- package/lib/cjs/types/delivery-settings.js.map +1 -0
- package/lib/cjs/types/opportunities.js.map +1 -1
- package/lib/cjs/types/quotes.js +27 -7
- package/lib/cjs/types/quotes.js.map +1 -1
- package/lib/esm/constants.js +1 -0
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/types/delivery-settings.js +2 -0
- package/lib/esm/types/delivery-settings.js.map +1 -0
- package/lib/esm/types/opportunities.js.map +1 -1
- package/lib/esm/types/quotes.js +26 -6
- package/lib/esm/types/quotes.js.map +1 -1
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/constants.d.ts +1 -0
- package/lib/types/constants.d.ts.map +1 -1
- package/lib/types/types/delivery-settings.d.ts +57 -0
- package/lib/types/types/delivery-settings.d.ts.map +1 -0
- package/lib/types/types/leasing-settings.d.ts +18 -8
- package/lib/types/types/leasing-settings.d.ts.map +1 -1
- package/lib/types/types/opportunities.d.ts +142 -8
- package/lib/types/types/opportunities.d.ts.map +1 -1
- package/lib/types/types/quotes.d.ts +153 -19
- package/lib/types/types/quotes.d.ts.map +1 -1
- package/lib/types/types/settings.d.ts +4 -0
- package/lib/types/types/settings.d.ts.map +1 -1
- package/lib/types/types/tenants.d.ts +5 -1
- package/lib/types/types/tenants.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/constants.ts +1 -0
- package/src/types/delivery-settings.ts +64 -0
- package/src/types/leasing-settings.ts +21 -8
- package/src/types/opportunities.ts +154 -8
- package/src/types/quotes.ts +162 -17
- package/src/types/settings.ts +4 -0
- package/src/types/tenants.ts +5 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { LocationValue } from '@bisondesk/commons-sdk/types';
|
|
2
|
+
|
|
3
|
+
type BaseDeliveryPort = {
|
|
4
|
+
name: string;
|
|
5
|
+
address: LocationValue;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type NewDeliveryPort = BaseDeliveryPort & {
|
|
9
|
+
id: undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type DeliveryPort = BaseDeliveryPort & {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type BaseTransportationToPort = {
|
|
17
|
+
portId: string;
|
|
18
|
+
branchId: string;
|
|
19
|
+
retailPrice: string;
|
|
20
|
+
costPrice: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type NewTransportationToPort = BaseTransportationToPort & {
|
|
24
|
+
id?: undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type TransportationToPort = BaseTransportationToPort & {
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type CurrencyInput = {
|
|
32
|
+
currency: string;
|
|
33
|
+
conversionRate: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type DeliveryParams = {
|
|
37
|
+
id: string;
|
|
38
|
+
modifiedAt: string;
|
|
39
|
+
port: {
|
|
40
|
+
supplementCosts: string;
|
|
41
|
+
cleaningCosts: string;
|
|
42
|
+
dhlCosts: string;
|
|
43
|
+
looseTrailerCosts: string;
|
|
44
|
+
portToPortMargin: string;
|
|
45
|
+
};
|
|
46
|
+
address: {
|
|
47
|
+
priceKmCost: string;
|
|
48
|
+
priceKmRetail: string;
|
|
49
|
+
};
|
|
50
|
+
services: {
|
|
51
|
+
spoilerMountCost: string;
|
|
52
|
+
spoilerMountRetailPrice: string;
|
|
53
|
+
spoilerUnmountCost: string;
|
|
54
|
+
spoilerUnmountRetailPrice: string;
|
|
55
|
+
transportationLowBedCost: string;
|
|
56
|
+
transportationLowBedRetailPrice: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type DeliverySettings = {
|
|
61
|
+
transportationToPort: TransportationToPort;
|
|
62
|
+
originPort: DeliveryPort;
|
|
63
|
+
destinationPort?: DeliveryPort;
|
|
64
|
+
};
|
|
@@ -42,7 +42,7 @@ export type LeasingQuoteParams = { id: string; name: string; modifiedAt: string
|
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
type
|
|
45
|
+
type BaseQuoteExtraSettings = {
|
|
46
46
|
referenceCode: string;
|
|
47
47
|
active: boolean;
|
|
48
48
|
costPrice: string;
|
|
@@ -58,7 +58,7 @@ type BaseLeasingQuoteExtraSettings = {
|
|
|
58
58
|
opportunityTypeRestrictions: OpportunityType[];
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
export type
|
|
61
|
+
export type BaseQuoteExtraInput = {
|
|
62
62
|
agreedPrice: string;
|
|
63
63
|
costPrice: string;
|
|
64
64
|
hint?: MultiLangValue;
|
|
@@ -70,11 +70,11 @@ export type BaseLeasingQuoteExtraInput = {
|
|
|
70
70
|
departmentTitles?: { [department: string]: string };
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
export type
|
|
73
|
+
export type NewQuoteExtraSettings = BaseQuoteExtraSettings & {
|
|
74
74
|
id?: undefined;
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
export type
|
|
77
|
+
export type QuoteExtraSettings = BaseQuoteExtraSettings & {
|
|
78
78
|
id: string;
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -84,20 +84,20 @@ export enum LeasingItemsPaymentSplit {
|
|
|
84
84
|
Company = 'company',
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
export type LeasingDeliveryPackageInput =
|
|
87
|
+
export type LeasingDeliveryPackageInput = BaseQuoteExtraInput & { salesPrice: string };
|
|
88
88
|
|
|
89
|
-
export type CustomLeasingQuoteExtraInput =
|
|
89
|
+
export type CustomLeasingQuoteExtraInput = BaseQuoteExtraInput & {
|
|
90
90
|
paymentSplit: LeasingItemsPaymentSplit;
|
|
91
91
|
leasingPercentage: string;
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
export type LeasingQuoteExtraInput =
|
|
94
|
+
export type LeasingQuoteExtraInput = BaseQuoteExtraInput & {
|
|
95
95
|
salesPrice: string;
|
|
96
96
|
paymentSplit: LeasingItemsPaymentSplit;
|
|
97
97
|
leasingPercentage: string;
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
export type
|
|
100
|
+
export type QuoteExtrasRequest = {
|
|
101
101
|
deliveryPackage?: boolean;
|
|
102
102
|
displayByDefault?: boolean;
|
|
103
103
|
vehicleCategory?: Categories;
|
|
@@ -109,3 +109,16 @@ export type LeasingQuoteExtrasRequest = {
|
|
|
109
109
|
sortBy?: SortFilter;
|
|
110
110
|
opportunityType?: OpportunityType;
|
|
111
111
|
};
|
|
112
|
+
|
|
113
|
+
export type InternalQuoteExtrasRequest = QuoteExtrasRequest & {
|
|
114
|
+
opportunityType?: OpportunityType;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export type SalesQuoteExtraInput = BaseQuoteExtraInput & {
|
|
118
|
+
salesPrice: string;
|
|
119
|
+
vatPercentage: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export type CustomSalesQuoteExtraInput = BaseQuoteExtraInput & {
|
|
123
|
+
vatPercentage: string;
|
|
124
|
+
};
|
|
@@ -3,7 +3,7 @@ import { OpportunityType } from '../constants';
|
|
|
3
3
|
import { Contact, Organization } from './crm';
|
|
4
4
|
import { Interest } from './leads';
|
|
5
5
|
import { Payment } from './payments';
|
|
6
|
-
import {
|
|
6
|
+
import { Quote, QuoteStatus } from './quotes';
|
|
7
7
|
import { DataRecord, ReferenceData } from './utils';
|
|
8
8
|
import { Vehicle } from './vehicles';
|
|
9
9
|
|
|
@@ -127,6 +127,8 @@ export type Opportunity = BaseOpportunity & {
|
|
|
127
127
|
lostReason?: OpportunityLostReasonValues;
|
|
128
128
|
deliveredAt?: string;
|
|
129
129
|
deliveredBy?: string;
|
|
130
|
+
commercialReviewAt?: string;
|
|
131
|
+
commercialReviewBy?: string;
|
|
130
132
|
status: OpportunityStatus;
|
|
131
133
|
dealStatus?: OpportunityDealStatus;
|
|
132
134
|
logisticStatus?: OpportunityLogisticStatus;
|
|
@@ -163,15 +165,20 @@ export type PaymentSummary = {
|
|
|
163
165
|
entries: DataRecord<Payment>[];
|
|
164
166
|
};
|
|
165
167
|
|
|
166
|
-
export type
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
export type VehicleBffMetadata = {
|
|
169
|
+
openOpportunities: {
|
|
170
|
+
total: number;
|
|
171
|
+
list: { id: string; status: OpportunityStatus; accountManager?: string }[];
|
|
169
172
|
};
|
|
173
|
+
concurrentQuote: boolean;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export type OpportunityBFF = {
|
|
170
177
|
opportunity: DataRecord<Opportunity, ReferenceData>;
|
|
171
|
-
vehicle?: DataRecord<Vehicle>;
|
|
178
|
+
vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;
|
|
172
179
|
bids: DataRecord<Bid>[];
|
|
173
|
-
quotes: DataRecord<
|
|
174
|
-
activeQuote?: DataRecord<
|
|
180
|
+
quotes: DataRecord<Quote>[];
|
|
181
|
+
activeQuote?: DataRecord<Quote>;
|
|
175
182
|
payments: PaymentSummary | undefined;
|
|
176
183
|
customer?: {
|
|
177
184
|
contact: DataRecord<Contact>;
|
|
@@ -188,7 +195,7 @@ export type OpportunityEvent = {
|
|
|
188
195
|
};
|
|
189
196
|
|
|
190
197
|
export type QuoteEvent = {
|
|
191
|
-
quote:
|
|
198
|
+
quote: Quote;
|
|
192
199
|
opportunity: Opportunity;
|
|
193
200
|
action: 'create' | 'update' | 'delete';
|
|
194
201
|
actionAt: string;
|
|
@@ -316,6 +323,88 @@ export type LeasingProformaTemplateData = {
|
|
|
316
323
|
};
|
|
317
324
|
};
|
|
318
325
|
|
|
326
|
+
export type SalesProformaTemplateData = {
|
|
327
|
+
opportunity: {
|
|
328
|
+
id: string;
|
|
329
|
+
offerNumber: string;
|
|
330
|
+
};
|
|
331
|
+
currentDate: string;
|
|
332
|
+
accountManager: {
|
|
333
|
+
fullName: string;
|
|
334
|
+
email: string;
|
|
335
|
+
phone: string;
|
|
336
|
+
};
|
|
337
|
+
vehicle: {
|
|
338
|
+
line1: string;
|
|
339
|
+
line2: string;
|
|
340
|
+
stockNumber: string;
|
|
341
|
+
};
|
|
342
|
+
c: {
|
|
343
|
+
organizationId?: string;
|
|
344
|
+
clientNumber: number;
|
|
345
|
+
company: string;
|
|
346
|
+
fullName: string;
|
|
347
|
+
vatNumber?: string;
|
|
348
|
+
email?: string;
|
|
349
|
+
phone?: string;
|
|
350
|
+
address?: string;
|
|
351
|
+
};
|
|
352
|
+
i: {
|
|
353
|
+
description: string;
|
|
354
|
+
vat: string;
|
|
355
|
+
quantity: number;
|
|
356
|
+
unitPriceExclVat: string;
|
|
357
|
+
amount: string;
|
|
358
|
+
amountExclVat: string;
|
|
359
|
+
}[];
|
|
360
|
+
t: {
|
|
361
|
+
totalExclVat: string;
|
|
362
|
+
vatAmount: string;
|
|
363
|
+
total: string;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
export type SalesAgreementTemplateData = {
|
|
368
|
+
opportunity: {
|
|
369
|
+
id: string;
|
|
370
|
+
offerNumber: string;
|
|
371
|
+
};
|
|
372
|
+
currentDate: string;
|
|
373
|
+
accountManager: {
|
|
374
|
+
fullName: string;
|
|
375
|
+
email: string;
|
|
376
|
+
phone: string;
|
|
377
|
+
};
|
|
378
|
+
vehicle: {
|
|
379
|
+
line1: string;
|
|
380
|
+
line2: string;
|
|
381
|
+
stockNumber: string;
|
|
382
|
+
};
|
|
383
|
+
c: {
|
|
384
|
+
organizationId?: string;
|
|
385
|
+
clientNumber: number;
|
|
386
|
+
company: string;
|
|
387
|
+
fullName: string;
|
|
388
|
+
vatNumber?: string;
|
|
389
|
+
email?: string;
|
|
390
|
+
phone?: string;
|
|
391
|
+
address?: string;
|
|
392
|
+
};
|
|
393
|
+
i: {
|
|
394
|
+
description: string;
|
|
395
|
+
vat: string;
|
|
396
|
+
quantity: number;
|
|
397
|
+
unitPriceExclVat: string;
|
|
398
|
+
amount: string;
|
|
399
|
+
amountExclVat: string;
|
|
400
|
+
}[];
|
|
401
|
+
t: {
|
|
402
|
+
totalExclVat: string;
|
|
403
|
+
vatAmount: string;
|
|
404
|
+
total: string;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
|
|
319
408
|
export type OpportunitiesKanbanColumn = {
|
|
320
409
|
status: string;
|
|
321
410
|
results: SearchOpportunity[];
|
|
@@ -490,6 +579,63 @@ export type CashOutRow = {
|
|
|
490
579
|
cumulativeCash: number;
|
|
491
580
|
};
|
|
492
581
|
|
|
582
|
+
export type HpIsaProcessRequest = {
|
|
583
|
+
tenantId: string;
|
|
584
|
+
initiatedBy: 'bisondesk';
|
|
585
|
+
processMetaId: string;
|
|
586
|
+
processRunData: {
|
|
587
|
+
entityOwner: string;
|
|
588
|
+
|
|
589
|
+
company?: string; //entityId
|
|
590
|
+
proofOfSaleCustomerAgreement?: string; //entityId
|
|
591
|
+
|
|
592
|
+
vehicle?: string; //entityId
|
|
593
|
+
bodywork?: string; //entityId
|
|
594
|
+
vehicleCategory: string; //entityId
|
|
595
|
+
|
|
596
|
+
amountOfCommissionPaid: number;
|
|
597
|
+
dealValidated: boolean;
|
|
598
|
+
dealCancelled: boolean;
|
|
599
|
+
opportunityId: string;
|
|
600
|
+
typeOfDelivery: string; //entity Id
|
|
601
|
+
|
|
602
|
+
//PickUP Delivery
|
|
603
|
+
urgentDelivery?: boolean;
|
|
604
|
+
dateOfPickUpByCustomer?: number;
|
|
605
|
+
modeOfTransportPickUpByCustomer?: string; //entity Id
|
|
606
|
+
detailsOfStacking?: string; //entity Id
|
|
607
|
+
detailsOfBorderCrossing?: string;
|
|
608
|
+
technicalControlNeeded?: boolean;
|
|
609
|
+
insuranceNeeded?: boolean;
|
|
610
|
+
licensePlateNeeded?: boolean;
|
|
611
|
+
transitPlateNeeded?: boolean;
|
|
612
|
+
|
|
613
|
+
//Address Delivery
|
|
614
|
+
addressOfDelivery?: string;
|
|
615
|
+
kmToAddressOfDelivery?: number;
|
|
616
|
+
|
|
617
|
+
//To Port Delivery
|
|
618
|
+
portOfDelivery?: string; //entity Id
|
|
619
|
+
shippingCompany?: string; //string Id
|
|
620
|
+
destinationPort?: string;
|
|
621
|
+
cleaningDegassingNeeded?: boolean;
|
|
622
|
+
agreedPrice?: string;
|
|
623
|
+
|
|
624
|
+
//Extras
|
|
625
|
+
garageExtrasCodes: string[];
|
|
626
|
+
logisticsExtrasCodes: string[];
|
|
627
|
+
administrationExtrasCodes: string[];
|
|
628
|
+
allExtrasDescriptions: string[];
|
|
629
|
+
customRequestDescriptions: string[];
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
export type HpIsaProcessResponse = {
|
|
634
|
+
entityId: string;
|
|
635
|
+
id: string;
|
|
636
|
+
status: string;
|
|
637
|
+
};
|
|
638
|
+
|
|
493
639
|
export type SwitchOpportunityVehicleRequest = {
|
|
494
640
|
opportunityId: string;
|
|
495
641
|
newVehicleId: string;
|
package/src/types/quotes.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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:
|
|
186
|
+
score: QuoteMetricsScore;
|
|
110
187
|
};
|
|
111
188
|
cashflow: {
|
|
112
189
|
deficit: string;
|
|
113
190
|
balanced: boolean;
|
|
114
|
-
score:
|
|
191
|
+
score: QuoteMetricsScore;
|
|
115
192
|
};
|
|
116
193
|
profitability: {
|
|
117
194
|
leasing: string;
|
|
118
195
|
vehicle: string;
|
|
119
196
|
total: string;
|
|
120
|
-
score:
|
|
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
|
|
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
|
|
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
|
|
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
|
+
};
|
package/src/types/settings.ts
CHANGED
|
@@ -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 = {
|
package/src/types/tenants.ts
CHANGED
|
@@ -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 = {
|