@bisondesk/core-sdk 1.0.304 → 1.0.306
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/leasing.js.map +1 -1
- package/lib/cjs/types/{leads.js → comparables.js} +1 -1
- package/lib/cjs/types/comparables.js.map +1 -0
- package/lib/cjs/types/insights.js.map +1 -1
- package/lib/cjs/types/interests.js +10 -0
- package/lib/cjs/types/interests.js.map +1 -0
- package/lib/cjs/types/opportunities.js.map +1 -1
- package/lib/cjs/types/quotes.js.map +1 -1
- package/lib/cjs/types/users.js.map +1 -1
- package/lib/cjs/types/vehicles.js.map +1 -1
- package/lib/esm/apis/leasing.js.map +1 -1
- package/lib/esm/types/comparables.js +2 -0
- package/lib/esm/types/comparables.js.map +1 -0
- package/lib/esm/types/insights.js.map +1 -1
- package/lib/esm/types/interests.js +6 -0
- package/lib/esm/types/interests.js.map +1 -0
- package/lib/esm/types/opportunities.js.map +1 -1
- package/lib/esm/types/quotes.js.map +1 -1
- package/lib/esm/types/users.js.map +1 -1
- package/lib/esm/types/vehicles.js.map +1 -1
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/apis/leasing.d.ts +2 -1
- package/lib/types/apis/leasing.d.ts.map +1 -1
- package/lib/types/types/comparables.d.ts +37 -0
- package/lib/types/types/comparables.d.ts.map +1 -0
- package/lib/types/types/insights.d.ts +15 -26
- package/lib/types/types/insights.d.ts.map +1 -1
- package/lib/types/types/interests.d.ts +72 -0
- package/lib/types/types/interests.d.ts.map +1 -0
- package/lib/types/types/opportunities.d.ts +20 -19
- package/lib/types/types/opportunities.d.ts.map +1 -1
- package/lib/types/types/quotes.d.ts +13 -17
- package/lib/types/types/quotes.d.ts.map +1 -1
- package/lib/types/types/users.d.ts +1 -0
- package/lib/types/types/users.d.ts.map +1 -1
- package/lib/types/types/vehicles.d.ts +1 -0
- package/lib/types/types/vehicles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/apis/leasing.ts +2 -1
- package/src/types/comparables.ts +40 -0
- package/src/types/insights.ts +18 -26
- package/src/types/interests.ts +87 -0
- package/src/types/opportunities.ts +27 -25
- package/src/types/quotes.ts +13 -17
- package/src/types/users.ts +1 -0
- package/src/types/vehicles.ts +1 -0
- package/lib/cjs/types/leads.js.map +0 -1
- package/lib/esm/types/leads.js +0 -2
- package/lib/esm/types/leads.js.map +0 -1
- package/lib/types/types/leads.d.ts +0 -134
- package/lib/types/types/leads.d.ts.map +0 -1
- package/src/types/leads.ts +0 -144
package/src/types/insights.ts
CHANGED
|
@@ -1,39 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComparableSpecs } from './comparables';
|
|
2
|
+
import { ReferenceData } from './utils';
|
|
3
|
+
|
|
4
|
+
export type SimilarVehiclesRequest = {
|
|
2
5
|
offset: number;
|
|
3
6
|
limit: number;
|
|
4
7
|
};
|
|
5
8
|
|
|
9
|
+
export type InsightsSimilarRequest = {
|
|
10
|
+
comparable: InsightsComparableSpecs;
|
|
11
|
+
limit: number;
|
|
12
|
+
nextToken?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
6
15
|
export type InsightsResponse = {
|
|
7
16
|
insights: Insights;
|
|
8
|
-
|
|
17
|
+
comparable: InsightsComparableSpecs;
|
|
9
18
|
};
|
|
10
19
|
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
limit: number;
|
|
20
|
+
export type InsightsVehicleComparableResponse = {
|
|
21
|
+
comparable: InsightsComparableSpecs;
|
|
22
|
+
meta: ReferenceData;
|
|
15
23
|
};
|
|
16
24
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
damaged?: boolean;
|
|
22
|
-
euronorms?: string[];
|
|
23
|
-
horsepowerMax?: number;
|
|
24
|
-
horsepowerMin?: number;
|
|
25
|
-
kilometersMax?: number;
|
|
26
|
-
kilometersMin?: number;
|
|
27
|
-
make?: string;
|
|
28
|
-
model?: string;
|
|
29
|
-
priceMax?: number;
|
|
30
|
-
priceMin?: number;
|
|
31
|
-
retarderIntarder?: boolean;
|
|
32
|
-
transmissions?: string[];
|
|
33
|
-
used?: boolean;
|
|
34
|
-
yearMax?: number;
|
|
35
|
-
yearMin?: number;
|
|
36
|
-
};
|
|
25
|
+
// here we are considering only specs that we can use to filter Market vehicles
|
|
26
|
+
export interface InsightsComparableSpecs extends ComparableSpecs {
|
|
27
|
+
vehicleId: string;
|
|
28
|
+
}
|
|
37
29
|
|
|
38
30
|
export type InsightsOptions = {
|
|
39
31
|
months?: number;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ComparableSpecs } from './comparables';
|
|
2
|
+
import { ReferenceData } from './utils';
|
|
3
|
+
|
|
4
|
+
export enum InterestActions {
|
|
5
|
+
SET_INTEREST = 'set_interest',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type InterestBffMeta = ReferenceData;
|
|
9
|
+
|
|
10
|
+
// here we are considering specs that we can use to filter Stock vehicles
|
|
11
|
+
// Interest is a simplified spec representation specific to a client/opportunity interest
|
|
12
|
+
export interface Interest
|
|
13
|
+
extends Omit<ComparableSpecs, 'horsepower' | 'kilometers' | 'price' | 'year'> {
|
|
14
|
+
age?: number; // year the interest was generated minus spec max year
|
|
15
|
+
price?: number; // in a spec this would be the max price
|
|
16
|
+
horsepower?: number; // in a spec this would be the min horsepower
|
|
17
|
+
kilometers?: number; // in a spec this would be the max kilometers
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface OpportunityInterest extends Interest {
|
|
21
|
+
opportunityId: string;
|
|
22
|
+
contactId: string;
|
|
23
|
+
organizationId?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface HdmsInterest extends Interest {
|
|
27
|
+
hdmsSaleId: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const isOpportunityInterest = (interest: Interest): interest is OpportunityInterest =>
|
|
31
|
+
'opportunityId' in interest;
|
|
32
|
+
|
|
33
|
+
export type LeadUpdate =
|
|
34
|
+
| {
|
|
35
|
+
dismissed: true;
|
|
36
|
+
}
|
|
37
|
+
| {
|
|
38
|
+
contacted: true;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type InterestLead = {
|
|
42
|
+
createdAt?: string;
|
|
43
|
+
|
|
44
|
+
contactId: string;
|
|
45
|
+
vehicleId: string;
|
|
46
|
+
interestId: string;
|
|
47
|
+
opportunityId?: string;
|
|
48
|
+
organizationId?: string;
|
|
49
|
+
|
|
50
|
+
score: number;
|
|
51
|
+
scoreDetails: { name: string; value: number }[];
|
|
52
|
+
|
|
53
|
+
accountManagers: string[];
|
|
54
|
+
|
|
55
|
+
vehicleData: {
|
|
56
|
+
title: string;
|
|
57
|
+
mainPictureUrl?: string;
|
|
58
|
+
stockNumber?: string;
|
|
59
|
+
|
|
60
|
+
advertisingYear?: number;
|
|
61
|
+
km?: number;
|
|
62
|
+
emissionsClass?: string;
|
|
63
|
+
configuration?: string;
|
|
64
|
+
suspension?: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
customerData: {
|
|
68
|
+
name: string;
|
|
69
|
+
countryCode: string;
|
|
70
|
+
|
|
71
|
+
lastInteractionAt?: string;
|
|
72
|
+
numPastSales?: number; // TODO
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
dismissedAt?: string;
|
|
76
|
+
contactedAt?: string;
|
|
77
|
+
updatedBy?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type InterestSearchRequest = { interest: Interest; limit: number; nextToken?: string };
|
|
81
|
+
|
|
82
|
+
export type VehicleInterestAutocompleteRequest = { vehicleId: string };
|
|
83
|
+
|
|
84
|
+
export type VehicleInterestResponse = {
|
|
85
|
+
interest: Interest;
|
|
86
|
+
meta: ReferenceData;
|
|
87
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Document, NextList } from '@bisondesk/commons-sdk/types';
|
|
2
2
|
import { BusinessEntityIds, OpportunityType, WarningHints } from '../constants';
|
|
3
3
|
import { Contact, Organization } from './crm';
|
|
4
|
-
import {
|
|
4
|
+
import type { InterestBffMeta, OpportunityInterest } from './interests';
|
|
5
5
|
import { Payment } from './payments';
|
|
6
6
|
import { Quote, QuoteStatus } from './quotes';
|
|
7
7
|
import { OpportunityReservation } from './reservations';
|
|
@@ -159,7 +159,6 @@ export type Opportunity = BaseOpportunity & {
|
|
|
159
159
|
logisticStatus?: OpportunityLogisticStatus;
|
|
160
160
|
activeQuoteId?: string;
|
|
161
161
|
amount?: string;
|
|
162
|
-
interest?: Interest;
|
|
163
162
|
documents?: Document[];
|
|
164
163
|
leasingContractId?: string;
|
|
165
164
|
requirementsOverride?: {
|
|
@@ -173,7 +172,6 @@ export type OpportunityUpdate = {
|
|
|
173
172
|
administrativePerson?: string | null;
|
|
174
173
|
contactId?: string | null;
|
|
175
174
|
activeQuoteId?: string | null;
|
|
176
|
-
interest?: Interest | null;
|
|
177
175
|
reviewed?: boolean;
|
|
178
176
|
prepared?: boolean;
|
|
179
177
|
lost?: boolean;
|
|
@@ -227,6 +225,7 @@ export type OpportunityBffMeta = ReferenceData & {
|
|
|
227
225
|
export type OpportunityBFF = {
|
|
228
226
|
opportunity: DataRecord<Opportunity, OpportunityBffMeta>;
|
|
229
227
|
vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;
|
|
228
|
+
interest?: DataRecord<OpportunityInterest, InterestBffMeta>;
|
|
230
229
|
bids: DataRecord<Bid>[];
|
|
231
230
|
quotes: DataRecord<Quote>[];
|
|
232
231
|
activeQuote?: DataRecord<Quote>;
|
|
@@ -649,11 +648,35 @@ export type CashOutRow = {
|
|
|
649
648
|
cumulativeCash: number;
|
|
650
649
|
};
|
|
651
650
|
|
|
651
|
+
export type HpDeliveryFields = {
|
|
652
|
+
detailsOfStacking?: string | null;
|
|
653
|
+
technicalControlNeeded: boolean | null;
|
|
654
|
+
|
|
655
|
+
//PickUP Delivery
|
|
656
|
+
urgentDelivery?: boolean | null;
|
|
657
|
+
dateOfPickUpByCustomer?: number | null;
|
|
658
|
+
modeOfTransportPickUpByCustomer?: string | null; //entity Id
|
|
659
|
+
detailsOfBorderCrossing?: string | null;
|
|
660
|
+
insuranceNeeded: boolean | null;
|
|
661
|
+
transitPlateNeeded: boolean | null;
|
|
662
|
+
licensePlateNeeded: boolean | null;
|
|
663
|
+
|
|
664
|
+
//Address Delivery
|
|
665
|
+
address?: string | null;
|
|
666
|
+
kmToAddressOfDelivery?: number | null;
|
|
667
|
+
|
|
668
|
+
//To Port Delivery
|
|
669
|
+
originPortText?: string | null; //entity Id
|
|
670
|
+
shippingCompany?: string | null; //string Id
|
|
671
|
+
destinationPort?: string | null;
|
|
672
|
+
cleaningDegassingNeeded: boolean | null;
|
|
673
|
+
};
|
|
674
|
+
|
|
652
675
|
export type HpIsaProcessRequest = {
|
|
653
676
|
tenantId: string;
|
|
654
677
|
initiatedBy: 'bisondesk';
|
|
655
678
|
processMetaId: string;
|
|
656
|
-
processRunData: {
|
|
679
|
+
processRunData: HpDeliveryFields & {
|
|
657
680
|
entityOwner: string;
|
|
658
681
|
nameSalesPerson: string;
|
|
659
682
|
|
|
@@ -669,31 +692,10 @@ export type HpIsaProcessRequest = {
|
|
|
669
692
|
dealCancelled: boolean;
|
|
670
693
|
opportunityId: string;
|
|
671
694
|
deliveryType: string; //entity Id
|
|
672
|
-
detailsOfStacking?: string | null;
|
|
673
695
|
directDelivery?: boolean | null;
|
|
674
696
|
directDeliveryReason?: string | null;
|
|
675
697
|
agreedPrice?: string;
|
|
676
698
|
|
|
677
|
-
//PickUP Delivery
|
|
678
|
-
urgentDelivery?: boolean | null;
|
|
679
|
-
dateOfPickUpByCustomer?: number | null;
|
|
680
|
-
modeOfTransportPickUpByCustomer?: string | null; //entity Id
|
|
681
|
-
detailsOfBorderCrossing?: string | null;
|
|
682
|
-
technicalControlNeeded: boolean | null;
|
|
683
|
-
insuranceNeeded: boolean | null;
|
|
684
|
-
transitPlateNeeded: boolean | null;
|
|
685
|
-
licensePlateNeeded: boolean | null;
|
|
686
|
-
|
|
687
|
-
//Address Delivery
|
|
688
|
-
addressOfDelivery?: string | null;
|
|
689
|
-
kmToAddressOfDelivery?: number | null;
|
|
690
|
-
|
|
691
|
-
//To Port Delivery
|
|
692
|
-
originPortText?: string | null; //entity Id
|
|
693
|
-
shippingCompany?: string | null; //string Id
|
|
694
|
-
destinationPort?: string | null;
|
|
695
|
-
cleaningDegassingNeeded: boolean | null;
|
|
696
|
-
|
|
697
699
|
//Extras
|
|
698
700
|
garageExtrasCodes: string[];
|
|
699
701
|
logisticsExtrasCodes: string[];
|
package/src/types/quotes.ts
CHANGED
|
@@ -53,27 +53,31 @@ export enum TransportationMode {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
type BaseQuoteCalculatorInput = {
|
|
56
|
-
|
|
56
|
+
branchId: string;
|
|
57
57
|
branchCountry: string;
|
|
58
58
|
customerCountry: string;
|
|
59
59
|
customerVatNumber?: string;
|
|
60
|
-
vehicleCategory: string;
|
|
61
|
-
bodywork?: string;
|
|
62
60
|
currency: string;
|
|
61
|
+
vehicle: {
|
|
62
|
+
id: string;
|
|
63
|
+
category: string;
|
|
64
|
+
bodywork?: string;
|
|
65
|
+
agreedPrice: string;
|
|
66
|
+
};
|
|
63
67
|
};
|
|
64
68
|
|
|
65
69
|
// Sent by the Frontend to bootstrap the calculator
|
|
66
70
|
export type LeasingCalculatorDefaultInput = BaseQuoteCalculatorInput & {
|
|
67
|
-
salesPrice: string;
|
|
68
|
-
purchasePrice: string;
|
|
69
71
|
deliveryPackage?: LeasingQuoteExtraInput;
|
|
70
72
|
};
|
|
71
73
|
|
|
72
74
|
export type LeasingCalculatorInput = BaseQuoteCalculatorInput & {
|
|
73
75
|
localLicensePlate: boolean;
|
|
74
76
|
vanCourier: boolean;
|
|
77
|
+
vehicle: BaseQuoteCalculatorInput['vehicle'] & {
|
|
78
|
+
purchasePrice: string;
|
|
79
|
+
};
|
|
75
80
|
leasing: {
|
|
76
|
-
salesPrice: string;
|
|
77
81
|
deposit: string;
|
|
78
82
|
depositMode: PricePercentageMode;
|
|
79
83
|
depositPercentage: string;
|
|
@@ -84,7 +88,6 @@ export type LeasingCalculatorInput = BaseQuoteCalculatorInput & {
|
|
|
84
88
|
startupFeeMode: PricePercentageMode;
|
|
85
89
|
startupFeePercentage: string;
|
|
86
90
|
interestRate: string;
|
|
87
|
-
purchasePrice: string;
|
|
88
91
|
duration: number;
|
|
89
92
|
contractStartDate: string;
|
|
90
93
|
};
|
|
@@ -154,25 +157,18 @@ export type PortDeliverytype = BaseDeliveryType & {
|
|
|
154
157
|
|
|
155
158
|
// Sent by the Frontend to bootstrap the calculator
|
|
156
159
|
export type SalesCalculatorDefaultInput = BaseQuoteCalculatorInput & {
|
|
157
|
-
vehicle: {
|
|
158
|
-
agreedPrice: string;
|
|
159
|
-
comissionCost: string;
|
|
160
|
-
id: string;
|
|
161
|
-
};
|
|
162
160
|
extras: SalesQuoteExtraInput[];
|
|
163
161
|
customRequests: CustomSalesQuoteExtraInput[];
|
|
164
162
|
};
|
|
165
163
|
|
|
166
164
|
export type SalesCalculatorInput = BaseQuoteCalculatorInput & {
|
|
167
|
-
vehicle: {
|
|
165
|
+
vehicle: BaseQuoteCalculatorInput['vehicle'] & {
|
|
166
|
+
purchasePrice: string;
|
|
167
|
+
premiumPrice?: string;
|
|
168
168
|
vatRate: string;
|
|
169
|
-
agreedPrice: string;
|
|
170
169
|
minimumPrice: string;
|
|
171
170
|
internetPrice?: string;
|
|
172
|
-
premiumPrice?: string;
|
|
173
|
-
purchasePrice: string; //TODO don't send to Frontend but store in DB
|
|
174
171
|
comissionCost: string;
|
|
175
|
-
id: string;
|
|
176
172
|
};
|
|
177
173
|
delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;
|
|
178
174
|
extras: SalesQuoteExtraInput[];
|
package/src/types/users.ts
CHANGED
package/src/types/vehicles.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"leads.js","sourceRoot":"/","sources":["types/leads.ts"],"names":[],"mappings":"","sourcesContent":["import {\n PhoneNumberRawValue,\n PhoneNumberValue,\n SearchPermissions,\n} from '@bisondesk/commons-sdk/types';\nimport { PublicSearchDefinition } from './definitions';\nimport { ReferenceData } from './utils';\nimport { SearchVehicle } from './vehicles';\n\nexport type SearchLead = Lead;\n\nexport type InputSearchLead = SearchLead & {\n permissions: SearchPermissions;\n};\n\nexport type RankedSearchLead = SearchLead & { score: number };\n\nexport type LeadPublicSearchDefinitions = {\n searchLead: PublicSearchDefinition;\n};\n\nexport type LeadEvent = {\n id: string;\n action: 'upsert' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type LeadContact = {\n accountManager?: string;\n companyName?: string;\n country: string;\n email?: string;\n name: string;\n phone?: PhoneNumberValue | PhoneNumberRawValue;\n remarks?: string;\n\n // Fields used to link lead to existing org and contact.\n organizationId?: string;\n contactId?: string;\n orgNumber?: number;\n};\n\nexport type LeadScore = {\n leadId: string;\n score: number;\n scores: { name: string; value: number }[];\n};\n\nexport type VehicleScore = {\n vehicleId: string;\n score: number;\n};\n\nexport type LeadVehicles = {\n vehicles: VehicleScore[];\n};\n\nexport type VehicleLeads = {\n leads: LeadScore[];\n};\n\nexport type VehicleLeadsResponse = VehicleLeads & {\n leadsById: { [leadId: string]: Lead };\n};\n\nexport type LeadVehiclesResponse = LeadVehicles & {\n vehiclesById: { [vehicleId: string]: SearchVehicle };\n};\n\nexport type LeadStats = {\n lastClientConversation?: string;\n lastClientTx?: string;\n clientTxs?: number;\n};\n\nexport type LeadVehicle = {\n createdAt: string;\n vehicleId: string;\n saleId?: string;\n};\n\nexport type Lead = {\n id: string;\n createdAt: string;\n contact: LeadContact;\n interests: Interest[];\n vehicles: LeadVehicle[];\n stats?: LeadStats;\n};\n\nexport type InterestVersion = {\n make: string;\n models?: string[];\n};\n\nexport type Interest = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n extended?: string[];\n heightened?: string[];\n adr?: boolean;\n age?: number;\n axleConfigurations?: string[];\n bodystyle?: string;\n cabins?: string[];\n category: string;\n crane?: boolean;\n damaged?: boolean;\n euronorms?: string[];\n horsepower?: number;\n used?: boolean;\n kilometers?: number;\n versions?: InterestVersion[];\n price?: number;\n leasing?: boolean;\n retarderIntarder?: boolean;\n suspensions?: string[];\n tailgate?: boolean;\n transmissions?: string[];\n autoGenerated?: boolean;\n\n remarks?: string;\n};\n\nexport type InterestResponse = {\n interest: Interest;\n meta: ReferenceData;\n};\n\nexport type InterestSearchRequest = { interest: Interest; offset: number; limit: number };\n\nexport type VehicleLeadsSearchRequest = { vehicleId: string };\n\nexport type InterestAutocompleteRequest = { vehicleId: string };\n\nexport type LeadVehiclesSearchRequest = { leadId: string };\n\nexport type SimilarVehiclesRequest = {\n offset: number;\n limit: number;\n};\n"]}
|
package/lib/esm/types/leads.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"leads.js","sourceRoot":"/","sources":["types/leads.ts"],"names":[],"mappings":"","sourcesContent":["import {\n PhoneNumberRawValue,\n PhoneNumberValue,\n SearchPermissions,\n} from '@bisondesk/commons-sdk/types';\nimport { PublicSearchDefinition } from './definitions';\nimport { ReferenceData } from './utils';\nimport { SearchVehicle } from './vehicles';\n\nexport type SearchLead = Lead;\n\nexport type InputSearchLead = SearchLead & {\n permissions: SearchPermissions;\n};\n\nexport type RankedSearchLead = SearchLead & { score: number };\n\nexport type LeadPublicSearchDefinitions = {\n searchLead: PublicSearchDefinition;\n};\n\nexport type LeadEvent = {\n id: string;\n action: 'upsert' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type LeadContact = {\n accountManager?: string;\n companyName?: string;\n country: string;\n email?: string;\n name: string;\n phone?: PhoneNumberValue | PhoneNumberRawValue;\n remarks?: string;\n\n // Fields used to link lead to existing org and contact.\n organizationId?: string;\n contactId?: string;\n orgNumber?: number;\n};\n\nexport type LeadScore = {\n leadId: string;\n score: number;\n scores: { name: string; value: number }[];\n};\n\nexport type VehicleScore = {\n vehicleId: string;\n score: number;\n};\n\nexport type LeadVehicles = {\n vehicles: VehicleScore[];\n};\n\nexport type VehicleLeads = {\n leads: LeadScore[];\n};\n\nexport type VehicleLeadsResponse = VehicleLeads & {\n leadsById: { [leadId: string]: Lead };\n};\n\nexport type LeadVehiclesResponse = LeadVehicles & {\n vehiclesById: { [vehicleId: string]: SearchVehicle };\n};\n\nexport type LeadStats = {\n lastClientConversation?: string;\n lastClientTx?: string;\n clientTxs?: number;\n};\n\nexport type LeadVehicle = {\n createdAt: string;\n vehicleId: string;\n saleId?: string;\n};\n\nexport type Lead = {\n id: string;\n createdAt: string;\n contact: LeadContact;\n interests: Interest[];\n vehicles: LeadVehicle[];\n stats?: LeadStats;\n};\n\nexport type InterestVersion = {\n make: string;\n models?: string[];\n};\n\nexport type Interest = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n extended?: string[];\n heightened?: string[];\n adr?: boolean;\n age?: number;\n axleConfigurations?: string[];\n bodystyle?: string;\n cabins?: string[];\n category: string;\n crane?: boolean;\n damaged?: boolean;\n euronorms?: string[];\n horsepower?: number;\n used?: boolean;\n kilometers?: number;\n versions?: InterestVersion[];\n price?: number;\n leasing?: boolean;\n retarderIntarder?: boolean;\n suspensions?: string[];\n tailgate?: boolean;\n transmissions?: string[];\n autoGenerated?: boolean;\n\n remarks?: string;\n};\n\nexport type InterestResponse = {\n interest: Interest;\n meta: ReferenceData;\n};\n\nexport type InterestSearchRequest = { interest: Interest; offset: number; limit: number };\n\nexport type VehicleLeadsSearchRequest = { vehicleId: string };\n\nexport type InterestAutocompleteRequest = { vehicleId: string };\n\nexport type LeadVehiclesSearchRequest = { leadId: string };\n\nexport type SimilarVehiclesRequest = {\n offset: number;\n limit: number;\n};\n"]}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { PhoneNumberRawValue, PhoneNumberValue, SearchPermissions } from '@bisondesk/commons-sdk/types';
|
|
2
|
-
import { PublicSearchDefinition } from './definitions';
|
|
3
|
-
import { ReferenceData } from './utils';
|
|
4
|
-
import { SearchVehicle } from './vehicles';
|
|
5
|
-
export type SearchLead = Lead;
|
|
6
|
-
export type InputSearchLead = SearchLead & {
|
|
7
|
-
permissions: SearchPermissions;
|
|
8
|
-
};
|
|
9
|
-
export type RankedSearchLead = SearchLead & {
|
|
10
|
-
score: number;
|
|
11
|
-
};
|
|
12
|
-
export type LeadPublicSearchDefinitions = {
|
|
13
|
-
searchLead: PublicSearchDefinition;
|
|
14
|
-
};
|
|
15
|
-
export type LeadEvent = {
|
|
16
|
-
id: string;
|
|
17
|
-
action: 'upsert' | 'delete';
|
|
18
|
-
actionAt: string;
|
|
19
|
-
userId: string;
|
|
20
|
-
tenantId: string;
|
|
21
|
-
};
|
|
22
|
-
export type LeadContact = {
|
|
23
|
-
accountManager?: string;
|
|
24
|
-
companyName?: string;
|
|
25
|
-
country: string;
|
|
26
|
-
email?: string;
|
|
27
|
-
name: string;
|
|
28
|
-
phone?: PhoneNumberValue | PhoneNumberRawValue;
|
|
29
|
-
remarks?: string;
|
|
30
|
-
organizationId?: string;
|
|
31
|
-
contactId?: string;
|
|
32
|
-
orgNumber?: number;
|
|
33
|
-
};
|
|
34
|
-
export type LeadScore = {
|
|
35
|
-
leadId: string;
|
|
36
|
-
score: number;
|
|
37
|
-
scores: {
|
|
38
|
-
name: string;
|
|
39
|
-
value: number;
|
|
40
|
-
}[];
|
|
41
|
-
};
|
|
42
|
-
export type VehicleScore = {
|
|
43
|
-
vehicleId: string;
|
|
44
|
-
score: number;
|
|
45
|
-
};
|
|
46
|
-
export type LeadVehicles = {
|
|
47
|
-
vehicles: VehicleScore[];
|
|
48
|
-
};
|
|
49
|
-
export type VehicleLeads = {
|
|
50
|
-
leads: LeadScore[];
|
|
51
|
-
};
|
|
52
|
-
export type VehicleLeadsResponse = VehicleLeads & {
|
|
53
|
-
leadsById: {
|
|
54
|
-
[leadId: string]: Lead;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export type LeadVehiclesResponse = LeadVehicles & {
|
|
58
|
-
vehiclesById: {
|
|
59
|
-
[vehicleId: string]: SearchVehicle;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export type LeadStats = {
|
|
63
|
-
lastClientConversation?: string;
|
|
64
|
-
lastClientTx?: string;
|
|
65
|
-
clientTxs?: number;
|
|
66
|
-
};
|
|
67
|
-
export type LeadVehicle = {
|
|
68
|
-
createdAt: string;
|
|
69
|
-
vehicleId: string;
|
|
70
|
-
saleId?: string;
|
|
71
|
-
};
|
|
72
|
-
export type Lead = {
|
|
73
|
-
id: string;
|
|
74
|
-
createdAt: string;
|
|
75
|
-
contact: LeadContact;
|
|
76
|
-
interests: Interest[];
|
|
77
|
-
vehicles: LeadVehicle[];
|
|
78
|
-
stats?: LeadStats;
|
|
79
|
-
};
|
|
80
|
-
export type InterestVersion = {
|
|
81
|
-
make: string;
|
|
82
|
-
models?: string[];
|
|
83
|
-
};
|
|
84
|
-
export type Interest = {
|
|
85
|
-
id: string;
|
|
86
|
-
modifiedAt: string;
|
|
87
|
-
modifiedBy: string;
|
|
88
|
-
extended?: string[];
|
|
89
|
-
heightened?: string[];
|
|
90
|
-
adr?: boolean;
|
|
91
|
-
age?: number;
|
|
92
|
-
axleConfigurations?: string[];
|
|
93
|
-
bodystyle?: string;
|
|
94
|
-
cabins?: string[];
|
|
95
|
-
category: string;
|
|
96
|
-
crane?: boolean;
|
|
97
|
-
damaged?: boolean;
|
|
98
|
-
euronorms?: string[];
|
|
99
|
-
horsepower?: number;
|
|
100
|
-
used?: boolean;
|
|
101
|
-
kilometers?: number;
|
|
102
|
-
versions?: InterestVersion[];
|
|
103
|
-
price?: number;
|
|
104
|
-
leasing?: boolean;
|
|
105
|
-
retarderIntarder?: boolean;
|
|
106
|
-
suspensions?: string[];
|
|
107
|
-
tailgate?: boolean;
|
|
108
|
-
transmissions?: string[];
|
|
109
|
-
autoGenerated?: boolean;
|
|
110
|
-
remarks?: string;
|
|
111
|
-
};
|
|
112
|
-
export type InterestResponse = {
|
|
113
|
-
interest: Interest;
|
|
114
|
-
meta: ReferenceData;
|
|
115
|
-
};
|
|
116
|
-
export type InterestSearchRequest = {
|
|
117
|
-
interest: Interest;
|
|
118
|
-
offset: number;
|
|
119
|
-
limit: number;
|
|
120
|
-
};
|
|
121
|
-
export type VehicleLeadsSearchRequest = {
|
|
122
|
-
vehicleId: string;
|
|
123
|
-
};
|
|
124
|
-
export type InterestAutocompleteRequest = {
|
|
125
|
-
vehicleId: string;
|
|
126
|
-
};
|
|
127
|
-
export type LeadVehiclesSearchRequest = {
|
|
128
|
-
leadId: string;
|
|
129
|
-
};
|
|
130
|
-
export type SimilarVehiclesRequest = {
|
|
131
|
-
offset: number;
|
|
132
|
-
limit: number;
|
|
133
|
-
};
|
|
134
|
-
//# sourceMappingURL=leads.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"leads.d.ts","sourceRoot":"/","sources":["types/leads.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC;AAE9B,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG;IACzC,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,sBAAs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
3
|
-
PhoneNumberValue,
|
|
4
|
-
SearchPermissions,
|
|
5
|
-
} from '@bisondesk/commons-sdk/types';
|
|
6
|
-
import { PublicSearchDefinition } from './definitions';
|
|
7
|
-
import { ReferenceData } from './utils';
|
|
8
|
-
import { SearchVehicle } from './vehicles';
|
|
9
|
-
|
|
10
|
-
export type SearchLead = Lead;
|
|
11
|
-
|
|
12
|
-
export type InputSearchLead = SearchLead & {
|
|
13
|
-
permissions: SearchPermissions;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type RankedSearchLead = SearchLead & { score: number };
|
|
17
|
-
|
|
18
|
-
export type LeadPublicSearchDefinitions = {
|
|
19
|
-
searchLead: PublicSearchDefinition;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type LeadEvent = {
|
|
23
|
-
id: string;
|
|
24
|
-
action: 'upsert' | 'delete';
|
|
25
|
-
actionAt: string;
|
|
26
|
-
userId: string;
|
|
27
|
-
tenantId: string;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type LeadContact = {
|
|
31
|
-
accountManager?: string;
|
|
32
|
-
companyName?: string;
|
|
33
|
-
country: string;
|
|
34
|
-
email?: string;
|
|
35
|
-
name: string;
|
|
36
|
-
phone?: PhoneNumberValue | PhoneNumberRawValue;
|
|
37
|
-
remarks?: string;
|
|
38
|
-
|
|
39
|
-
// Fields used to link lead to existing org and contact.
|
|
40
|
-
organizationId?: string;
|
|
41
|
-
contactId?: string;
|
|
42
|
-
orgNumber?: number;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type LeadScore = {
|
|
46
|
-
leadId: string;
|
|
47
|
-
score: number;
|
|
48
|
-
scores: { name: string; value: number }[];
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export type VehicleScore = {
|
|
52
|
-
vehicleId: string;
|
|
53
|
-
score: number;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export type LeadVehicles = {
|
|
57
|
-
vehicles: VehicleScore[];
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export type VehicleLeads = {
|
|
61
|
-
leads: LeadScore[];
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export type VehicleLeadsResponse = VehicleLeads & {
|
|
65
|
-
leadsById: { [leadId: string]: Lead };
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export type LeadVehiclesResponse = LeadVehicles & {
|
|
69
|
-
vehiclesById: { [vehicleId: string]: SearchVehicle };
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export type LeadStats = {
|
|
73
|
-
lastClientConversation?: string;
|
|
74
|
-
lastClientTx?: string;
|
|
75
|
-
clientTxs?: number;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export type LeadVehicle = {
|
|
79
|
-
createdAt: string;
|
|
80
|
-
vehicleId: string;
|
|
81
|
-
saleId?: string;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export type Lead = {
|
|
85
|
-
id: string;
|
|
86
|
-
createdAt: string;
|
|
87
|
-
contact: LeadContact;
|
|
88
|
-
interests: Interest[];
|
|
89
|
-
vehicles: LeadVehicle[];
|
|
90
|
-
stats?: LeadStats;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export type InterestVersion = {
|
|
94
|
-
make: string;
|
|
95
|
-
models?: string[];
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export type Interest = {
|
|
99
|
-
id: string;
|
|
100
|
-
modifiedAt: string;
|
|
101
|
-
modifiedBy: string;
|
|
102
|
-
extended?: string[];
|
|
103
|
-
heightened?: string[];
|
|
104
|
-
adr?: boolean;
|
|
105
|
-
age?: number;
|
|
106
|
-
axleConfigurations?: string[];
|
|
107
|
-
bodystyle?: string;
|
|
108
|
-
cabins?: string[];
|
|
109
|
-
category: string;
|
|
110
|
-
crane?: boolean;
|
|
111
|
-
damaged?: boolean;
|
|
112
|
-
euronorms?: string[];
|
|
113
|
-
horsepower?: number;
|
|
114
|
-
used?: boolean;
|
|
115
|
-
kilometers?: number;
|
|
116
|
-
versions?: InterestVersion[];
|
|
117
|
-
price?: number;
|
|
118
|
-
leasing?: boolean;
|
|
119
|
-
retarderIntarder?: boolean;
|
|
120
|
-
suspensions?: string[];
|
|
121
|
-
tailgate?: boolean;
|
|
122
|
-
transmissions?: string[];
|
|
123
|
-
autoGenerated?: boolean;
|
|
124
|
-
|
|
125
|
-
remarks?: string;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export type InterestResponse = {
|
|
129
|
-
interest: Interest;
|
|
130
|
-
meta: ReferenceData;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export type InterestSearchRequest = { interest: Interest; offset: number; limit: number };
|
|
134
|
-
|
|
135
|
-
export type VehicleLeadsSearchRequest = { vehicleId: string };
|
|
136
|
-
|
|
137
|
-
export type InterestAutocompleteRequest = { vehicleId: string };
|
|
138
|
-
|
|
139
|
-
export type LeadVehiclesSearchRequest = { leadId: string };
|
|
140
|
-
|
|
141
|
-
export type SimilarVehiclesRequest = {
|
|
142
|
-
offset: number;
|
|
143
|
-
limit: number;
|
|
144
|
-
};
|