@bisondesk/core-sdk 1.0.239 → 1.0.242
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/apis/opportunities.js +19 -29
- package/lib/cjs/apis/opportunities.js.map +1 -1
- package/lib/cjs/apis/vehicles.js +17 -1
- package/lib/cjs/apis/vehicles.js.map +1 -1
- package/lib/cjs/constants.js +4 -2
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/types/crm.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/leasing-settings.js.map +1 -1
- 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/cjs/types/templates.js +0 -6
- package/lib/cjs/types/templates.js.map +1 -1
- package/lib/cjs/types/vehicles.js.map +1 -1
- package/lib/cjs/utils/tenants.js +6 -1
- package/lib/cjs/utils/tenants.js.map +1 -1
- package/lib/esm/apis/opportunities.js +17 -25
- package/lib/esm/apis/opportunities.js.map +1 -1
- package/lib/esm/apis/vehicles.js +15 -0
- package/lib/esm/apis/vehicles.js.map +1 -1
- package/lib/esm/constants.js +2 -0
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/types/crm.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/leasing-settings.js.map +1 -1
- 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/esm/types/templates.js +1 -5
- package/lib/esm/types/templates.js.map +1 -1
- package/lib/esm/types/vehicles.js.map +1 -1
- package/lib/esm/utils/tenants.js +4 -0
- package/lib/esm/utils/tenants.js.map +1 -1
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/apis/opportunities.d.ts +2 -0
- package/lib/types/apis/opportunities.d.ts.map +1 -1
- package/lib/types/apis/vehicles.d.ts +6 -0
- package/lib/types/apis/vehicles.d.ts.map +1 -1
- package/lib/types/constants.d.ts +2 -0
- package/lib/types/constants.d.ts.map +1 -1
- package/lib/types/types/crm.d.ts +1 -0
- package/lib/types/types/crm.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-debtors.d.ts +3 -0
- package/lib/types/types/leasing-debtors.d.ts.map +1 -1
- package/lib/types/types/leasing-settings.d.ts +21 -8
- package/lib/types/types/leasing-settings.d.ts.map +1 -1
- package/lib/types/types/opportunities.d.ts +138 -8
- package/lib/types/types/opportunities.d.ts.map +1 -1
- package/lib/types/types/quotes.d.ts +154 -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/templates.d.ts +7 -9
- package/lib/types/types/templates.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/lib/types/types/vehicles.d.ts +7 -0
- package/lib/types/types/vehicles.d.ts.map +1 -1
- package/lib/types/utils/tenants.d.ts +1 -0
- package/lib/types/utils/tenants.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/apis/opportunities.ts +47 -55
- package/src/apis/vehicles.ts +26 -0
- package/src/constants.ts +4 -0
- package/src/types/crm.ts +1 -0
- package/src/types/delivery-settings.ts +64 -0
- package/src/types/leasing-debtors.ts +3 -0
- package/src/types/leasing-settings.ts +23 -8
- package/src/types/leasing.ts +1 -1
- package/src/types/opportunities.ts +150 -8
- package/src/types/quotes.ts +163 -17
- package/src/types/settings.ts +4 -0
- package/src/types/templates.ts +16 -19
- package/src/types/tenants.ts +5 -1
- package/src/types/vehicles.ts +8 -0
- package/src/utils/tenants.ts +5 -0
|
@@ -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
|
|
|
@@ -163,15 +163,17 @@ export type PaymentSummary = {
|
|
|
163
163
|
entries: DataRecord<Payment>[];
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
+
export type VehicleBffMetadata = {
|
|
167
|
+
openOpportunities: number;
|
|
168
|
+
latestAcceptedOpportunity?: { id: string; status: OpportunityStatus; accountManager?: string };
|
|
169
|
+
};
|
|
170
|
+
|
|
166
171
|
export type OpportunityBFF = {
|
|
167
|
-
related: {
|
|
168
|
-
sameVehicleOpenOpportunities?: number;
|
|
169
|
-
};
|
|
170
172
|
opportunity: DataRecord<Opportunity, ReferenceData>;
|
|
171
|
-
vehicle?: DataRecord<Vehicle>;
|
|
173
|
+
vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;
|
|
172
174
|
bids: DataRecord<Bid>[];
|
|
173
|
-
quotes: DataRecord<
|
|
174
|
-
activeQuote?: DataRecord<
|
|
175
|
+
quotes: DataRecord<Quote>[];
|
|
176
|
+
activeQuote?: DataRecord<Quote>;
|
|
175
177
|
payments: PaymentSummary | undefined;
|
|
176
178
|
customer?: {
|
|
177
179
|
contact: DataRecord<Contact>;
|
|
@@ -188,7 +190,7 @@ export type OpportunityEvent = {
|
|
|
188
190
|
};
|
|
189
191
|
|
|
190
192
|
export type QuoteEvent = {
|
|
191
|
-
quote:
|
|
193
|
+
quote: Quote;
|
|
192
194
|
opportunity: Opportunity;
|
|
193
195
|
action: 'create' | 'update' | 'delete';
|
|
194
196
|
actionAt: string;
|
|
@@ -316,6 +318,88 @@ export type LeasingProformaTemplateData = {
|
|
|
316
318
|
};
|
|
317
319
|
};
|
|
318
320
|
|
|
321
|
+
export type SalesProformaTemplateData = {
|
|
322
|
+
opportunity: {
|
|
323
|
+
id: string;
|
|
324
|
+
offerNumber: string;
|
|
325
|
+
};
|
|
326
|
+
currentDate: string;
|
|
327
|
+
accountManager: {
|
|
328
|
+
fullName: string;
|
|
329
|
+
email: string;
|
|
330
|
+
phone: string;
|
|
331
|
+
};
|
|
332
|
+
vehicle: {
|
|
333
|
+
line1: string;
|
|
334
|
+
line2: string;
|
|
335
|
+
stockNumber: string;
|
|
336
|
+
};
|
|
337
|
+
c: {
|
|
338
|
+
organizationId?: string;
|
|
339
|
+
clientNumber: number;
|
|
340
|
+
company: string;
|
|
341
|
+
fullName: string;
|
|
342
|
+
vatNumber?: string;
|
|
343
|
+
email?: string;
|
|
344
|
+
phone?: string;
|
|
345
|
+
address?: string;
|
|
346
|
+
};
|
|
347
|
+
i: {
|
|
348
|
+
description: string;
|
|
349
|
+
vat: string;
|
|
350
|
+
quantity: number;
|
|
351
|
+
unitPriceExclVat: string;
|
|
352
|
+
amount: string;
|
|
353
|
+
amountExclVat: string;
|
|
354
|
+
}[];
|
|
355
|
+
t: {
|
|
356
|
+
totalExclVat: string;
|
|
357
|
+
vatAmount: string;
|
|
358
|
+
total: string;
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
export type SalesAgreementTemplateData = {
|
|
363
|
+
opportunity: {
|
|
364
|
+
id: string;
|
|
365
|
+
offerNumber: string;
|
|
366
|
+
};
|
|
367
|
+
currentDate: string;
|
|
368
|
+
accountManager: {
|
|
369
|
+
fullName: string;
|
|
370
|
+
email: string;
|
|
371
|
+
phone: string;
|
|
372
|
+
};
|
|
373
|
+
vehicle: {
|
|
374
|
+
line1: string;
|
|
375
|
+
line2: string;
|
|
376
|
+
stockNumber: string;
|
|
377
|
+
};
|
|
378
|
+
c: {
|
|
379
|
+
organizationId?: string;
|
|
380
|
+
clientNumber: number;
|
|
381
|
+
company: string;
|
|
382
|
+
fullName: string;
|
|
383
|
+
vatNumber?: string;
|
|
384
|
+
email?: string;
|
|
385
|
+
phone?: string;
|
|
386
|
+
address?: string;
|
|
387
|
+
};
|
|
388
|
+
i: {
|
|
389
|
+
description: string;
|
|
390
|
+
vat: string;
|
|
391
|
+
quantity: number;
|
|
392
|
+
unitPriceExclVat: string;
|
|
393
|
+
amount: string;
|
|
394
|
+
amountExclVat: string;
|
|
395
|
+
}[];
|
|
396
|
+
t: {
|
|
397
|
+
totalExclVat: string;
|
|
398
|
+
vatAmount: string;
|
|
399
|
+
total: string;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
|
|
319
403
|
export type OpportunitiesKanbanColumn = {
|
|
320
404
|
status: string;
|
|
321
405
|
results: SearchOpportunity[];
|
|
@@ -490,6 +574,64 @@ export type CashOutRow = {
|
|
|
490
574
|
cumulativeCash: number;
|
|
491
575
|
};
|
|
492
576
|
|
|
577
|
+
export type HpIsaProcessRequest = {
|
|
578
|
+
tenantId: string;
|
|
579
|
+
initiatedBy: 'bisondesk';
|
|
580
|
+
processMetaId: string;
|
|
581
|
+
processRunData: {
|
|
582
|
+
entityOwner: string;
|
|
583
|
+
|
|
584
|
+
company?: string; //entityId
|
|
585
|
+
proofOfSaleCustomerAgreement?: string; //entityId
|
|
586
|
+
|
|
587
|
+
vehicle?: string; //entityId
|
|
588
|
+
bodywork?: string; //entityId
|
|
589
|
+
vehicleCategory: string; //entityId
|
|
590
|
+
|
|
591
|
+
amountOfCommissionPaid: number;
|
|
592
|
+
dealValidated: boolean;
|
|
593
|
+
dealCancelled: boolean;
|
|
594
|
+
opportunityId: string;
|
|
595
|
+
typeOfDelivery: string; //entity Id
|
|
596
|
+
|
|
597
|
+
//PickUP Delivery
|
|
598
|
+
urgentDelivery?: boolean;
|
|
599
|
+
dateOfPickUpByCustomer?: number;
|
|
600
|
+
modeOfTransportPickUpByCustomer?: string; //entity Id
|
|
601
|
+
detailsOfStacking?: string; //entity Id
|
|
602
|
+
detailsOfBorderCrossing?: string;
|
|
603
|
+
technicalControlNeeded?: boolean;
|
|
604
|
+
insuranceNeeded?: boolean;
|
|
605
|
+
licensePlateNeeded?: boolean;
|
|
606
|
+
transitPlateNeeded?: boolean;
|
|
607
|
+
|
|
608
|
+
//Address Delivery
|
|
609
|
+
addressOfDelivery?: string;
|
|
610
|
+
kmToAddressOfDelivery?: number;
|
|
611
|
+
|
|
612
|
+
//To Port Delivery
|
|
613
|
+
portOfDelivery?: string; //entity Id
|
|
614
|
+
shippingCompany?: string; //string Id
|
|
615
|
+
destinationPort?: string;
|
|
616
|
+
cleaningDegassingNeeded?: boolean;
|
|
617
|
+
agreedPrice?: string;
|
|
618
|
+
|
|
619
|
+
//Extras
|
|
620
|
+
garageExtrasCodes: string[];
|
|
621
|
+
logisticsExtrasCodes: string[];
|
|
622
|
+
administrationExtrasCodes: string[];
|
|
623
|
+
allExtrasDescriptions: string[];
|
|
624
|
+
customRequestDescriptions: string[];
|
|
625
|
+
infoSpoiler: string; // entity Id
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
export type HpIsaProcessResponse = {
|
|
630
|
+
entityId: string;
|
|
631
|
+
id: string;
|
|
632
|
+
status: string;
|
|
633
|
+
};
|
|
634
|
+
|
|
493
635
|
export type SwitchOpportunityVehicleRequest = {
|
|
494
636
|
opportunityId: string;
|
|
495
637
|
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
|
+
MANAGER_REJECTED = 'commercialReviewRejected',
|
|
30
|
+
MANAGER_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
|
+
managerFeedbackAt?: string;
|
|
286
|
+
managerFeedbackBy?: 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,34 @@ 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
|
+
conglomerateProfitabilityDealGap: string;
|
|
318
|
+
exaDocumentCosts: string;
|
|
319
|
+
delivery?: DeliveryParams;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
export type QuoteSettings = LeasingQuoteParams | UsedVehiclesSalesParams;
|
|
323
|
+
|
|
324
|
+
export type DeliveryLocationValue = Omit<LocationValue, 'addressLine1' | 'city'> & {
|
|
325
|
+
addressLine1: string;
|
|
326
|
+
city: string;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
export type DeliveryRoutesRequest = {
|
|
330
|
+
origin: DeliveryLocationValue;
|
|
331
|
+
destination: DeliveryLocationValue;
|
|
332
|
+
};
|
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/templates.ts
CHANGED
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type: TemplateType.Email;
|
|
9
|
-
subject: string;
|
|
10
|
-
content: {
|
|
11
|
-
html: string;
|
|
12
|
-
design: any;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
| {
|
|
16
|
-
type: TemplateType.Sms;
|
|
17
|
-
content: string;
|
|
18
|
-
};
|
|
1
|
+
export type TemplateContent = {
|
|
2
|
+
subject: string;
|
|
3
|
+
content: {
|
|
4
|
+
html: string;
|
|
5
|
+
design: any;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
19
8
|
|
|
20
9
|
export type NewTemplateRequest = {
|
|
21
10
|
id?: string;
|
|
22
11
|
country: string;
|
|
12
|
+
tags?: any;
|
|
23
13
|
name: string;
|
|
24
14
|
} & TemplateContent;
|
|
25
15
|
|
|
@@ -27,6 +17,8 @@ export type Template = {
|
|
|
27
17
|
id: string;
|
|
28
18
|
modifiedAt: string;
|
|
29
19
|
modifiedBy: string;
|
|
20
|
+
tags?: any;
|
|
21
|
+
|
|
30
22
|
country: string;
|
|
31
23
|
name: string;
|
|
32
24
|
} & TemplateContent;
|
|
@@ -36,5 +28,10 @@ export type TemplateInfo = {
|
|
|
36
28
|
countries: string[];
|
|
37
29
|
modifiedAt: string;
|
|
38
30
|
name: string;
|
|
39
|
-
|
|
31
|
+
tags?: any;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type UpdateTemplateInfoRequest = {
|
|
35
|
+
name: string;
|
|
36
|
+
tags?: any;
|
|
40
37
|
};
|
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 = {
|
package/src/types/vehicles.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EmailDestination } from '@bisondesk/commons-sdk/messages';
|
|
1
2
|
import {
|
|
2
3
|
AttachmentValue,
|
|
3
4
|
Document,
|
|
@@ -594,3 +595,10 @@ export enum VehicleActions {
|
|
|
594
595
|
ViewLeads = 'view_leads',
|
|
595
596
|
ViewSimilarOnline = 'view_similar_online',
|
|
596
597
|
}
|
|
598
|
+
|
|
599
|
+
export type VehicleShareEmailRequest = {
|
|
600
|
+
country: string; // Lowercase ISO 3166-1 alpha-2 code, e.g. 'be'
|
|
601
|
+
to: EmailDestination[];
|
|
602
|
+
message: string;
|
|
603
|
+
pictures: AttachmentValue[];
|
|
604
|
+
};
|
package/src/utils/tenants.ts
CHANGED
|
@@ -12,3 +12,8 @@ export const getBranch = (tenant: Tenant, branchId: string): Branch => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export const getDefaultBranch = (tenant: Tenant): Branch => first(tenant.branches)!;
|
|
15
|
+
|
|
16
|
+
export const getBranchStandardVatRate = (tenant: Tenant, branchId: string): string => {
|
|
17
|
+
const branch: Branch = getBranch(tenant, branchId);
|
|
18
|
+
return branch.vatRates.standard;
|
|
19
|
+
};
|