@bisondesk/core-sdk 1.0.23-B → 1.0.23
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/constants.d.ts +0 -77
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +1 -924
- package/lib/constants.js.map +1 -1
- package/lib/types/crm.d.ts +30 -103
- package/lib/types/crm.d.ts.map +1 -1
- package/lib/types/crm.js +0 -16
- package/lib/types/crm.js.map +1 -1
- package/lib/types/definitions.d.ts +13 -15
- package/lib/types/definitions.d.ts.map +1 -1
- package/lib/types/fields.d.ts +25 -26
- package/lib/types/fields.d.ts.map +1 -1
- package/lib/types/fields.js +0 -4
- package/lib/types/fields.js.map +1 -1
- package/lib/types/interests.d.ts +25 -0
- package/lib/types/interests.d.ts.map +1 -0
- package/lib/types/{settings.js → interests.js} +1 -1
- package/lib/types/interests.js.map +1 -0
- package/lib/types/picklists.d.ts +4 -15
- package/lib/types/picklists.d.ts.map +1 -1
- package/lib/types/search.d.ts +4 -26
- package/lib/types/search.d.ts.map +1 -1
- package/lib/types/search.js.map +1 -1
- package/lib/types/storage.d.ts +11 -1
- package/lib/types/storage.d.ts.map +1 -1
- package/lib/types/storage.js +0 -15
- package/lib/types/storage.js.map +1 -1
- package/lib/types/tenants.d.ts +9 -32
- package/lib/types/tenants.d.ts.map +1 -1
- package/lib/types/tenants.js +0 -11
- package/lib/types/tenants.js.map +1 -1
- package/lib/types/users.d.ts +3 -11
- package/lib/types/users.d.ts.map +1 -1
- package/lib/types/utils.d.ts +0 -20
- package/lib/types/utils.d.ts.map +1 -1
- package/lib/types/utils.js +0 -6
- package/lib/types/utils.js.map +1 -1
- package/lib/types/vehicles.d.ts +92 -406
- package/lib/types/vehicles.d.ts.map +1 -1
- package/lib/types/vehicles.js +1 -54
- package/lib/types/vehicles.js.map +1 -1
- package/package.json +6 -8
- package/src/constants.ts +1 -930
- package/src/types/crm.ts +30 -118
- package/src/types/definitions.ts +12 -19
- package/src/types/fields.ts +31 -72
- package/src/types/interests.ts +24 -0
- package/src/types/picklists.ts +7 -26
- package/src/types/search.ts +4 -34
- package/src/types/storage.ts +12 -1
- package/src/types/tenants.ts +11 -37
- package/src/types/users.ts +3 -17
- package/src/types/utils.ts +0 -25
- package/src/types/vehicles.ts +93 -461
- package/tsconfig.tsbuildinfo +2995 -1
- package/lib/apis/crm.d.ts +0 -39
- package/lib/apis/crm.d.ts.map +0 -1
- package/lib/apis/crm.js +0 -201
- package/lib/apis/crm.js.map +0 -1
- package/lib/apis/documents.d.ts +0 -4
- package/lib/apis/documents.d.ts.map +0 -1
- package/lib/apis/documents.js +0 -47
- package/lib/apis/documents.js.map +0 -1
- package/lib/apis/internet-vehicles.d.ts +0 -3
- package/lib/apis/internet-vehicles.d.ts.map +0 -1
- package/lib/apis/internet-vehicles.js +0 -27
- package/lib/apis/internet-vehicles.js.map +0 -1
- package/lib/apis/leasing-administration.d.ts +0 -8
- package/lib/apis/leasing-administration.d.ts.map +0 -1
- package/lib/apis/leasing-administration.js +0 -49
- package/lib/apis/leasing-administration.js.map +0 -1
- package/lib/apis/leasing.d.ts +0 -19
- package/lib/apis/leasing.d.ts.map +0 -1
- package/lib/apis/leasing.js +0 -168
- package/lib/apis/leasing.js.map +0 -1
- package/lib/apis/opportunities.d.ts +0 -9
- package/lib/apis/opportunities.d.ts.map +0 -1
- package/lib/apis/opportunities.js +0 -94
- package/lib/apis/opportunities.js.map +0 -1
- package/lib/apis/picklists.d.ts +0 -5
- package/lib/apis/picklists.d.ts.map +0 -1
- package/lib/apis/picklists.js +0 -44
- package/lib/apis/picklists.js.map +0 -1
- package/lib/apis/tenants.d.ts +0 -7
- package/lib/apis/tenants.d.ts.map +0 -1
- package/lib/apis/tenants.js +0 -80
- package/lib/apis/tenants.js.map +0 -1
- package/lib/apis/users.d.ts +0 -3
- package/lib/apis/users.d.ts.map +0 -1
- package/lib/apis/users.js +0 -26
- package/lib/apis/users.js.map +0 -1
- package/lib/apis/utils.d.ts +0 -9
- package/lib/apis/utils.d.ts.map +0 -1
- package/lib/apis/utils.js +0 -23
- package/lib/apis/utils.js.map +0 -1
- package/lib/apis/vehicles.d.ts +0 -18
- package/lib/apis/vehicles.d.ts.map +0 -1
- package/lib/apis/vehicles.js +0 -159
- package/lib/apis/vehicles.js.map +0 -1
- package/lib/ddb-entities.d.ts +0 -2
- package/lib/ddb-entities.d.ts.map +0 -1
- package/lib/ddb-entities.js +0 -5
- package/lib/ddb-entities.js.map +0 -1
- package/lib/types/activities.d.ts +0 -38
- package/lib/types/activities.d.ts.map +0 -1
- package/lib/types/activities.js +0 -16
- package/lib/types/activities.js.map +0 -1
- package/lib/types/documents.d.ts +0 -105
- package/lib/types/documents.d.ts.map +0 -1
- package/lib/types/documents.js +0 -3
- package/lib/types/documents.js.map +0 -1
- package/lib/types/internet-vehicles.d.ts +0 -64
- package/lib/types/internet-vehicles.d.ts.map +0 -1
- package/lib/types/internet-vehicles.js +0 -3
- package/lib/types/internet-vehicles.js.map +0 -1
- package/lib/types/leads.d.ts +0 -134
- package/lib/types/leads.d.ts.map +0 -1
- package/lib/types/leads.js +0 -3
- package/lib/types/leads.js.map +0 -1
- package/lib/types/leasing-administration.d.ts +0 -107
- package/lib/types/leasing-administration.d.ts.map +0 -1
- package/lib/types/leasing-administration.js +0 -3
- package/lib/types/leasing-administration.js.map +0 -1
- package/lib/types/leasing-search.d.ts +0 -22
- package/lib/types/leasing-search.d.ts.map +0 -1
- package/lib/types/leasing-search.js +0 -3
- package/lib/types/leasing-search.js.map +0 -1
- package/lib/types/leasing-settings.d.ts +0 -113
- package/lib/types/leasing-settings.d.ts.map +0 -1
- package/lib/types/leasing-settings.js +0 -10
- package/lib/types/leasing-settings.js.map +0 -1
- package/lib/types/leasing.d.ts +0 -322
- package/lib/types/leasing.d.ts.map +0 -1
- package/lib/types/leasing.js +0 -24
- package/lib/types/leasing.js.map +0 -1
- package/lib/types/machines.d.ts +0 -38
- package/lib/types/machines.d.ts.map +0 -1
- package/lib/types/machines.js +0 -3
- package/lib/types/machines.js.map +0 -1
- package/lib/types/opportunities.d.ts +0 -448
- package/lib/types/opportunities.d.ts.map +0 -1
- package/lib/types/opportunities.js +0 -68
- package/lib/types/opportunities.js.map +0 -1
- package/lib/types/payments.d.ts +0 -38
- package/lib/types/payments.d.ts.map +0 -1
- package/lib/types/payments.js +0 -9
- package/lib/types/payments.js.map +0 -1
- package/lib/types/quotes.d.ts +0 -173
- package/lib/types/quotes.d.ts.map +0 -1
- package/lib/types/quotes.js +0 -26
- package/lib/types/quotes.js.map +0 -1
- package/lib/types/recently-viewed.d.ts +0 -33
- package/lib/types/recently-viewed.d.ts.map +0 -1
- package/lib/types/recently-viewed.js +0 -3
- package/lib/types/recently-viewed.js.map +0 -1
- package/lib/types/saved-filters.d.ts +0 -20
- package/lib/types/saved-filters.d.ts.map +0 -1
- package/lib/types/saved-filters.js +0 -3
- package/lib/types/saved-filters.js.map +0 -1
- package/lib/types/settings.d.ts +0 -50
- package/lib/types/settings.d.ts.map +0 -1
- package/lib/types/settings.js.map +0 -1
- package/lib/types/templates.d.ts +0 -35
- package/lib/types/templates.d.ts.map +0 -1
- package/lib/types/templates.js +0 -9
- package/lib/types/templates.js.map +0 -1
- package/lib/types/website.d.ts +0 -24
- package/lib/types/website.d.ts.map +0 -1
- package/lib/types/website.js +0 -3
- package/lib/types/website.js.map +0 -1
- package/lib/utils/forms.d.ts +0 -6
- package/lib/utils/forms.d.ts.map +0 -1
- package/lib/utils/forms.js +0 -33
- package/lib/utils/forms.js.map +0 -1
- package/lib/utils/leasing.d.ts +0 -3
- package/lib/utils/leasing.d.ts.map +0 -1
- package/lib/utils/leasing.js +0 -10
- package/lib/utils/leasing.js.map +0 -1
- package/lib/utils/slug.d.ts +0 -3
- package/lib/utils/slug.d.ts.map +0 -1
- package/lib/utils/slug.js +0 -23
- package/lib/utils/slug.js.map +0 -1
- package/lib/utils/tenants.d.ts +0 -4
- package/lib/utils/tenants.d.ts.map +0 -1
- package/lib/utils/tenants.js +0 -16
- package/lib/utils/tenants.js.map +0 -1
- package/lib/utils/vehicles.d.ts +0 -12
- package/lib/utils/vehicles.d.ts.map +0 -1
- package/lib/utils/vehicles.js +0 -73
- package/lib/utils/vehicles.js.map +0 -1
- package/src/apis/crm.ts +0 -302
- package/src/apis/documents.ts +0 -54
- package/src/apis/internet-vehicles.ts +0 -23
- package/src/apis/leasing-administration.ts +0 -70
- package/src/apis/leasing.ts +0 -257
- package/src/apis/opportunities.ts +0 -133
- package/src/apis/picklists.ts +0 -50
- package/src/apis/tenants.ts +0 -100
- package/src/apis/users.ts +0 -22
- package/src/apis/utils.ts +0 -23
- package/src/apis/vehicles.ts +0 -229
- package/src/ddb-entities.ts +0 -1
- package/src/environment.d.ts +0 -6
- package/src/types/activities.ts +0 -41
- package/src/types/documents.ts +0 -110
- package/src/types/internet-vehicles.ts +0 -67
- package/src/types/leads.ts +0 -144
- package/src/types/leasing-administration.ts +0 -131
- package/src/types/leasing-search.ts +0 -24
- package/src/types/leasing-settings.ts +0 -111
- package/src/types/leasing.ts +0 -360
- package/src/types/machines.ts +0 -40
- package/src/types/opportunities.ts +0 -496
- package/src/types/payments.ts +0 -40
- package/src/types/quotes.ts +0 -186
- package/src/types/recently-viewed.ts +0 -45
- package/src/types/saved-filters.ts +0 -21
- package/src/types/settings.ts +0 -51
- package/src/types/templates.ts +0 -40
- package/src/types/website.ts +0 -28
- package/src/utils/forms.ts +0 -32
- package/src/utils/leasing.ts +0 -14
- package/src/utils/slug.ts +0 -19
- package/src/utils/tenants.ts +0 -14
- package/src/utils/vehicles.ts +0 -92
package/src/apis/vehicles.ts
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SERVICE_ID_ADMIN_HEADER,
|
|
3
|
-
TENANT_ID_ADMIN_HEADER,
|
|
4
|
-
} from '@bisondesk/commons-sdk/lib/constants';
|
|
5
|
-
import { XError } from '@bisondesk/commons-sdk/lib/errors';
|
|
6
|
-
import fetch, { Response } from 'node-fetch';
|
|
7
|
-
import { DataRecord } from '../types/utils';
|
|
8
|
-
import { NewVehicle, Vehicle, VehicleMarketing, VehiclePurchase } from '../types/vehicles';
|
|
9
|
-
import { cleanHeaders, getAdminAuth } from './utils';
|
|
10
|
-
|
|
11
|
-
export const getVehicle = async (
|
|
12
|
-
tenantId: string,
|
|
13
|
-
vehicleId: string
|
|
14
|
-
): Promise<DataRecord<Vehicle> | undefined> => {
|
|
15
|
-
const auth = await getAdminAuth();
|
|
16
|
-
const response: Response = await fetch(
|
|
17
|
-
`${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}`,
|
|
18
|
-
{
|
|
19
|
-
headers: {
|
|
20
|
-
Authorization: auth,
|
|
21
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
22
|
-
},
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
if (response.ok) {
|
|
27
|
-
return response.status === 200 ? (response.json() as any) : undefined;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const body = await response.text();
|
|
31
|
-
throw new XError(response.statusText, { body });
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const getVehiclePurchase = async (
|
|
35
|
-
tenantId: string,
|
|
36
|
-
vehicleId: string
|
|
37
|
-
): Promise<DataRecord<VehiclePurchase> | undefined> => {
|
|
38
|
-
const auth = await getAdminAuth();
|
|
39
|
-
const response: Response = await fetch(
|
|
40
|
-
`${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/purchase`,
|
|
41
|
-
{
|
|
42
|
-
headers: {
|
|
43
|
-
Authorization: auth,
|
|
44
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
if (response.ok) {
|
|
50
|
-
return response.status === 200 ? (response.json() as any) : undefined;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const body = await response.text();
|
|
54
|
-
throw new XError(response.statusText, { body });
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const getVehicleByStockNumber = async (
|
|
58
|
-
tenantId: string,
|
|
59
|
-
stockNumber: string
|
|
60
|
-
): Promise<Vehicle | undefined> => {
|
|
61
|
-
const auth = await getAdminAuth();
|
|
62
|
-
const response: Response = await fetch(
|
|
63
|
-
`${process.env.CORE_API_ORIGIN}/api/vehicles/stock-number/${stockNumber}`,
|
|
64
|
-
{
|
|
65
|
-
headers: {
|
|
66
|
-
Authorization: auth,
|
|
67
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
68
|
-
},
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
if (response.ok) {
|
|
73
|
-
return response.status === 200 ? (response.json() as any) : undefined;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const body = await response.text();
|
|
77
|
-
throw new XError(response.statusText, { body });
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const getVehicleByPurchaseStockNumber = async (
|
|
81
|
-
tenantId: string,
|
|
82
|
-
stockNumber: string
|
|
83
|
-
): Promise<Vehicle | undefined> => {
|
|
84
|
-
const auth = await getAdminAuth();
|
|
85
|
-
const response: Response = await fetch(
|
|
86
|
-
`${process.env.CORE_API_ORIGIN}/api/vehicles/purchase-stock-number/${stockNumber}`,
|
|
87
|
-
{
|
|
88
|
-
headers: {
|
|
89
|
-
Authorization: auth,
|
|
90
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
91
|
-
},
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
if (response.ok) {
|
|
96
|
-
return response.status === 200 ? (response.json() as any) : undefined;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const body = await response.text();
|
|
100
|
-
throw new XError(response.statusText, { body });
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const getVehicleMarketing = async (
|
|
104
|
-
tenantId: string,
|
|
105
|
-
vehicleId: string
|
|
106
|
-
): Promise<VehicleMarketing | undefined> => {
|
|
107
|
-
const auth = await getAdminAuth();
|
|
108
|
-
const response: Response = await fetch(
|
|
109
|
-
`${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/marketing`,
|
|
110
|
-
{
|
|
111
|
-
headers: {
|
|
112
|
-
Authorization: auth,
|
|
113
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
114
|
-
},
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
if (response.ok) {
|
|
119
|
-
return response.status === 200 ? (response.json() as any) : undefined;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const body = await response.text();
|
|
123
|
-
throw new XError(response.statusText, { body });
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export const saveMarketing = async (
|
|
127
|
-
tenantId: string,
|
|
128
|
-
vehicleId: string,
|
|
129
|
-
marketing: VehicleMarketing
|
|
130
|
-
): Promise<VehicleMarketing> => {
|
|
131
|
-
const auth = await getAdminAuth();
|
|
132
|
-
|
|
133
|
-
const response: Response = await fetch(
|
|
134
|
-
`${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/marketing`,
|
|
135
|
-
{
|
|
136
|
-
method: 'POST',
|
|
137
|
-
headers: cleanHeaders({
|
|
138
|
-
Authorization: auth,
|
|
139
|
-
'Content-Type': 'application/json',
|
|
140
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
141
|
-
}),
|
|
142
|
-
body: JSON.stringify(marketing),
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
if (response.ok) {
|
|
147
|
-
return response.json() as any;
|
|
148
|
-
}
|
|
149
|
-
const body = await response.text();
|
|
150
|
-
throw new XError(response.statusText, { body, tenantId, vehicleId, marketing });
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export const saveVehiclePurchase = async (
|
|
154
|
-
tenantId: string,
|
|
155
|
-
vehicleId: string,
|
|
156
|
-
purchase: VehiclePurchase,
|
|
157
|
-
opts?: { serviceId: string }
|
|
158
|
-
): Promise<Vehicle> => {
|
|
159
|
-
const auth = await getAdminAuth();
|
|
160
|
-
const response: Response = await fetch(
|
|
161
|
-
`${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/purchase`,
|
|
162
|
-
{
|
|
163
|
-
method: 'POST',
|
|
164
|
-
headers: cleanHeaders({
|
|
165
|
-
Authorization: auth,
|
|
166
|
-
'Content-Type': 'application/json',
|
|
167
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
168
|
-
[SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,
|
|
169
|
-
}),
|
|
170
|
-
body: JSON.stringify(purchase),
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
if (response.ok) {
|
|
175
|
-
return response.json() as any;
|
|
176
|
-
}
|
|
177
|
-
const body = await response.text();
|
|
178
|
-
throw new XError(response.statusText, { body, tenantId, vehicleId, purchase, opts });
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
export const saveVehicle = async (
|
|
182
|
-
tenantId: string,
|
|
183
|
-
vehicle: NewVehicle | Vehicle,
|
|
184
|
-
opts?: { serviceId: string }
|
|
185
|
-
): Promise<Vehicle> => {
|
|
186
|
-
const auth = await getAdminAuth();
|
|
187
|
-
const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/vehicles`, {
|
|
188
|
-
method: 'POST',
|
|
189
|
-
headers: cleanHeaders({
|
|
190
|
-
Authorization: auth,
|
|
191
|
-
'Content-Type': 'application/json',
|
|
192
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
193
|
-
[SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,
|
|
194
|
-
}),
|
|
195
|
-
body: JSON.stringify(vehicle),
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
if (response.ok) {
|
|
199
|
-
return response.json() as any;
|
|
200
|
-
}
|
|
201
|
-
const body = await response.text();
|
|
202
|
-
throw new XError(response.statusText, { body, tenantId, vehicle, opts });
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
export const deleteVehicle = async (
|
|
206
|
-
tenantId: string,
|
|
207
|
-
vehicleId: string,
|
|
208
|
-
opts?: { serviceId: string }
|
|
209
|
-
): Promise<void> => {
|
|
210
|
-
const auth = await getAdminAuth();
|
|
211
|
-
const response: Response = await fetch(
|
|
212
|
-
`${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}`,
|
|
213
|
-
{
|
|
214
|
-
method: 'DELETE',
|
|
215
|
-
headers: cleanHeaders({
|
|
216
|
-
Authorization: auth,
|
|
217
|
-
[TENANT_ID_ADMIN_HEADER]: tenantId,
|
|
218
|
-
[SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,
|
|
219
|
-
}),
|
|
220
|
-
}
|
|
221
|
-
);
|
|
222
|
-
|
|
223
|
-
if (response.ok) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const body = await response.text();
|
|
228
|
-
throw new XError(response.statusText, { body, tenantId, vehicleId, opts });
|
|
229
|
-
};
|
package/src/ddb-entities.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const ITEM_VIEWS_KEY = 'views';
|
package/src/environment.d.ts
DELETED
package/src/types/activities.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export enum ActivityType {
|
|
2
|
-
CALL = 'call',
|
|
3
|
-
MEETING = 'meeting',
|
|
4
|
-
EMAIL = 'email',
|
|
5
|
-
CHAT = 'chat',
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export enum ActivityActions {
|
|
9
|
-
DELETE = 'delete',
|
|
10
|
-
EDIT = 'edit',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type BaseActivity = {
|
|
14
|
-
type: ActivityType;
|
|
15
|
-
opportunityId: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type NewActivity = BaseActivity & {
|
|
20
|
-
id?: undefined;
|
|
21
|
-
createdAt?: undefined;
|
|
22
|
-
createdBy?: undefined;
|
|
23
|
-
modifiedAt?: undefined;
|
|
24
|
-
modifiedBy?: undefined;
|
|
25
|
-
activityAt?: string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type Activity = BaseActivity & {
|
|
29
|
-
id: string;
|
|
30
|
-
createdAt: string;
|
|
31
|
-
createdBy: string;
|
|
32
|
-
modifiedAt: string;
|
|
33
|
-
modifiedBy: string;
|
|
34
|
-
activityAt: string;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type ActivityUpdate = {
|
|
38
|
-
description?: string;
|
|
39
|
-
type?: ActivityType;
|
|
40
|
-
activityAt?: string;
|
|
41
|
-
};
|
package/src/types/documents.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { AttachmentValue, SearchPermissions } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
-
import { Organization } from './crm';
|
|
3
|
-
import { PublicSearchDefinition } from './definitions';
|
|
4
|
-
|
|
5
|
-
export type FinanceLine = {
|
|
6
|
-
associations: {
|
|
7
|
-
others: { vehicleId: string; label: string }[];
|
|
8
|
-
sales: { id: string; vehicleId: string; label: string }[];
|
|
9
|
-
purchases: { id: string; vehicleId: string; label: string }[];
|
|
10
|
-
};
|
|
11
|
-
description: string;
|
|
12
|
-
id: string;
|
|
13
|
-
lineCode: string;
|
|
14
|
-
quantity: string;
|
|
15
|
-
unitPriceExclusive: string;
|
|
16
|
-
vatCode: string;
|
|
17
|
-
vatCoefficient: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type FinanceDocument = {
|
|
21
|
-
id: string;
|
|
22
|
-
branchId: string;
|
|
23
|
-
|
|
24
|
-
type: 'Sale Finance' | 'Purchase Finance';
|
|
25
|
-
subtype: 'Invoice' | 'Credit Note' | 'Proforma' | 'Purchase Order';
|
|
26
|
-
reference: string;
|
|
27
|
-
|
|
28
|
-
attachment: AttachmentValue;
|
|
29
|
-
lines: FinanceLine[];
|
|
30
|
-
notes?: string;
|
|
31
|
-
|
|
32
|
-
createdAt: string;
|
|
33
|
-
createdBy: string;
|
|
34
|
-
issueDate: string;
|
|
35
|
-
|
|
36
|
-
organizationSummary?: {
|
|
37
|
-
id: string;
|
|
38
|
-
code: string;
|
|
39
|
-
name: string;
|
|
40
|
-
country: string;
|
|
41
|
-
vatNumber?: string;
|
|
42
|
-
|
|
43
|
-
addressLine1?: string;
|
|
44
|
-
addressLine2?: string;
|
|
45
|
-
addressLine3?: string;
|
|
46
|
-
postcode?: string;
|
|
47
|
-
city?: string;
|
|
48
|
-
|
|
49
|
-
email?: string;
|
|
50
|
-
phone?: string;
|
|
51
|
-
fax?: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type FinanceDocumentEvent = {
|
|
56
|
-
id: string;
|
|
57
|
-
actionAt: string;
|
|
58
|
-
userId: string;
|
|
59
|
-
tenantId: string;
|
|
60
|
-
type: 'Sale Finance' | 'Purchase Finance';
|
|
61
|
-
subtype: string; // Invoice, Credit Note, etc.
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export type FinanceBookingEvent = {
|
|
65
|
-
id: string;
|
|
66
|
-
branchId: string;
|
|
67
|
-
actionAt: string;
|
|
68
|
-
userId: string;
|
|
69
|
-
tenantId: string;
|
|
70
|
-
type: 'Sale Finance' | 'Purchase Finance';
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export type FinanceBooking = {
|
|
74
|
-
branchId: string; // same tenantId can have different companies
|
|
75
|
-
bookingNumber: string; // same booking number can and will exist across different "branches"
|
|
76
|
-
documentId: string;
|
|
77
|
-
|
|
78
|
-
booked: true;
|
|
79
|
-
journal?: string;
|
|
80
|
-
amount?: string;
|
|
81
|
-
reportingPeriod?: number;
|
|
82
|
-
reportingYear?: number;
|
|
83
|
-
paid: boolean;
|
|
84
|
-
|
|
85
|
-
createdAt: string;
|
|
86
|
-
createdBy: string;
|
|
87
|
-
modifiedAt: string;
|
|
88
|
-
modifiedBy: string;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export type SearchDocumentVehicleRef = {
|
|
92
|
-
id: string;
|
|
93
|
-
stockNumber: string;
|
|
94
|
-
administrativeNumber?: string;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export type SearchFinanceDocument = {
|
|
98
|
-
org?: Organization;
|
|
99
|
-
doc: FinanceDocument;
|
|
100
|
-
booking?: FinanceBooking;
|
|
101
|
-
vehicle?: SearchDocumentVehicleRef[];
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export type InputSearchFinanceDocument = SearchFinanceDocument & {
|
|
105
|
-
permissions: SearchPermissions;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export type DocsSearchDefinitions = {
|
|
109
|
-
searchFinanceDoc: PublicSearchDefinition;
|
|
110
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { LocationValue, PhoneNumberValue } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
-
import { PublicSearchDefinition } from './definitions';
|
|
3
|
-
import { AggregationRequest } from './search';
|
|
4
|
-
import { Vehicle } from './vehicles';
|
|
5
|
-
|
|
6
|
-
export type InternetVehicleInternalInfo = {
|
|
7
|
-
createdAt: string;
|
|
8
|
-
updatedAt: string;
|
|
9
|
-
description: {
|
|
10
|
-
title: string;
|
|
11
|
-
remarks?: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type InternetVehiclePublicSearchDefinitions = {
|
|
16
|
-
searchInternetVehicle: PublicSearchDefinition;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type InternetVehicleSellerType = 'Dealer' | 'Private';
|
|
20
|
-
|
|
21
|
-
export type PriceChange = {
|
|
22
|
-
price: string | undefined;
|
|
23
|
-
priceAt: string;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type InternetVehiclePortal = {
|
|
27
|
-
name: string;
|
|
28
|
-
originalUrl: string;
|
|
29
|
-
pingedAt: string;
|
|
30
|
-
available: boolean;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type InternetVehicleSeller = {
|
|
34
|
-
id: string;
|
|
35
|
-
name?: string;
|
|
36
|
-
address: LocationValue;
|
|
37
|
-
type?: InternetVehicleSellerType;
|
|
38
|
-
gps?: {
|
|
39
|
-
lat: number;
|
|
40
|
-
lon: number;
|
|
41
|
-
};
|
|
42
|
-
phones: PhoneNumberValue[];
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type InternetVehicle = Vehicle<InternetVehicleInternalInfo>;
|
|
46
|
-
|
|
47
|
-
export type SearchInternetVehicle = {
|
|
48
|
-
vehicle: InternetVehicle;
|
|
49
|
-
seller: InternetVehicleSeller;
|
|
50
|
-
alternativeIds: string[];
|
|
51
|
-
priceEvolution: PriceChange[];
|
|
52
|
-
portal: InternetVehiclePortal;
|
|
53
|
-
custom: {
|
|
54
|
-
features: string[];
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export type AnalysisResponse = {
|
|
59
|
-
[sellerId: string]: { x: string; y: number }[];
|
|
60
|
-
all: { x: string; y: number }[];
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export type AnalysisRequest = AggregationRequest & {
|
|
64
|
-
sellerIds: string[];
|
|
65
|
-
range: '1M' | '3M' | '6M' | '1y';
|
|
66
|
-
granularity: '1w' | '1M';
|
|
67
|
-
};
|
package/src/types/leads.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PhoneNumberRawValue,
|
|
3
|
-
PhoneNumberValue,
|
|
4
|
-
SearchPermissions,
|
|
5
|
-
} from '@bisondesk/commons-sdk/lib/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
|
-
};
|