@bisondesk/core-sdk 1.0.485 → 1.0.487

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 (39) hide show
  1. package/lib/constants.d.ts +1 -3
  2. package/lib/constants.d.ts.map +1 -1
  3. package/lib/constants.js +1 -3
  4. package/lib/constants.js.map +1 -1
  5. package/lib/types/crm.d.ts +3 -0
  6. package/lib/types/crm.d.ts.map +1 -1
  7. package/lib/types/crm.js.map +1 -1
  8. package/lib/types/journeys.d.ts +26 -0
  9. package/lib/types/journeys.d.ts.map +1 -0
  10. package/lib/types/journeys.js +2 -0
  11. package/lib/types/journeys.js.map +1 -0
  12. package/lib/types/leasing-administration.d.ts +0 -17
  13. package/lib/types/leasing-administration.d.ts.map +1 -1
  14. package/lib/types/leasing-administration.js.map +1 -1
  15. package/lib/types/offers.d.ts +0 -1
  16. package/lib/types/offers.d.ts.map +1 -1
  17. package/lib/types/offers.js.map +1 -1
  18. package/lib/types/opportunities.d.ts +2 -0
  19. package/lib/types/opportunities.d.ts.map +1 -1
  20. package/lib/types/opportunities.js.map +1 -1
  21. package/lib/types/quotes.d.ts +1 -0
  22. package/lib/types/quotes.d.ts.map +1 -1
  23. package/lib/types/quotes.js.map +1 -1
  24. package/lib/types/vehicles.d.ts +16 -0
  25. package/lib/types/vehicles.d.ts.map +1 -1
  26. package/lib/types/vehicles.js.map +1 -1
  27. package/lib/utils/integrations/vehicles.js +1 -1
  28. package/lib/utils/integrations/vehicles.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/constants.ts +1 -3
  31. package/src/types/crm.ts +4 -0
  32. package/src/types/journeys.ts +28 -0
  33. package/src/types/leasing-administration.ts +0 -21
  34. package/src/types/offers.ts +0 -1
  35. package/src/types/opportunities.ts +3 -1
  36. package/src/types/quotes.ts +1 -0
  37. package/src/types/vehicles.ts +17 -0
  38. package/src/utils/integrations/vehicles.ts +1 -1
  39. 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/crm.ts CHANGED
@@ -224,6 +224,10 @@ type BaseContact = {
224
224
  orgName?: string;
225
225
  marketingPreferences?: MarketingPreferences;
226
226
  clientLevel?: PartnerLevel;
227
+
228
+ disabledAt?: string;
229
+ disabledBy?: string;
230
+ disabledReason?: string;
227
231
  };
228
232
 
229
233
  export type NewContact = BaseContact & {
@@ -0,0 +1,28 @@
1
+ import { TaskPriority } from '@bisondesk/commons-sdk/tasks';
2
+ import { MultiLangValue } from '@bisondesk/commons-sdk/types';
3
+ import type { AdditionalOperation, RulesLogic } from 'json-logic-js';
4
+ import { BusinessEntityIds } from '../constants.js';
5
+
6
+ export type JourneyTaskDependency = RulesLogic<AdditionalOperation>;
7
+
8
+ export type JourneyTaskConfig<T> = {
9
+ configId: string;
10
+ title: MultiLangValue;
11
+ entryCriteria?: JourneyTaskDependency;
12
+ priority?: TaskPriority;
13
+ tag?: string;
14
+ description?: MultiLangValue;
15
+ completionCriteria: RulesLogic<AdditionalOperation>;
16
+ prerequisiteTaskIds: string[];
17
+ requiredAtStatus?: T; //Required at a given status or higher
18
+ disabled: boolean;
19
+ };
20
+
21
+ export type JourneyConfig<T> = {
22
+ businessEntityId: BusinessEntityIds;
23
+ versionId: string;
24
+ tasks: JourneyTaskConfig<T>[];
25
+ createdAt: string;
26
+ createdBy: string;
27
+ disabled: boolean;
28
+ };
@@ -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;
@@ -133,7 +133,6 @@ export type OfferUpdate = {
133
133
  branchId?: string | null;
134
134
  supplierNotes?: string | null;
135
135
  contactId?: string | null;
136
- organizationId?: string | null;
137
136
  lost?: boolean;
138
137
  lostReason?: OfferLostReasonValues;
139
138
  source?: string;
@@ -1,3 +1,4 @@
1
+ import { Task } from '@bisondesk/commons-sdk/tasks';
1
2
  import { Document, NextList } from '@bisondesk/commons-sdk/types';
2
3
  import { BusinessEntityIds, OpportunityType, WarningHints } from '../constants.js';
3
4
  import { Contact, Organization } from './crm.js';
@@ -105,7 +106,7 @@ export enum OpportunityLostReasonValues {
105
106
  HighDeposit = 'deposit_too_high',
106
107
  NoAnswer = 'client_not_answered',
107
108
  Automatic = 'automatic',
108
- LeasingDeal = 'sold-via-leasing'
109
+ LeasingDeal = 'sold-via-leasing',
109
110
  }
110
111
 
111
112
  type BaseBid = {
@@ -261,6 +262,7 @@ export type OpportunityBFF = {
261
262
  activeQuote?: DataRecord<Quote>;
262
263
  payments: PaymentSummary | undefined;
263
264
  reservation?: DataRecord<OpportunityReservation>;
265
+ tasks: DataRecord<Task>[];
264
266
  customer?: {
265
267
  contact: DataRecord<Contact, ContactMetdata>;
266
268
  org?: DataRecord<Organization>;
@@ -75,6 +75,7 @@ export type LeasingCalculatorDefaultInput = BaseQuoteCalculatorInput & {
75
75
  export type LeasingCalculatorInput = BaseQuoteCalculatorInput & {
76
76
  localLicensePlate: boolean;
77
77
  vanCourier: boolean;
78
+ externalDelivery: boolean;
78
79
  isRefinancingDebt?: boolean; // if true, the insurance amounts might not be the same as the leasing amount + and other costs like track and trace
79
80
  vehicle: BaseQuoteCalculatorInput['vehicle'] & {
80
81
  purchasePriceExclVat: string;
@@ -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) {