@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.
Files changed (225) hide show
  1. package/lib/constants.d.ts +0 -77
  2. package/lib/constants.d.ts.map +1 -1
  3. package/lib/constants.js +1 -924
  4. package/lib/constants.js.map +1 -1
  5. package/lib/types/crm.d.ts +30 -103
  6. package/lib/types/crm.d.ts.map +1 -1
  7. package/lib/types/crm.js +0 -16
  8. package/lib/types/crm.js.map +1 -1
  9. package/lib/types/definitions.d.ts +13 -15
  10. package/lib/types/definitions.d.ts.map +1 -1
  11. package/lib/types/fields.d.ts +25 -26
  12. package/lib/types/fields.d.ts.map +1 -1
  13. package/lib/types/fields.js +0 -4
  14. package/lib/types/fields.js.map +1 -1
  15. package/lib/types/interests.d.ts +25 -0
  16. package/lib/types/interests.d.ts.map +1 -0
  17. package/lib/types/{settings.js → interests.js} +1 -1
  18. package/lib/types/interests.js.map +1 -0
  19. package/lib/types/picklists.d.ts +4 -15
  20. package/lib/types/picklists.d.ts.map +1 -1
  21. package/lib/types/search.d.ts +4 -26
  22. package/lib/types/search.d.ts.map +1 -1
  23. package/lib/types/search.js.map +1 -1
  24. package/lib/types/storage.d.ts +11 -1
  25. package/lib/types/storage.d.ts.map +1 -1
  26. package/lib/types/storage.js +0 -15
  27. package/lib/types/storage.js.map +1 -1
  28. package/lib/types/tenants.d.ts +9 -32
  29. package/lib/types/tenants.d.ts.map +1 -1
  30. package/lib/types/tenants.js +0 -11
  31. package/lib/types/tenants.js.map +1 -1
  32. package/lib/types/users.d.ts +3 -11
  33. package/lib/types/users.d.ts.map +1 -1
  34. package/lib/types/utils.d.ts +0 -20
  35. package/lib/types/utils.d.ts.map +1 -1
  36. package/lib/types/utils.js +0 -6
  37. package/lib/types/utils.js.map +1 -1
  38. package/lib/types/vehicles.d.ts +92 -406
  39. package/lib/types/vehicles.d.ts.map +1 -1
  40. package/lib/types/vehicles.js +1 -54
  41. package/lib/types/vehicles.js.map +1 -1
  42. package/package.json +6 -8
  43. package/src/constants.ts +1 -930
  44. package/src/types/crm.ts +30 -118
  45. package/src/types/definitions.ts +12 -19
  46. package/src/types/fields.ts +31 -72
  47. package/src/types/interests.ts +24 -0
  48. package/src/types/picklists.ts +7 -26
  49. package/src/types/search.ts +4 -34
  50. package/src/types/storage.ts +12 -1
  51. package/src/types/tenants.ts +11 -37
  52. package/src/types/users.ts +3 -17
  53. package/src/types/utils.ts +0 -25
  54. package/src/types/vehicles.ts +93 -461
  55. package/tsconfig.tsbuildinfo +2995 -1
  56. package/lib/apis/crm.d.ts +0 -39
  57. package/lib/apis/crm.d.ts.map +0 -1
  58. package/lib/apis/crm.js +0 -201
  59. package/lib/apis/crm.js.map +0 -1
  60. package/lib/apis/documents.d.ts +0 -4
  61. package/lib/apis/documents.d.ts.map +0 -1
  62. package/lib/apis/documents.js +0 -47
  63. package/lib/apis/documents.js.map +0 -1
  64. package/lib/apis/internet-vehicles.d.ts +0 -3
  65. package/lib/apis/internet-vehicles.d.ts.map +0 -1
  66. package/lib/apis/internet-vehicles.js +0 -27
  67. package/lib/apis/internet-vehicles.js.map +0 -1
  68. package/lib/apis/leasing-administration.d.ts +0 -8
  69. package/lib/apis/leasing-administration.d.ts.map +0 -1
  70. package/lib/apis/leasing-administration.js +0 -49
  71. package/lib/apis/leasing-administration.js.map +0 -1
  72. package/lib/apis/leasing.d.ts +0 -19
  73. package/lib/apis/leasing.d.ts.map +0 -1
  74. package/lib/apis/leasing.js +0 -168
  75. package/lib/apis/leasing.js.map +0 -1
  76. package/lib/apis/opportunities.d.ts +0 -9
  77. package/lib/apis/opportunities.d.ts.map +0 -1
  78. package/lib/apis/opportunities.js +0 -94
  79. package/lib/apis/opportunities.js.map +0 -1
  80. package/lib/apis/picklists.d.ts +0 -5
  81. package/lib/apis/picklists.d.ts.map +0 -1
  82. package/lib/apis/picklists.js +0 -44
  83. package/lib/apis/picklists.js.map +0 -1
  84. package/lib/apis/tenants.d.ts +0 -7
  85. package/lib/apis/tenants.d.ts.map +0 -1
  86. package/lib/apis/tenants.js +0 -80
  87. package/lib/apis/tenants.js.map +0 -1
  88. package/lib/apis/users.d.ts +0 -3
  89. package/lib/apis/users.d.ts.map +0 -1
  90. package/lib/apis/users.js +0 -26
  91. package/lib/apis/users.js.map +0 -1
  92. package/lib/apis/utils.d.ts +0 -9
  93. package/lib/apis/utils.d.ts.map +0 -1
  94. package/lib/apis/utils.js +0 -23
  95. package/lib/apis/utils.js.map +0 -1
  96. package/lib/apis/vehicles.d.ts +0 -18
  97. package/lib/apis/vehicles.d.ts.map +0 -1
  98. package/lib/apis/vehicles.js +0 -159
  99. package/lib/apis/vehicles.js.map +0 -1
  100. package/lib/ddb-entities.d.ts +0 -2
  101. package/lib/ddb-entities.d.ts.map +0 -1
  102. package/lib/ddb-entities.js +0 -5
  103. package/lib/ddb-entities.js.map +0 -1
  104. package/lib/types/activities.d.ts +0 -38
  105. package/lib/types/activities.d.ts.map +0 -1
  106. package/lib/types/activities.js +0 -16
  107. package/lib/types/activities.js.map +0 -1
  108. package/lib/types/documents.d.ts +0 -105
  109. package/lib/types/documents.d.ts.map +0 -1
  110. package/lib/types/documents.js +0 -3
  111. package/lib/types/documents.js.map +0 -1
  112. package/lib/types/internet-vehicles.d.ts +0 -64
  113. package/lib/types/internet-vehicles.d.ts.map +0 -1
  114. package/lib/types/internet-vehicles.js +0 -3
  115. package/lib/types/internet-vehicles.js.map +0 -1
  116. package/lib/types/leads.d.ts +0 -134
  117. package/lib/types/leads.d.ts.map +0 -1
  118. package/lib/types/leads.js +0 -3
  119. package/lib/types/leads.js.map +0 -1
  120. package/lib/types/leasing-administration.d.ts +0 -107
  121. package/lib/types/leasing-administration.d.ts.map +0 -1
  122. package/lib/types/leasing-administration.js +0 -3
  123. package/lib/types/leasing-administration.js.map +0 -1
  124. package/lib/types/leasing-search.d.ts +0 -22
  125. package/lib/types/leasing-search.d.ts.map +0 -1
  126. package/lib/types/leasing-search.js +0 -3
  127. package/lib/types/leasing-search.js.map +0 -1
  128. package/lib/types/leasing-settings.d.ts +0 -113
  129. package/lib/types/leasing-settings.d.ts.map +0 -1
  130. package/lib/types/leasing-settings.js +0 -10
  131. package/lib/types/leasing-settings.js.map +0 -1
  132. package/lib/types/leasing.d.ts +0 -322
  133. package/lib/types/leasing.d.ts.map +0 -1
  134. package/lib/types/leasing.js +0 -24
  135. package/lib/types/leasing.js.map +0 -1
  136. package/lib/types/machines.d.ts +0 -38
  137. package/lib/types/machines.d.ts.map +0 -1
  138. package/lib/types/machines.js +0 -3
  139. package/lib/types/machines.js.map +0 -1
  140. package/lib/types/opportunities.d.ts +0 -448
  141. package/lib/types/opportunities.d.ts.map +0 -1
  142. package/lib/types/opportunities.js +0 -68
  143. package/lib/types/opportunities.js.map +0 -1
  144. package/lib/types/payments.d.ts +0 -38
  145. package/lib/types/payments.d.ts.map +0 -1
  146. package/lib/types/payments.js +0 -9
  147. package/lib/types/payments.js.map +0 -1
  148. package/lib/types/quotes.d.ts +0 -173
  149. package/lib/types/quotes.d.ts.map +0 -1
  150. package/lib/types/quotes.js +0 -26
  151. package/lib/types/quotes.js.map +0 -1
  152. package/lib/types/recently-viewed.d.ts +0 -33
  153. package/lib/types/recently-viewed.d.ts.map +0 -1
  154. package/lib/types/recently-viewed.js +0 -3
  155. package/lib/types/recently-viewed.js.map +0 -1
  156. package/lib/types/saved-filters.d.ts +0 -20
  157. package/lib/types/saved-filters.d.ts.map +0 -1
  158. package/lib/types/saved-filters.js +0 -3
  159. package/lib/types/saved-filters.js.map +0 -1
  160. package/lib/types/settings.d.ts +0 -50
  161. package/lib/types/settings.d.ts.map +0 -1
  162. package/lib/types/settings.js.map +0 -1
  163. package/lib/types/templates.d.ts +0 -35
  164. package/lib/types/templates.d.ts.map +0 -1
  165. package/lib/types/templates.js +0 -9
  166. package/lib/types/templates.js.map +0 -1
  167. package/lib/types/website.d.ts +0 -24
  168. package/lib/types/website.d.ts.map +0 -1
  169. package/lib/types/website.js +0 -3
  170. package/lib/types/website.js.map +0 -1
  171. package/lib/utils/forms.d.ts +0 -6
  172. package/lib/utils/forms.d.ts.map +0 -1
  173. package/lib/utils/forms.js +0 -33
  174. package/lib/utils/forms.js.map +0 -1
  175. package/lib/utils/leasing.d.ts +0 -3
  176. package/lib/utils/leasing.d.ts.map +0 -1
  177. package/lib/utils/leasing.js +0 -10
  178. package/lib/utils/leasing.js.map +0 -1
  179. package/lib/utils/slug.d.ts +0 -3
  180. package/lib/utils/slug.d.ts.map +0 -1
  181. package/lib/utils/slug.js +0 -23
  182. package/lib/utils/slug.js.map +0 -1
  183. package/lib/utils/tenants.d.ts +0 -4
  184. package/lib/utils/tenants.d.ts.map +0 -1
  185. package/lib/utils/tenants.js +0 -16
  186. package/lib/utils/tenants.js.map +0 -1
  187. package/lib/utils/vehicles.d.ts +0 -12
  188. package/lib/utils/vehicles.d.ts.map +0 -1
  189. package/lib/utils/vehicles.js +0 -73
  190. package/lib/utils/vehicles.js.map +0 -1
  191. package/src/apis/crm.ts +0 -302
  192. package/src/apis/documents.ts +0 -54
  193. package/src/apis/internet-vehicles.ts +0 -23
  194. package/src/apis/leasing-administration.ts +0 -70
  195. package/src/apis/leasing.ts +0 -257
  196. package/src/apis/opportunities.ts +0 -133
  197. package/src/apis/picklists.ts +0 -50
  198. package/src/apis/tenants.ts +0 -100
  199. package/src/apis/users.ts +0 -22
  200. package/src/apis/utils.ts +0 -23
  201. package/src/apis/vehicles.ts +0 -229
  202. package/src/ddb-entities.ts +0 -1
  203. package/src/environment.d.ts +0 -6
  204. package/src/types/activities.ts +0 -41
  205. package/src/types/documents.ts +0 -110
  206. package/src/types/internet-vehicles.ts +0 -67
  207. package/src/types/leads.ts +0 -144
  208. package/src/types/leasing-administration.ts +0 -131
  209. package/src/types/leasing-search.ts +0 -24
  210. package/src/types/leasing-settings.ts +0 -111
  211. package/src/types/leasing.ts +0 -360
  212. package/src/types/machines.ts +0 -40
  213. package/src/types/opportunities.ts +0 -496
  214. package/src/types/payments.ts +0 -40
  215. package/src/types/quotes.ts +0 -186
  216. package/src/types/recently-viewed.ts +0 -45
  217. package/src/types/saved-filters.ts +0 -21
  218. package/src/types/settings.ts +0 -51
  219. package/src/types/templates.ts +0 -40
  220. package/src/types/website.ts +0 -28
  221. package/src/utils/forms.ts +0 -32
  222. package/src/utils/leasing.ts +0 -14
  223. package/src/utils/slug.ts +0 -19
  224. package/src/utils/tenants.ts +0 -14
  225. package/src/utils/vehicles.ts +0 -92
@@ -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
- };
@@ -1 +0,0 @@
1
- export const ITEM_VIEWS_KEY = 'views';
@@ -1,6 +0,0 @@
1
- declare namespace NodeJS {
2
- interface ProcessEnv {
3
- ADMIN_KEY: string;
4
- CORE_API_ORIGIN: string;
5
- }
6
- }
@@ -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
- };
@@ -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
- };
@@ -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
- };