@bisondesk/core-sdk 1.0.484 → 1.0.486
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/vehicles.d.ts +2 -1
- package/lib/apis/vehicles.d.ts.map +1 -1
- package/lib/apis/vehicles.js +9 -0
- package/lib/apis/vehicles.js.map +1 -1
- package/lib/constants.d.ts +1 -3
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +1 -3
- package/lib/constants.js.map +1 -1
- package/lib/types/activities.d.ts +24 -0
- package/lib/types/activities.d.ts.map +1 -1
- package/lib/types/activities.js.map +1 -1
- package/lib/types/crm.d.ts +8 -1
- package/lib/types/crm.d.ts.map +1 -1
- package/lib/types/crm.js +1 -1
- package/lib/types/crm.js.map +1 -1
- package/lib/types/interests.d.ts +6 -0
- package/lib/types/interests.d.ts.map +1 -1
- package/lib/types/interests.js.map +1 -1
- package/lib/types/internal-events.d.ts +3 -1
- package/lib/types/internal-events.d.ts.map +1 -1
- package/lib/types/internal-events.js +2 -0
- package/lib/types/internal-events.js.map +1 -1
- package/lib/types/leasing-administration.d.ts +0 -17
- package/lib/types/leasing-administration.d.ts.map +1 -1
- package/lib/types/leasing-administration.js.map +1 -1
- package/lib/types/offers.d.ts +0 -1
- package/lib/types/offers.d.ts.map +1 -1
- package/lib/types/offers.js.map +1 -1
- package/lib/types/vehicle-sales.d.ts +22 -0
- package/lib/types/vehicle-sales.d.ts.map +1 -1
- package/lib/types/vehicle-sales.js.map +1 -1
- package/lib/types/vehicles.d.ts +16 -0
- package/lib/types/vehicles.d.ts.map +1 -1
- package/lib/types/vehicles.js.map +1 -1
- package/lib/utils/integrations/vehicles.js +1 -1
- package/lib/utils/integrations/vehicles.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/vehicles.ts +14 -1
- package/src/constants.ts +1 -3
- package/src/types/activities.ts +30 -0
- package/src/types/crm.ts +10 -1
- package/src/types/interests.ts +8 -0
- package/src/types/internal-events.ts +2 -0
- package/src/types/leasing-administration.ts +0 -21
- package/src/types/offers.ts +0 -1
- package/src/types/vehicle-sales.ts +32 -0
- package/src/types/vehicles.ts +17 -0
- package/src/utils/integrations/vehicles.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/src/constants.ts
CHANGED
|
@@ -108,8 +108,6 @@ export const KM_ROUNDING = 100_000;
|
|
|
108
108
|
// Leasing administration
|
|
109
109
|
//
|
|
110
110
|
export enum LeasingAdminUploadHandlers {
|
|
111
|
-
DhondtMonthly = 'dhondt-monthly-invoice',
|
|
112
|
-
DhondtProrata = 'dhondt-prorata-invoice',
|
|
113
111
|
Belfius = 'belfius-monthly-invoice',
|
|
114
112
|
ING = 'ing-monthly-invoice',
|
|
115
113
|
DLL = 'dll-monthly-invoice',
|
|
@@ -117,7 +115,6 @@ export enum LeasingAdminUploadHandlers {
|
|
|
117
115
|
}
|
|
118
116
|
|
|
119
117
|
export enum LeasingAdminEntities {
|
|
120
|
-
Dhondt = 'dhondt',
|
|
121
118
|
Becris = 'becris',
|
|
122
119
|
ING = 'ing',
|
|
123
120
|
}
|
|
@@ -989,6 +986,7 @@ export const DEBTORS_MONTHS_UNTIL_TODAY_COUNT = 6;
|
|
|
989
986
|
|
|
990
987
|
// Email Template IDs
|
|
991
988
|
export const VEHICLE_SHARE_TEMPLATE_ID = 'vehicle-share';
|
|
989
|
+
export const OFFER_SHARE_TEMPLATE_ID = VEHICLE_SHARE_TEMPLATE_ID;
|
|
992
990
|
export const SIGNATURE_EMAIL_TEMPLATE_ID = 'signature-email';
|
|
993
991
|
export const DOCUMENT_SHARE_TEMPLATE_ID = 'document-share';
|
|
994
992
|
export const DOCUMENT_DRAFT_SHARE_TEMPLATE_ID = 'document-draft-share';
|
package/src/types/activities.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BusinessEntityIds } from '../constants.js';
|
|
2
|
+
import { BaseEvent } from './internal-events.js';
|
|
2
3
|
|
|
3
4
|
export enum ActivityType {
|
|
4
5
|
CALL = 'call',
|
|
@@ -43,3 +44,32 @@ export type ActivityUpdate = {
|
|
|
43
44
|
type?: ActivityType;
|
|
44
45
|
activityAt?: string;
|
|
45
46
|
};
|
|
47
|
+
|
|
48
|
+
export type ActivityEvent = BaseEvent &
|
|
49
|
+
(ActivityCreateEvent | ActivityUpdateEvent | ActivityDeleteEvent);
|
|
50
|
+
|
|
51
|
+
type BaseActivityEvent = {
|
|
52
|
+
actionAt: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
tenantId: string;
|
|
55
|
+
businessEntityId: BusinessEntityIds;
|
|
56
|
+
recordId: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type ActivityCreateEvent = BaseActivityEvent & {
|
|
60
|
+
action: 'create';
|
|
61
|
+
data: Activity;
|
|
62
|
+
previousData?: undefined;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type ActivityUpdateEvent = BaseActivityEvent & {
|
|
66
|
+
action: 'update';
|
|
67
|
+
data: Activity;
|
|
68
|
+
previousData: Activity;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type ActivityDeleteEvent = BaseActivityEvent & {
|
|
72
|
+
action: 'delete';
|
|
73
|
+
data: undefined;
|
|
74
|
+
previousData: Activity;
|
|
75
|
+
};
|
package/src/types/crm.ts
CHANGED
|
@@ -164,6 +164,8 @@ export type SearchOrganization = {
|
|
|
164
164
|
lastActivityAt: string | undefined; // last activity at this organization
|
|
165
165
|
lastActivityBy: string | undefined; // user that did the last activity at this organization
|
|
166
166
|
engagementTypes: OrgEngagementType[] | undefined; // types of engagements this organization has in the tenant
|
|
167
|
+
|
|
168
|
+
accountManagers: string[]; // dynamically determined account managers for this organization
|
|
167
169
|
};
|
|
168
170
|
};
|
|
169
171
|
|
|
@@ -176,6 +178,9 @@ export type InputSearchOrganization = SearchOrganization & {
|
|
|
176
178
|
export type SearchContact = {
|
|
177
179
|
contact: Contact;
|
|
178
180
|
org?: Organization;
|
|
181
|
+
custom: {
|
|
182
|
+
accountManagers: string[]; // dynamically determined account managers for this contact
|
|
183
|
+
};
|
|
179
184
|
};
|
|
180
185
|
|
|
181
186
|
export type InputSearchContact = SearchContact & {
|
|
@@ -224,6 +229,10 @@ type BaseContact = {
|
|
|
224
229
|
orgName?: string;
|
|
225
230
|
marketingPreferences?: MarketingPreferences;
|
|
226
231
|
clientLevel?: PartnerLevel;
|
|
232
|
+
|
|
233
|
+
disabledAt?: string;
|
|
234
|
+
disabledBy?: string;
|
|
235
|
+
disabledReason?: string;
|
|
227
236
|
};
|
|
228
237
|
|
|
229
238
|
export type NewContact = BaseContact & {
|
|
@@ -268,5 +277,5 @@ export enum OrgEngagementType {
|
|
|
268
277
|
offers = 'offers',
|
|
269
278
|
purchases = 'purchases',
|
|
270
279
|
opportunities = 'opportunities',
|
|
271
|
-
|
|
280
|
+
sales = 'sales',
|
|
272
281
|
}
|
package/src/types/interests.ts
CHANGED
|
@@ -23,6 +23,14 @@ export interface OpportunityInterest extends Interest {
|
|
|
23
23
|
organizationId?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export interface ContactInterest extends Interest {
|
|
27
|
+
contactId: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface OrganizationInterest extends Interest {
|
|
31
|
+
organizationId: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
export interface HdmsInterest extends Interest {
|
|
27
35
|
hdmsSaleId: string;
|
|
28
36
|
}
|
|
@@ -9,6 +9,8 @@ export enum EventTypes {
|
|
|
9
9
|
PURCHASE_PAYMENT = 'vehicle-purchase-payments',
|
|
10
10
|
OFFER = 'offers',
|
|
11
11
|
PRICE_CHANGE = 'price-changes',
|
|
12
|
+
ACTIVITY = 'activities',
|
|
13
|
+
EXTERNAL_VEHICLE_SALE = 'external-vehicle-sales',
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export enum InternalNotificationChannels {
|
|
@@ -35,10 +35,6 @@ export type NewLeasingAdminUploadRequest<
|
|
|
35
35
|
handlerId: LeasingAdminUploadHandlers;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
export type DhondtAttachments = {
|
|
39
|
-
json: AttachmentValue;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
38
|
export type BelfiusAttachments = {
|
|
43
39
|
xlsx: AttachmentValue;
|
|
44
40
|
json?: AttachmentValue; // json version of the xlsx file
|
|
@@ -59,21 +55,6 @@ export type DLLMetadata = {
|
|
|
59
55
|
totalIncludingVat: string;
|
|
60
56
|
};
|
|
61
57
|
|
|
62
|
-
export type DhondtMetadata = {
|
|
63
|
-
invoiceNumber: string;
|
|
64
|
-
invoiceDate: string;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export type DhondtInvoiceLine = {
|
|
68
|
-
BrutoPremie: number;
|
|
69
|
-
Chassisnummer: string;
|
|
70
|
-
Datum: string;
|
|
71
|
-
NettoPremie: number;
|
|
72
|
-
Plaatnummer: string;
|
|
73
|
-
Taksen: number;
|
|
74
|
-
VoertuigVlootNummer: string | undefined;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
58
|
export type INGMetadata = {
|
|
78
59
|
capital: string;
|
|
79
60
|
emailId?: string;
|
|
@@ -102,8 +83,6 @@ export type EmailInvoiceAttachments = {
|
|
|
102
83
|
email?: AttachmentValue; // like the emailId, can be missing if the invoices are uploaded manually
|
|
103
84
|
};
|
|
104
85
|
|
|
105
|
-
export type DiffableDhondtInvoiceLine = DhondtInvoiceLine;
|
|
106
|
-
|
|
107
86
|
export type BelfiusRawInvoiceLine = {
|
|
108
87
|
'Additional info': string;
|
|
109
88
|
Amortization: number;
|
package/src/types/offers.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LocationValue } from '@bisondesk/commons-sdk/locations';
|
|
2
2
|
import { Organization } from './crm.js';
|
|
3
|
+
import { BaseEvent } from './internal-events.js';
|
|
3
4
|
import { Opportunity, VehicleSaleDealStatus, VehicleSaleLogisticsStatus } from './opportunities.js';
|
|
4
5
|
import { DeliveryTypes, Quote } from './quotes.js';
|
|
5
6
|
import { DataRecord } from './utils.js';
|
|
@@ -78,3 +79,34 @@ export type ExternalVehicleSale = BaseExternalVehicleSale & {
|
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
export type NewExternalVehicleSale = BaseExternalVehicleSale;
|
|
82
|
+
|
|
83
|
+
export type ExternalVehicleSaleEvent = BaseEvent &
|
|
84
|
+
(
|
|
85
|
+
| ExternalVehicleSaleCreateEvent
|
|
86
|
+
| ExternalVehicleSaleUpdateEvent
|
|
87
|
+
| ExternalVehicleSaleDeleteEvent
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
type BaseExternalVehicleSaleEvent = {
|
|
91
|
+
actionAt: string;
|
|
92
|
+
userId: string;
|
|
93
|
+
tenantId: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type ExternalVehicleSaleCreateEvent = BaseExternalVehicleSaleEvent & {
|
|
97
|
+
action: 'create';
|
|
98
|
+
data: ExternalVehicleSale;
|
|
99
|
+
previousData?: undefined;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type ExternalVehicleSaleUpdateEvent = BaseExternalVehicleSaleEvent & {
|
|
103
|
+
action: 'update';
|
|
104
|
+
data: ExternalVehicleSale;
|
|
105
|
+
previousData: ExternalVehicleSale;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type ExternalVehicleSaleDeleteEvent = BaseExternalVehicleSaleEvent & {
|
|
109
|
+
action: 'delete';
|
|
110
|
+
data: undefined;
|
|
111
|
+
previousData?: ExternalVehicleSale;
|
|
112
|
+
};
|
package/src/types/vehicles.ts
CHANGED
|
@@ -751,6 +751,23 @@ export type VehicleShareEmailRequest = ShareEmailRequest & {
|
|
|
751
751
|
pictures: AttachmentValue[];
|
|
752
752
|
};
|
|
753
753
|
|
|
754
|
+
export type VehicleShareData = {
|
|
755
|
+
title: string;
|
|
756
|
+
mainPicture?: string;
|
|
757
|
+
pictures: {
|
|
758
|
+
picture: string;
|
|
759
|
+
}[];
|
|
760
|
+
message: string;
|
|
761
|
+
specs: {
|
|
762
|
+
name: string;
|
|
763
|
+
value: string;
|
|
764
|
+
}[];
|
|
765
|
+
features: {
|
|
766
|
+
name: string;
|
|
767
|
+
}[];
|
|
768
|
+
stockNumber: string;
|
|
769
|
+
};
|
|
770
|
+
|
|
754
771
|
export type VehicleReservationCreateEvent = BaseVehicleEvent & {
|
|
755
772
|
action: 'create';
|
|
756
773
|
reservation: OpportunityReservation;
|
|
@@ -70,7 +70,7 @@ export const guessDrivingCabFromTitle = (
|
|
|
70
70
|
'short',
|
|
71
71
|
];
|
|
72
72
|
|
|
73
|
-
const keywordPattern = (k: string) => new RegExp(`[^a-zA-Z0-9]${k}([^a-zA-Z0-9]|$)`);
|
|
73
|
+
const keywordPattern = (k: string) => new RegExp(`(^|[^a-zA-Z0-9])${k}([^a-zA-Z0-9]|$)`);
|
|
74
74
|
|
|
75
75
|
const largeMatches = largeKeywords.some((keyword) => keywordPattern(keyword).test(title));
|
|
76
76
|
if (largeMatches) {
|