@bisondesk/core-sdk 1.0.169 → 1.0.171
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/apis/crm.d.ts.map +1 -1
- package/lib/apis/crm.js +1 -1
- package/lib/apis/crm.js.map +1 -1
- package/lib/apis/documents.js +1 -1
- package/lib/apis/documents.js.map +1 -1
- package/lib/apis/internet-vehicles.js +1 -1
- package/lib/apis/internet-vehicles.js.map +1 -1
- package/lib/apis/leasing-administration.js +1 -1
- package/lib/apis/leasing-administration.js.map +1 -1
- package/lib/apis/leasing.js +1 -1
- package/lib/apis/leasing.js.map +1 -1
- package/lib/apis/picklists.d.ts.map +1 -1
- package/lib/apis/picklists.js +1 -1
- package/lib/apis/picklists.js.map +1 -1
- package/lib/apis/tenants.d.ts.map +1 -1
- package/lib/apis/tenants.js +1 -1
- package/lib/apis/tenants.js.map +1 -1
- package/lib/apis/utils.d.ts.map +1 -1
- package/lib/apis/utils.js +3 -16
- package/lib/apis/utils.js.map +1 -1
- package/lib/apis/vehicles.js +1 -1
- package/lib/apis/vehicles.js.map +1 -1
- package/lib/constants.d.ts +9 -15
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +15 -20
- package/lib/constants.js.map +1 -1
- package/lib/types/crm.d.ts +5 -0
- package/lib/types/crm.d.ts.map +1 -1
- package/lib/types/crm.js.map +1 -1
- package/lib/types/documents.d.ts +7 -4
- package/lib/types/documents.d.ts.map +1 -1
- package/lib/types/fields.d.ts +0 -12
- package/lib/types/fields.d.ts.map +1 -1
- package/lib/types/fields.js.map +1 -1
- package/lib/types/leads.d.ts +1 -0
- package/lib/types/leads.d.ts.map +1 -1
- package/lib/types/leasing-administration.d.ts +2 -2
- package/lib/types/leasing-administration.d.ts.map +1 -1
- package/lib/types/leasing-settings.d.ts +73 -10
- package/lib/types/leasing-settings.d.ts.map +1 -1
- package/lib/types/leasing-settings.js +7 -0
- package/lib/types/leasing-settings.js.map +1 -1
- package/lib/types/leasing.d.ts +3 -4
- package/lib/types/leasing.d.ts.map +1 -1
- package/lib/types/leasing.js.map +1 -1
- package/lib/types/machines.d.ts +37 -0
- package/lib/types/machines.d.ts.map +1 -0
- package/lib/types/{conversations.js → machines.js} +1 -1
- package/lib/types/machines.js.map +1 -0
- package/lib/types/messages.d.ts +1 -1
- package/lib/types/messages.d.ts.map +1 -1
- package/lib/types/opportunities.d.ts +113 -34
- package/lib/types/opportunities.d.ts.map +1 -1
- package/lib/types/opportunities.js +28 -14
- package/lib/types/opportunities.js.map +1 -1
- package/lib/types/quotes.d.ts +157 -0
- package/lib/types/quotes.d.ts.map +1 -0
- package/lib/types/quotes.js +26 -0
- package/lib/types/quotes.js.map +1 -0
- package/lib/types/recently-viewed.d.ts +1 -2
- package/lib/types/recently-viewed.d.ts.map +1 -1
- package/lib/types/settings.d.ts +4 -0
- package/lib/types/settings.d.ts.map +1 -1
- package/lib/types/tenants.d.ts +8 -0
- package/lib/types/tenants.d.ts.map +1 -1
- package/lib/types/users.d.ts +1 -2
- package/lib/types/users.d.ts.map +1 -1
- package/lib/types/utils.d.ts +3 -2
- package/lib/types/utils.d.ts.map +1 -1
- package/lib/types/vehicles.d.ts +17 -2
- package/lib/types/vehicles.d.ts.map +1 -1
- package/package.json +3 -5
- package/src/apis/crm.ts +1 -1
- package/src/apis/documents.ts +1 -1
- package/src/apis/internet-vehicles.ts +1 -1
- package/src/apis/leasing-administration.ts +1 -1
- package/src/apis/leasing.ts +1 -1
- package/src/apis/picklists.ts +1 -1
- package/src/apis/tenants.ts +6 -9
- package/src/apis/utils.ts +3 -15
- package/src/apis/vehicles.ts +1 -1
- package/src/constants.ts +14 -19
- package/src/types/crm.ts +5 -0
- package/src/types/documents.ts +8 -4
- package/src/types/fields.ts +0 -14
- package/src/types/leads.ts +1 -0
- package/src/types/leasing-administration.ts +2 -2
- package/src/types/leasing-settings.ts +78 -11
- package/src/types/leasing.ts +3 -4
- package/src/types/machines.ts +39 -0
- package/src/types/messages.ts +1 -1
- package/src/types/opportunities.ts +125 -34
- package/src/types/quotes.ts +166 -0
- package/src/types/recently-viewed.ts +1 -2
- package/src/types/settings.ts +5 -0
- package/src/types/tenants.ts +9 -0
- package/src/types/users.ts +5 -2
- package/src/types/utils.ts +3 -2
- package/src/types/vehicles.ts +20 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/apis/settings.d.ts +0 -2
- package/lib/apis/settings.d.ts.map +0 -1
- package/lib/apis/settings.js +0 -26
- package/lib/apis/settings.js.map +0 -1
- package/lib/types/conversations.d.ts +0 -33
- package/lib/types/conversations.d.ts.map +0 -1
- package/lib/types/conversations.js.map +0 -1
- package/src/apis/settings.ts +0 -27
- package/src/types/conversations.ts +0 -36
package/src/types/fields.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
-
|
|
3
1
|
export enum FieldTypes {
|
|
4
2
|
attachment = 'attachment',
|
|
5
3
|
checkbox = 'checkbox',
|
|
@@ -28,18 +26,6 @@ export enum DateGranularity {
|
|
|
28
26
|
yearMonthDayTime = 'yearMonthDayTime',
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
export type AttachmentValue = {
|
|
32
|
-
contentType: string;
|
|
33
|
-
fileName: string;
|
|
34
|
-
id: string;
|
|
35
|
-
previewSrc?: string;
|
|
36
|
-
size: number;
|
|
37
|
-
uploadedAt: string;
|
|
38
|
-
uploadedBy: string;
|
|
39
|
-
url: string;
|
|
40
|
-
descriptions?: string | MultiLangValue;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
29
|
//
|
|
44
30
|
// Field metas
|
|
45
31
|
//
|
package/src/types/leads.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { AttachmentValue } from '@bisondesk/commons-sdk/lib/types';
|
|
1
2
|
import { LeasingAdminUploadHandlers } from '../constants';
|
|
2
|
-
import { AttachmentValue } from './fields';
|
|
3
3
|
|
|
4
4
|
export type LeasingAdminUploadStatus = 'success' | 'processing' | 'error';
|
|
5
5
|
|
|
@@ -61,7 +61,7 @@ export type DhondtInvoiceLine = {
|
|
|
61
61
|
NettoPremie: number;
|
|
62
62
|
Plaatnummer: string;
|
|
63
63
|
Taksen: number;
|
|
64
|
-
VoertuigVlootNummer: string;
|
|
64
|
+
VoertuigVlootNummer: string | undefined;
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
export type INGMetadata = {
|
|
@@ -1,16 +1,48 @@
|
|
|
1
1
|
import { Categories } from '../constants';
|
|
2
2
|
|
|
3
|
-
export type LeasingQuoteParams = { id: string; name: string } & {
|
|
4
|
-
allRisks: string;
|
|
5
|
-
allRisksTax: string;
|
|
6
|
-
oneTimeRoadTax: string;
|
|
7
|
-
specialTechnicalInsurance: string;
|
|
8
|
-
yearlyRoadTax: string;
|
|
9
|
-
civilLiabilities: string;
|
|
3
|
+
export type LeasingQuoteParams = { id: string; name: string; modifiedAt: string } & {
|
|
10
4
|
countryCode: 'be';
|
|
5
|
+
insurance: {
|
|
6
|
+
allRisksCost: string;
|
|
7
|
+
allRisksTax: string;
|
|
8
|
+
allRisksFees: string;
|
|
9
|
+
allRisksMinimumCost: string;
|
|
10
|
+
specialTechnicalInsuranceCost: string;
|
|
11
|
+
specialTechnicalInsuranceTax: string;
|
|
12
|
+
specialTechnicalInsuranceFees: string;
|
|
13
|
+
civilLiabilitiesCost: string;
|
|
14
|
+
civilLiabilitiesTax: string;
|
|
15
|
+
civilLiabilitiesFees: string;
|
|
16
|
+
roadAssistanceMonthlySalesPrice: string; // monthly Price
|
|
17
|
+
roadAssistanceMonthlyCostPrice: string; // monthly Price
|
|
18
|
+
margin: string;
|
|
19
|
+
};
|
|
20
|
+
leasing: {
|
|
21
|
+
leasingInterestRate: string;
|
|
22
|
+
leasingDuration: number;
|
|
23
|
+
leasingStartupFeePercentage: string;
|
|
24
|
+
leasingDepositPercentage: string;
|
|
25
|
+
leasingResidualValuePercentage: string;
|
|
26
|
+
};
|
|
27
|
+
taxes: {
|
|
28
|
+
oneTimeRoadTax: string;
|
|
29
|
+
yearlyRoadTax: string;
|
|
30
|
+
margin: string;
|
|
31
|
+
};
|
|
32
|
+
costs: {
|
|
33
|
+
bankDepositPercentage: string;
|
|
34
|
+
bankInterestRate: string;
|
|
35
|
+
bankResidualValuePercentage: string;
|
|
36
|
+
bankDuration: number;
|
|
37
|
+
trackAndTrace24Cost: string;
|
|
38
|
+
trackAndTrace36Cost: string;
|
|
39
|
+
trackAndTrace48Cost: string;
|
|
40
|
+
trackAndTraceMaxCost: string;
|
|
41
|
+
};
|
|
11
42
|
};
|
|
12
43
|
|
|
13
|
-
type
|
|
44
|
+
type BaseLeasingQuoteExtraSettings = {
|
|
45
|
+
referenceCode: string;
|
|
14
46
|
active: boolean;
|
|
15
47
|
costPrice: string;
|
|
16
48
|
countryCode: string;
|
|
@@ -19,13 +51,48 @@ type BaseLeasingQuoteExtra = {
|
|
|
19
51
|
hint?: string;
|
|
20
52
|
name: string;
|
|
21
53
|
salesPrice: string;
|
|
22
|
-
|
|
54
|
+
vehicleCategoryRestrictions?: Categories[];
|
|
23
55
|
};
|
|
24
56
|
|
|
25
|
-
|
|
57
|
+
type BaseLeasingQuoteExtraInput = {
|
|
58
|
+
agreedPrice: string;
|
|
59
|
+
clientPercentage: LeasingItemsPaymentSplit;
|
|
60
|
+
costPrice: string;
|
|
61
|
+
hint?: string;
|
|
62
|
+
leasingPercentage: string;
|
|
63
|
+
name: string;
|
|
64
|
+
referenceCode: string;
|
|
65
|
+
quantity: number;
|
|
66
|
+
id: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type NewLeasingQuoteExtraSettings = BaseLeasingQuoteExtraSettings & {
|
|
26
70
|
id: undefined;
|
|
27
71
|
};
|
|
28
72
|
|
|
29
|
-
export type
|
|
73
|
+
export type LeasingQuoteExtraSettings = BaseLeasingQuoteExtraSettings & {
|
|
30
74
|
id: string;
|
|
31
75
|
};
|
|
76
|
+
|
|
77
|
+
export enum LeasingItemsPaymentSplit {
|
|
78
|
+
Customer = 'customer',
|
|
79
|
+
Split = 'split',
|
|
80
|
+
Company = 'company',
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type CustomLeasingQuoteExtraInput = BaseLeasingQuoteExtraInput & {};
|
|
84
|
+
|
|
85
|
+
export type LeasingQuoteExtraInput = BaseLeasingQuoteExtraInput & {
|
|
86
|
+
salesPrice: string;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export type LeasingQuoteExtrasRequest = {
|
|
90
|
+
deliveryPackage?: boolean;
|
|
91
|
+
displayByDefault?: boolean;
|
|
92
|
+
vehicleCategory?: Categories;
|
|
93
|
+
country: string;
|
|
94
|
+
name?: string;
|
|
95
|
+
active?: boolean;
|
|
96
|
+
offset?: number;
|
|
97
|
+
limit?: number;
|
|
98
|
+
};
|
package/src/types/leasing.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LinkValue, PaginatedList } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
-
import { AttachmentValue } from './fields';
|
|
1
|
+
import { AttachmentValue, LinkValue, PaginatedList } from '@bisondesk/commons-sdk/lib/types';
|
|
3
2
|
import { EmailMessage } from './messages';
|
|
4
3
|
import { SortFilter } from './search';
|
|
5
4
|
import { ReferenceData } from './utils';
|
|
@@ -200,8 +199,8 @@ export type AmortizationRow = {
|
|
|
200
199
|
};
|
|
201
200
|
|
|
202
201
|
export type AmortizationTable = {
|
|
203
|
-
annualInterestRate
|
|
204
|
-
monthlyInterestRate
|
|
202
|
+
annualInterestRate?: string;
|
|
203
|
+
monthlyInterestRate?: string;
|
|
205
204
|
rows: AmortizationRow[];
|
|
206
205
|
};
|
|
207
206
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type Machine = {
|
|
2
|
+
axlesConfiguration?: string;
|
|
3
|
+
bodywork?: string;
|
|
4
|
+
category: string;
|
|
5
|
+
vin?: string;
|
|
6
|
+
cocPvg?: string;
|
|
7
|
+
emptyWeightKg?: number;
|
|
8
|
+
euronorm?: string;
|
|
9
|
+
firstRegistration?: string;
|
|
10
|
+
gearbox?: string;
|
|
11
|
+
kilometers?: number;
|
|
12
|
+
make?: string;
|
|
13
|
+
makeModel?: string;
|
|
14
|
+
makeModelType?: string;
|
|
15
|
+
powerHp?: number;
|
|
16
|
+
productionYear?: number;
|
|
17
|
+
suspension?: string;
|
|
18
|
+
totalWeightKg?: number;
|
|
19
|
+
wheelbaseCm?: number;
|
|
20
|
+
|
|
21
|
+
references: MachineReference[];
|
|
22
|
+
id: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type MachineReference = {
|
|
26
|
+
administrativeNumber?: string;
|
|
27
|
+
metaId: string;
|
|
28
|
+
stockNumber: string;
|
|
29
|
+
tenantId: string;
|
|
30
|
+
vehicleId: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type MachineEvent = {
|
|
34
|
+
machine: Machine;
|
|
35
|
+
action: 'upsert' | 'delete';
|
|
36
|
+
actionAt: string;
|
|
37
|
+
tenantId: string;
|
|
38
|
+
namespace: string;
|
|
39
|
+
};
|
package/src/types/messages.ts
CHANGED
|
@@ -1,65 +1,69 @@
|
|
|
1
|
+
import { AttachmentValue } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
+
import { OpportunityType } from '../constants';
|
|
3
|
+
import { Contact, Organization } from './crm';
|
|
1
4
|
import { Interest } from './leads';
|
|
5
|
+
import { LeasingQuote, QuoteStatus } from './quotes';
|
|
6
|
+
import { DataRecord } from './utils';
|
|
2
7
|
import { Vehicle } from './vehicles';
|
|
3
8
|
|
|
4
|
-
enum
|
|
9
|
+
export enum OpportunityActions {
|
|
10
|
+
CLOSED_LOST = 'closed_lost',
|
|
11
|
+
CLOSES_WON = 'closed_won',
|
|
12
|
+
OPEN = 'open',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum OpportunityDealStatus {
|
|
5
16
|
SALES_AGREED = 'sales_agreed',
|
|
6
17
|
FIRST_PAYMENT = 'first_payment',
|
|
7
18
|
FULL_PAYMENT = 'full_payment',
|
|
8
19
|
}
|
|
9
20
|
|
|
10
|
-
enum OpportunityStatus {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
export enum OpportunityStatus {
|
|
22
|
+
PROSPECTION = 'prospection',
|
|
23
|
+
VEHICLE_DISCOVERY = 'vehicle_discovery',
|
|
24
|
+
QUOTE_EVALUATION = 'quote_evaluation',
|
|
25
|
+
VEHICLE_LOCKED = 'vehicle_locked',
|
|
26
|
+
QUOTE_ACCEPTED = 'quote_accepted',
|
|
27
|
+
CLOSED_WON = 'closed_won',
|
|
28
|
+
CLOSED_LOST = 'closed_lost',
|
|
17
29
|
}
|
|
18
30
|
|
|
19
|
-
enum OpportunityLogisticStatus {
|
|
31
|
+
export enum OpportunityLogisticStatus {
|
|
20
32
|
AT_ORIGIN = 'at_origin',
|
|
21
33
|
DELIVERED = 'delivered',
|
|
22
34
|
}
|
|
23
35
|
|
|
24
|
-
enum
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
export enum OpportunityLostReasonValues {
|
|
37
|
+
NOT_INTERESTED = 'not_interested',
|
|
38
|
+
NOT_ENOUGH_INFO = 'not_enough_info',
|
|
39
|
+
NO_RESPONSE = 'no_response',
|
|
40
|
+
QUOTE_REJECTED = 'quote_rejected',
|
|
27
41
|
}
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
id: string;
|
|
43
|
+
type BaseBid = {
|
|
31
44
|
vehicleId: string;
|
|
32
|
-
opportunityId
|
|
45
|
+
opportunityId?: string;
|
|
33
46
|
contactId: string;
|
|
34
47
|
amount: string;
|
|
35
|
-
createdAt: string;
|
|
36
|
-
createdBy: string;
|
|
37
48
|
};
|
|
38
49
|
|
|
39
|
-
export type
|
|
50
|
+
export type NewBid = BaseBid & {};
|
|
51
|
+
|
|
52
|
+
export type Bid = BaseBid & {
|
|
40
53
|
id: string;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
createdBy: string;
|
|
41
56
|
};
|
|
42
57
|
|
|
43
58
|
type BaseOpportunity = {
|
|
44
|
-
accountManager
|
|
45
|
-
|
|
59
|
+
accountManager: string;
|
|
60
|
+
type: OpportunityType;
|
|
46
61
|
organizationId?: string;
|
|
47
|
-
/** will not be filled if organizationId is present */
|
|
48
|
-
orgName?: string;
|
|
49
62
|
contactId?: string;
|
|
50
|
-
/** will not be filled if contactId is present */
|
|
51
|
-
contactName?: string;
|
|
52
63
|
vehicleId?: string;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
logisticStatus: OpportunityLogisticStatus;
|
|
57
|
-
type: OpportunityType;
|
|
58
|
-
contractId?: string;
|
|
59
|
-
quotes?: Quote[];
|
|
60
|
-
amount: string;
|
|
61
|
-
status: OpportunityStatus;
|
|
62
|
-
interest: Interest;
|
|
64
|
+
source: string; // e.g. manual, website, autoscout, mobile...
|
|
65
|
+
branch: string;
|
|
66
|
+
branchCountry: 'be'; //eventually this variable should read the country of the branch
|
|
63
67
|
};
|
|
64
68
|
|
|
65
69
|
export type NewOpportunity = BaseOpportunity & {
|
|
@@ -70,10 +74,97 @@ export type NewOpportunity = BaseOpportunity & {
|
|
|
70
74
|
modifiedBy?: undefined;
|
|
71
75
|
};
|
|
72
76
|
|
|
77
|
+
export type OpportunityDocument = {
|
|
78
|
+
type: string; // passport, driving_license, ...
|
|
79
|
+
displayName: string;
|
|
80
|
+
file: AttachmentValue;
|
|
81
|
+
};
|
|
82
|
+
|
|
73
83
|
export type Opportunity = BaseOpportunity & {
|
|
74
84
|
id: string;
|
|
75
85
|
createdAt: string;
|
|
76
86
|
createdBy: string;
|
|
77
87
|
modifiedAt: string;
|
|
78
88
|
modifiedBy: string;
|
|
89
|
+
lostAt?: string;
|
|
90
|
+
lostBy?: string;
|
|
91
|
+
lostReason?: OpportunityLostReasonValues;
|
|
92
|
+
deliveredAt?: string;
|
|
93
|
+
deliveredBy?: string;
|
|
94
|
+
status: OpportunityStatus;
|
|
95
|
+
dealStatus?: OpportunityDealStatus;
|
|
96
|
+
logisticStatus?: OpportunityLogisticStatus;
|
|
97
|
+
activeQuoteId?: string;
|
|
98
|
+
contractId?: string;
|
|
99
|
+
amount?: string;
|
|
100
|
+
interest?: Interest;
|
|
101
|
+
documents?: OpportunityDocument[];
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type OpportunityUpdate = {
|
|
105
|
+
vehicleId?: string | null;
|
|
106
|
+
accountManager?: string;
|
|
107
|
+
contactId?: string | null;
|
|
108
|
+
activeQuoteId?: string;
|
|
109
|
+
interest?: Interest | null;
|
|
110
|
+
lost?: boolean;
|
|
111
|
+
lostReason?: OpportunityLostReasonValues;
|
|
112
|
+
delivered?: boolean;
|
|
113
|
+
documents?: OpportunityDocument[];
|
|
114
|
+
branch?: string;
|
|
115
|
+
branchCountry?: 'be'; //eventually this variable should read the country of the branch
|
|
116
|
+
type?: OpportunityType;
|
|
117
|
+
open?: boolean;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export type OpportunityBFF = {
|
|
121
|
+
opportunity: DataRecord<Opportunity>;
|
|
122
|
+
vehicle?: DataRecord<Vehicle>;
|
|
123
|
+
bids: DataRecord<Bid>[];
|
|
124
|
+
quotes: DataRecord<LeasingQuote>[];
|
|
125
|
+
customer?: {
|
|
126
|
+
contact: DataRecord<Contact>;
|
|
127
|
+
org?: DataRecord<Organization>;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export type OpportunityEvent = {
|
|
132
|
+
opportunity: Opportunity;
|
|
133
|
+
action: 'create' | 'update' | 'delete';
|
|
134
|
+
actionAt: string;
|
|
135
|
+
userId: string;
|
|
136
|
+
tenantId: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export type QuoteEvent = {
|
|
140
|
+
quote: LeasingQuote;
|
|
141
|
+
opportunity: Opportunity;
|
|
142
|
+
action: 'create' | 'update' | 'delete';
|
|
143
|
+
actionAt: string;
|
|
144
|
+
userId: string;
|
|
145
|
+
tenantId: string;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/* Quote summary with information that should be common to different types of quotes */
|
|
149
|
+
export type QuoteInfo = {
|
|
150
|
+
status: QuoteStatus;
|
|
151
|
+
roi: string;
|
|
152
|
+
dealValue: string;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export type SearchOpportunity = {
|
|
156
|
+
contact?: Contact;
|
|
157
|
+
opportunity: Opportunity;
|
|
158
|
+
org?: Organization;
|
|
159
|
+
vehicle?: Vehicle;
|
|
160
|
+
quote?: QuoteInfo;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const QUOTE_CREATED_NOTIFICATION_ORIGIN = 'quote-created';
|
|
164
|
+
export const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validator-feedback';
|
|
165
|
+
export const QUOTE_CUSTOMER_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-customer-feedback';
|
|
166
|
+
export const OPPORTUNITY_CLOSED_NOTIFICATION_ORIGIN = 'opportunity-closed';
|
|
167
|
+
|
|
168
|
+
export type OpportunityNotificationData = {
|
|
169
|
+
quoteVersion?: number;
|
|
79
170
|
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { AttachmentValue } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
+
import { OpportunityType } from '../constants';
|
|
3
|
+
import { CustomLeasingQuoteExtraInput, LeasingQuoteExtraInput } from './leasing-settings';
|
|
4
|
+
|
|
5
|
+
export enum QuoteActions {
|
|
6
|
+
ACCEPTANCE = 'acceptance',
|
|
7
|
+
VALIDATE = 'validation',
|
|
8
|
+
DONWLOAD_PDF = 'download-pdf',
|
|
9
|
+
CANCEL = 'cancel',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum QuoteStatus {
|
|
13
|
+
CREATED = 'created',
|
|
14
|
+
VALIDATED = 'validated',
|
|
15
|
+
INVALIDATED = 'invalidated',
|
|
16
|
+
ACCEPTED = 'accepted',
|
|
17
|
+
REJECTED = 'rejected',
|
|
18
|
+
CANCELLED = 'cancelled',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum LeasingQuoteMetricsScore {
|
|
22
|
+
DANGER = 'danger',
|
|
23
|
+
NEUTRAL = 'neutral',
|
|
24
|
+
GOOD = 'good',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type BaseLeasingCalculatorInput = {
|
|
28
|
+
branch: string;
|
|
29
|
+
branchCountry: 'be'; //eventually this variable should read the country of the branch
|
|
30
|
+
vehicleCategory: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type LeasingCalculatorDefaultInput = BaseLeasingCalculatorInput & {
|
|
34
|
+
salesPrice: string;
|
|
35
|
+
purchasePrice: string;
|
|
36
|
+
deliveryPackage?: LeasingQuoteExtraInput;
|
|
37
|
+
extras?: LeasingQuoteExtraInput[];
|
|
38
|
+
customRequests?: CustomLeasingQuoteExtraInput[];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type LeasingCalculatorInput = BaseLeasingCalculatorInput & {
|
|
42
|
+
localLicensePlate: boolean;
|
|
43
|
+
vanCourier: boolean;
|
|
44
|
+
leasing: {
|
|
45
|
+
salesPrice: string;
|
|
46
|
+
deposit: string;
|
|
47
|
+
depositPercentage: string;
|
|
48
|
+
residual: string;
|
|
49
|
+
residualPercentage: string;
|
|
50
|
+
startupFee: string;
|
|
51
|
+
startupFeePercentage: string;
|
|
52
|
+
interestRate: string;
|
|
53
|
+
purchasePrice: string;
|
|
54
|
+
duration: number;
|
|
55
|
+
};
|
|
56
|
+
bank: {
|
|
57
|
+
interestRate: string;
|
|
58
|
+
deposit: string;
|
|
59
|
+
depositPercentage: string;
|
|
60
|
+
residual: string;
|
|
61
|
+
residualPercentage: string;
|
|
62
|
+
duration: number;
|
|
63
|
+
salesPrice: string;
|
|
64
|
+
};
|
|
65
|
+
taxes: {
|
|
66
|
+
yearlyRoadTax: boolean;
|
|
67
|
+
oneTimeRoadTax: boolean;
|
|
68
|
+
margin: string; //Non Editable, copies the value insurance > margin
|
|
69
|
+
};
|
|
70
|
+
insurance: {
|
|
71
|
+
margin: string;
|
|
72
|
+
civilLiabilities: boolean;
|
|
73
|
+
allRisks: boolean;
|
|
74
|
+
specialTechnicalInsurance: boolean;
|
|
75
|
+
roadAssistance: boolean;
|
|
76
|
+
};
|
|
77
|
+
deliveryPackage?: LeasingQuoteExtraInput;
|
|
78
|
+
extras: LeasingQuoteExtraInput[];
|
|
79
|
+
customRequests: CustomLeasingQuoteExtraInput[];
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type LeasingCalculatorOutput = {
|
|
83
|
+
installment: string;
|
|
84
|
+
totalMonthlyAmount: string;
|
|
85
|
+
beforeDelivery: string;
|
|
86
|
+
financingAmount: string;
|
|
87
|
+
settingId: string;
|
|
88
|
+
totalRetailAmount: string;
|
|
89
|
+
roi: {
|
|
90
|
+
value: string;
|
|
91
|
+
target: string;
|
|
92
|
+
perYear: string;
|
|
93
|
+
difference: string;
|
|
94
|
+
score: LeasingQuoteMetricsScore;
|
|
95
|
+
};
|
|
96
|
+
cashflow: {
|
|
97
|
+
deficit: string;
|
|
98
|
+
balanced: boolean;
|
|
99
|
+
score: LeasingQuoteMetricsScore;
|
|
100
|
+
};
|
|
101
|
+
profitability: {
|
|
102
|
+
leasing: string;
|
|
103
|
+
vehicle: string;
|
|
104
|
+
total: string;
|
|
105
|
+
score: LeasingQuoteMetricsScore;
|
|
106
|
+
};
|
|
107
|
+
taxes: {
|
|
108
|
+
yearlyRetailPrice: string;
|
|
109
|
+
monthlyRetailPrice: string;
|
|
110
|
+
yearlyRoadTax: string;
|
|
111
|
+
oneTimeRoadTax: string;
|
|
112
|
+
};
|
|
113
|
+
insurance: {
|
|
114
|
+
yearlyRetailPrice: string;
|
|
115
|
+
monthlyRetailPrice: string;
|
|
116
|
+
civilLiabilities: string;
|
|
117
|
+
allRisks: string;
|
|
118
|
+
specialTechnicalInsurance: string;
|
|
119
|
+
roadAssistance: string;
|
|
120
|
+
};
|
|
121
|
+
costs: {
|
|
122
|
+
financingAmount: string;
|
|
123
|
+
monhtly: string;
|
|
124
|
+
trackAndTrace: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type BaseLeasingQuote = {
|
|
129
|
+
opportunityId: string;
|
|
130
|
+
vehicleId: string;
|
|
131
|
+
organizationId: string;
|
|
132
|
+
calculatorInput: LeasingCalculatorInput;
|
|
133
|
+
calculatorOutput: LeasingCalculatorOutput;
|
|
134
|
+
type: OpportunityType;
|
|
135
|
+
preferredLanguage: string;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export type NewLeasingQuote = BaseLeasingQuote & {
|
|
139
|
+
id?: undefined;
|
|
140
|
+
createdAt?: undefined;
|
|
141
|
+
createdBy?: undefined;
|
|
142
|
+
modifiedAt?: undefined;
|
|
143
|
+
modifiedBy?: undefined;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export type LeasingQuote = BaseLeasingQuote & {
|
|
147
|
+
id: string;
|
|
148
|
+
createdAt: string;
|
|
149
|
+
createdBy: string;
|
|
150
|
+
modifiedAt: string;
|
|
151
|
+
modifiedBy: string;
|
|
152
|
+
validationBy?: string;
|
|
153
|
+
validationAt?: string;
|
|
154
|
+
cancelledBy?: string;
|
|
155
|
+
cancelledAt?: string;
|
|
156
|
+
customerFeedbackAt?: string;
|
|
157
|
+
customerFeedbackBy?: string;
|
|
158
|
+
version: number;
|
|
159
|
+
status: QuoteStatus;
|
|
160
|
+
proformaPdf?: AttachmentValue;
|
|
161
|
+
quotePdf?: AttachmentValue;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export type QuoteStatusUpdate = {
|
|
165
|
+
status: QuoteStatus;
|
|
166
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Requester } from '@bisondesk/commons-sdk/lib/types';
|
|
1
|
+
import { AttachmentValue, Requester } from '@bisondesk/commons-sdk/lib/types';
|
|
2
2
|
import { BusinessEntityIds } from '../constants';
|
|
3
|
-
import { AttachmentValue } from './fields';
|
|
4
3
|
|
|
5
4
|
export type ViewedItemsRequest = {
|
|
6
5
|
businessEntity?: string;
|
package/src/types/settings.ts
CHANGED
package/src/types/tenants.ts
CHANGED
|
@@ -19,6 +19,15 @@ export type Tenant = PublicTenant & {
|
|
|
19
19
|
hyperdmsIds?: string[];
|
|
20
20
|
hyperportalId?: string;
|
|
21
21
|
exactAccounting?: boolean;
|
|
22
|
+
branches: Branch[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type Branch = {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
country: string;
|
|
29
|
+
exactAccounting?: boolean;
|
|
30
|
+
currency: string;
|
|
22
31
|
};
|
|
23
32
|
|
|
24
33
|
export type HdmsVehiclesSync = {
|
package/src/types/users.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AppRoles } from '@bisondesk/commons-sdk/lib/constants';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
AttachmentValue,
|
|
4
|
+
PhoneNumberRawValue,
|
|
5
|
+
PhoneNumberValue,
|
|
6
|
+
} from '@bisondesk/commons-sdk/lib/types';
|
|
4
7
|
|
|
5
8
|
export type NewUserRequest = {
|
|
6
9
|
email: string;
|
package/src/types/utils.ts
CHANGED