@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,496 +0,0 @@
1
- import { Document } from '@bisondesk/commons-sdk/lib/types';
2
- import { OpportunityType } from '../constants';
3
- import { Contact, Organization } from './crm';
4
- import { Interest } from './leads';
5
- import { Payment } from './payments';
6
- import { LeasingQuote, QuoteStatus } from './quotes';
7
- import { DataRecord, ReferenceData } from './utils';
8
- import { Vehicle } from './vehicles';
9
-
10
- export enum OpportunityActions {
11
- CREATE_QUOTE = 'create_quote',
12
- LOSE = 'lose',
13
- REOPEN = 'reopen',
14
- START_PREPARATION = 'start_preparation',
15
- REVERT_PREPARATION = 'revert_preparation',
16
- START_DELIVERY = 'start_delivery',
17
- REVERT_DELIVERY = 'revert_delivery',
18
- SET_CUSTOMER = 'set_customer',
19
- SET_DOCUMENTS = 'set_documents',
20
- SET_INTEREST = 'set_interest',
21
- SET_METADATA = 'set_metadata',
22
- SET_VEHICLE = 'set_vehicle',
23
- ADD_ACTIVITY = 'add_activity',
24
- ADD_PAYMENT = 'add_payment',
25
- SWITCH_VEHICLE = 'switch_vehicle',
26
- }
27
-
28
- export enum OpportunityDealStatus {
29
- SALES_AGREED = 'sales_agreed',
30
- FIRST_PAYMENT = 'first_payment',
31
- FULL_PAYMENT = 'full_payment',
32
- }
33
-
34
- export enum OpportunityStatus {
35
- PROSPECTION = 'prospection',
36
- DISCOVERY = 'discovery',
37
- EVALUATION = 'evaluation',
38
- REVIEW = 'review',
39
- PREPARATION = 'preparation',
40
- DELIVERY = 'delivery',
41
- }
42
-
43
- export const OpportunityStatusOrder: OpportunityStatus[] = [
44
- OpportunityStatus.PROSPECTION,
45
- OpportunityStatus.DISCOVERY,
46
- OpportunityStatus.EVALUATION,
47
- OpportunityStatus.REVIEW,
48
- OpportunityStatus.PREPARATION,
49
- OpportunityStatus.DELIVERY,
50
- ];
51
-
52
- export enum OpportunityLogisticStatus {
53
- AT_ORIGIN = 'at_origin',
54
- DELIVERED = 'delivered',
55
- }
56
- export const OpportunityWonColumnId = 'closed_won';
57
-
58
- export const OpportunityKanbanColumns = [...OpportunityStatusOrder, OpportunityWonColumnId];
59
-
60
- export const OpportunityKanbanEndColumns: string[] = [OpportunityWonColumnId];
61
-
62
- export enum OpportunityLostReasonValues {
63
- Expensive = 'expensive',
64
- AlreadySold = 'already_sold',
65
- BadExperience = 'bad_experience',
66
- IncorrectVehicleCondition = 'incorrect_vehicle_condition',
67
- NoStock = 'not_enough_stock',
68
- SlowDelivery = 'slow_delivery',
69
- HighDeposit = 'deposit_too_high',
70
- NoAnswer = 'client_not_answered',
71
- }
72
-
73
- type BaseBid = {
74
- vehicleId: string;
75
- opportunityId?: string;
76
- contactId: string;
77
- amount: string;
78
- };
79
-
80
- export type NewBid = BaseBid & {};
81
-
82
- export type Bid = BaseBid & {
83
- id: string;
84
- createdAt: string;
85
- createdBy: string;
86
- };
87
-
88
- type BaseOpportunity = {
89
- accountManager?: string;
90
- administrativePerson?: string;
91
- type: OpportunityType;
92
- organizationId?: string;
93
- contactId?: string;
94
- vehicleId?: string;
95
- source?: string; // e.g. website, autoscout, mobile...
96
- branch: string;
97
- inquiry?: string;
98
- branchCountry: string;
99
- };
100
-
101
- export type NewOpportunity = BaseOpportunity & {
102
- id?: undefined;
103
- createdAt?: undefined;
104
- createdBy?: undefined;
105
- modifiedAt?: undefined;
106
- modifiedBy?: undefined;
107
- };
108
-
109
- export type Opportunity = BaseOpportunity & {
110
- id: string;
111
- createdAt: string;
112
- createdBy: string;
113
- modifiedAt: string;
114
- modifiedBy: string;
115
- validatedAt?: string;
116
- validatedBy?: string;
117
- acceptedAt?: string;
118
- acceptedBy?: string;
119
- lastActivityAt?: string; // last time we reached out to the customer, regardless of medium
120
- reviewedAt?: string;
121
- reviewedBy?: string;
122
- preparedAt?: string;
123
- preparedBy?: string;
124
- lostAt?: string;
125
- lostBy?: string;
126
- wonAt?: string;
127
- lostReason?: OpportunityLostReasonValues;
128
- deliveredAt?: string;
129
- deliveredBy?: string;
130
- status: OpportunityStatus;
131
- dealStatus?: OpportunityDealStatus;
132
- logisticStatus?: OpportunityLogisticStatus;
133
- activeQuoteId?: string;
134
- contractId?: string;
135
- amount?: string;
136
- interest?: Interest;
137
- documents?: Document[];
138
- leasingContractId?: string;
139
- };
140
-
141
- export type OpportunityUpdate = {
142
- vehicleId?: string | null;
143
- accountManager?: string | null;
144
- administrativePerson?: string | null;
145
- contactId?: string | null;
146
- activeQuoteId?: string | null;
147
- interest?: Interest | null;
148
- reviewed?: boolean;
149
- prepared?: boolean;
150
- lost?: boolean;
151
- lostReason?: OpportunityLostReasonValues;
152
- documents?: Document[];
153
- branch?: string;
154
- branchCountry?: string;
155
- type?: OpportunityType;
156
- lastActivityAt?: string | null; // null gives the possibility to delete this field if all activities are deleted
157
- source?: string | null;
158
- };
159
-
160
- export type PaymentSummary = {
161
- total: string;
162
- paid: string;
163
- entries: DataRecord<Payment>[];
164
- };
165
-
166
- export type OpportunityBFF = {
167
- related: {
168
- sameVehicleOpenOpportunities?: number;
169
- };
170
- opportunity: DataRecord<Opportunity, ReferenceData>;
171
- vehicle?: DataRecord<Vehicle>;
172
- bids: DataRecord<Bid>[];
173
- quotes: DataRecord<LeasingQuote>[];
174
- activeQuote?: DataRecord<LeasingQuote>;
175
- payments: PaymentSummary | undefined;
176
- customer?: {
177
- contact: DataRecord<Contact>;
178
- org?: DataRecord<Organization>;
179
- };
180
- };
181
-
182
- export type OpportunityEvent = {
183
- opportunity: Opportunity;
184
- action: 'create' | 'update' | 'delete';
185
- actionAt: string;
186
- userId: string;
187
- tenantId: string;
188
- };
189
-
190
- export type QuoteEvent = {
191
- quote: LeasingQuote;
192
- opportunity: Opportunity;
193
- action: 'create' | 'update' | 'delete';
194
- actionAt: string;
195
- userId: string;
196
- tenantId: string;
197
- };
198
-
199
- /* Quote summary with information that should be common to different types of quotes */
200
- export type QuoteInfo = {
201
- status: QuoteStatus;
202
- roi: string;
203
- id: string;
204
- };
205
-
206
- export type SearchOpportunity = {
207
- contact?: Contact;
208
- opportunity: Opportunity;
209
- org?: Organization;
210
- vehicle?: Vehicle;
211
- quote?: QuoteInfo;
212
- custom: {
213
- unassigned: boolean;
214
- assignees: string[];
215
- };
216
- };
217
-
218
- export const QUOTE_CREATED_NOTIFICATION_ORIGIN = 'quote-created';
219
- export const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validator-feedback';
220
- export const QUOTE_CUSTOMER_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-customer-feedback';
221
- export const OPPORTUNITY_CLOSED_NOTIFICATION_ORIGIN = 'opportunity-closed';
222
-
223
- export type OpportunityNotificationData = {
224
- quoteVersion?: number;
225
- };
226
-
227
- export type LeasingQuoteTemplateData = {
228
- opportunity: {
229
- id: string;
230
- };
231
- currentDate: string;
232
- vehicle: {
233
- make: string;
234
- model: string;
235
- type?: string;
236
- km: string | number;
237
- vin: string;
238
- mainImage: string;
239
- localLicensePlate: boolean;
240
- description: string;
241
- year?: string | number;
242
- };
243
- accountManager: {
244
- fullName: string;
245
- email: string;
246
- phone: string;
247
- };
248
- customer: {
249
- company: string;
250
- fullName: string;
251
- vatNumber?: string;
252
- address?: string;
253
- };
254
- settingId: string;
255
- leasing: {
256
- deposit: string;
257
- startupFee: string;
258
- totalExtras: string;
259
- totalBeforeDeliveryExclVat: string;
260
- totalBeforeDelivery: string;
261
- installment: string;
262
- duration: number;
263
- monthlyInsurance: string;
264
- monthlyTax: string;
265
- monthlyTaxesInsurance: string;
266
- residual: string;
267
- offerNumber: string;
268
- extras: { name: string }[];
269
- };
270
- };
271
-
272
- export type LeasingProformaTemplateData = {
273
- opportunity: {
274
- id: string;
275
- offerNumber: string;
276
- };
277
- currentDate: string;
278
- accountManager: {
279
- fullName: string;
280
- email: string;
281
- phone: string;
282
- };
283
- vehicle: {
284
- line1: string;
285
- line2: string;
286
- stockNumber: string;
287
- };
288
- c: {
289
- organizationId?: string;
290
- clientNumber: number;
291
- company: string;
292
- fullName: string;
293
- vatNumber?: string;
294
- email?: string;
295
- phone?: string;
296
- address?: string;
297
- };
298
- i: {
299
- description: string;
300
- vat: string;
301
- quantity: number;
302
- unitPriceExclVat: string;
303
- amount: string;
304
- amountExclVat: string;
305
- }[];
306
- t: {
307
- totalExclVat: string;
308
- vatAmount: string;
309
- displayVatMessage: boolean;
310
- total: string;
311
- monthly: string;
312
- monthlyExclVat: string;
313
- residual: string;
314
- residualExclVat: string;
315
- duration: number;
316
- };
317
- };
318
-
319
- export type OpportunitiesKanbanColumn = {
320
- status: string;
321
- results: SearchOpportunity[];
322
- totalCount: number;
323
- totalValue: string;
324
- };
325
-
326
- export type HpLeasingDealRequest = {
327
- tenantId: string;
328
- initiatedBy: 'bisondesk';
329
- processMetaId: string;
330
- processRunData: {
331
- entityOwner: string;
332
- leasingContractOwner: string;
333
- foreseenDeliveryDate?: string;
334
- deliveryAddressLeasing?: string;
335
- nameSalesPerson: string;
336
- durationLeasingInMonths: number;
337
- vanCourier: boolean;
338
- newVehicle?: boolean;
339
- newTrailer?: boolean;
340
- registrationOnTtcoBe?: string;
341
- yearOfConstruction?: number;
342
- chassisnumber?: string;
343
- vehicleModel?: string;
344
- vehicleCategory2?: string;
345
- licencePlate?: string;
346
- vatPercentage?: number;
347
-
348
- opportunityContractId: string;
349
- opportunityId: string;
350
-
351
- company?: string;
352
- customerNumber?: number; //bisondesk external id
353
- //MrLease fields
354
- vehicle?: string;
355
- salesPriceEur: string;
356
- depositFullAmountExclVat: string;
357
- depositToBePrepaidExclVat: string;
358
- vehicleMake3?: string;
359
-
360
- //TTC fields
361
- vehicleOriginalReference?: string;
362
- salesPrice: string;
363
- depositFullAmount: string;
364
- depositAmountToBePrepaid: string;
365
- make?: string;
366
-
367
- //Extras
368
- garageExtrasCodes: string[];
369
- allExtrasDescriptions: string[];
370
- administrationExtrasCodes: string[];
371
- logisticExtrasCodes: string[];
372
- customRequestDescriptions: string[];
373
- };
374
- };
375
-
376
- export type HpLeasingDealResponse = {
377
- entityId: string;
378
- id: string;
379
- status: string;
380
- leasingContractNumber?: string;
381
- };
382
-
383
- export type HpLeasingContractRequest = {
384
- tenantId: string;
385
- initiatedBy: 'bisondesk';
386
- processMetaId: string;
387
- processRunData: {
388
- entityOwner: string;
389
- company?: string;
390
- vehicle?: string;
391
- ldNumber: number;
392
- vanCourier: boolean;
393
- startDate: number;
394
- opportunityContractId: string;
395
- data: {
396
- leasingParameter: {
397
- allRisksPercentage: number;
398
- allRisksTaxPercentage: number;
399
- civilLiability: number;
400
- entityId: string;
401
- oneTimeRoadTax: number;
402
- specialInsurance: number;
403
- yearlyRoadTax: number;
404
- countries: string[];
405
- vehicleCategory: string;
406
- };
407
-
408
- calculatorRequest: {
409
- bankDeposit: number;
410
- bankDurationInMonths: number;
411
- bankInterestRatePercentage: number;
412
- bankResidualValue: number;
413
- deposit: number;
414
- durationInMonths: number;
415
- includesAllRisks: boolean;
416
- includesCivilLiability: boolean;
417
- includesOneTimeRoadTax: boolean;
418
- includesSpecialInsurance: boolean;
419
- includesYearlyRoadTax: boolean;
420
- insuranceAmount: number;
421
- interestRatePercentage: number;
422
- marginPercentage: number;
423
- monthlyAdministrationFee: 0;
424
- purchasePrice: number;
425
- residualValue: number;
426
- salesPrice: number;
427
- startupFeePercentage: number;
428
- };
429
-
430
- calculatorResponse: {
431
- ROI: number;
432
- ROIDifference: number;
433
- ROIPerYear: number;
434
- ROITarget: number;
435
- allRisksInsuranceAmount: number;
436
- bankContractValue: number;
437
- bankLeasingAmount: number;
438
- cashDeficit: number;
439
- financingAmount: number;
440
- leasingAmount: number;
441
- leasingContractValue: number;
442
- leasingProfit: number;
443
- monthlyTaxRetailPrice: number;
444
- oneTimeTaxCost: number;
445
- totalMonthlyPayment: number;
446
- totalProfit: number;
447
- vehicleProfit: number;
448
- };
449
-
450
- cashInValues: CashInRow[];
451
-
452
- cashOutValues: CashOutRow[];
453
- };
454
- };
455
- };
456
-
457
- export type HpLeasingContractResponse = {
458
- entityId: string;
459
- id: string;
460
- status: string;
461
- createdAt: string;
462
- updatedAt: string;
463
- dateOfFinalSettlement: string;
464
- startDate: string;
465
- email: string;
466
- contractNumber: string;
467
- };
468
-
469
- export type CashInRow = {
470
- time: number;
471
- deposit: number;
472
- monthlyAdministrationFee: 0; //Legacy field - Should always be 0
473
- residualValue: number;
474
- startupFee: number;
475
- leasingAmountWithoutAdminFee: number;
476
- insurancePayment: number;
477
- taxPayment: number;
478
- cashIn: number;
479
- cumulativeCash: number;
480
- };
481
-
482
- export type CashOutRow = {
483
- time: number;
484
- deposit: number;
485
- residualValue: number;
486
- leasingAmount: number;
487
- insurancePayment: number;
488
- taxPayment: number;
489
- cashOut: number;
490
- cumulativeCash: number;
491
- };
492
-
493
- export type SwitchOpportunityVehicleRequest = {
494
- opportunityId: string;
495
- newVehicleId: string;
496
- };
@@ -1,40 +0,0 @@
1
- export enum PaymentActions {
2
- DELETE = 'delete',
3
- EDIT = 'edit',
4
- }
5
-
6
- type BasePayment = {
7
- opportunityId: string;
8
- amount: string;
9
- description?: string;
10
- vehicleId: string;
11
- organizationId: string;
12
- };
13
-
14
- export type NewPayment = BasePayment & {
15
- id?: undefined;
16
- createdAt?: undefined;
17
- createdBy?: undefined;
18
- modifiedAt?: undefined;
19
- modifiedBy?: undefined;
20
- deletedAt?: undefined;
21
- deletedBy?: undefined;
22
- paidAt: string;
23
- };
24
-
25
- export type Payment = BasePayment & {
26
- id: string;
27
- createdAt: string;
28
- createdBy: string;
29
- modifiedAt: string;
30
- modifiedBy: string;
31
- deletedAt?: string;
32
- deletedBy?: string;
33
- paidAt?: string;
34
- };
35
-
36
- export type PaymentUpdate = {
37
- description?: string;
38
- amount?: string;
39
- paidAt?: string;
40
- };
@@ -1,186 +0,0 @@
1
- import { AttachmentValue } from '@bisondesk/commons-sdk/lib/types';
2
- import { OpportunityType } from '../constants';
3
- import {
4
- CustomLeasingQuoteExtraInput,
5
- LeasingDeliveryPackageInput,
6
- LeasingQuoteExtraInput,
7
- } from './leasing-settings';
8
- import { PricePercentageMode } from './utils';
9
-
10
- export enum QuoteActions {
11
- ACCEPT = 'accept',
12
- VALIDATE = 'validate',
13
- DONWLOAD_PDFS = 'download-pdfs',
14
- CANCEL = 'cancel',
15
- }
16
-
17
- export enum QuoteStatus {
18
- CREATED = 'created',
19
- VALIDATED = 'validated',
20
- INVALIDATED = 'invalidated',
21
- ACCEPTED = 'accepted',
22
- REJECTED = 'rejected',
23
- CANCELLED = 'cancelled',
24
- }
25
-
26
- export enum LeasingQuoteMetricsScore {
27
- DANGER = 'danger',
28
- NEUTRAL = 'neutral',
29
- GOOD = 'good',
30
- }
31
-
32
- type BaseLeasingCalculatorInput = {
33
- branch: string;
34
- branchCountry: string;
35
- customerCountry: string;
36
- vehicleCategory: string;
37
- };
38
-
39
- export type LeasingCalculatorDefaultInput = BaseLeasingCalculatorInput & {
40
- salesPrice: string;
41
- purchasePrice: string;
42
- deliveryPackage?: LeasingQuoteExtraInput;
43
- extras?: LeasingQuoteExtraInput[];
44
- customRequests?: CustomLeasingQuoteExtraInput[];
45
- };
46
-
47
- export type LeasingCalculatorInput = BaseLeasingCalculatorInput & {
48
- localLicensePlate: boolean;
49
- vanCourier: boolean;
50
- leasing: {
51
- salesPrice: string;
52
- deposit: string;
53
- depositMode: PricePercentageMode;
54
- depositPercentage: string;
55
- residual: string;
56
- residualMode: PricePercentageMode;
57
- residualPercentage: string;
58
- startupFee: string;
59
- startupFeeMode: PricePercentageMode;
60
- startupFeePercentage: string;
61
- interestRate: string;
62
- purchasePrice: string;
63
- duration: number;
64
- };
65
- bank: {
66
- interestRate: string;
67
- deposit: string;
68
- depositMode: PricePercentageMode;
69
- depositPercentage: string;
70
- residual: string;
71
- residualMode: PricePercentageMode;
72
- residualPercentage: string;
73
- duration: number;
74
- salesPrice: string;
75
- };
76
- taxes: {
77
- yearlyRoadTax: boolean;
78
- oneTimeRoadTax: boolean;
79
- margin: string; //Non Editable, copies the value insurance > margin
80
- };
81
- insurance: {
82
- margin: string;
83
- civilLiabilities: boolean;
84
- allRisks: boolean;
85
- specialTechnicalInsurance: boolean;
86
- roadAssistance: boolean;
87
- };
88
- deliveryPackage?: LeasingDeliveryPackageInput;
89
- extras: LeasingQuoteExtraInput[];
90
- customRequests: CustomLeasingQuoteExtraInput[];
91
- };
92
-
93
- export type LeasingCalculatorOutput = {
94
- vatApplicable: boolean;
95
- installment: string;
96
- installmentPrintable: string;
97
- totalMonthlyAmount: string;
98
- monthlyTaxesInsurance: string;
99
- beforeDelivery: string;
100
- financingAmount: string;
101
- settingId: string;
102
- totalRetailAmount: string;
103
- finalSalesPrice: string;
104
- roi: {
105
- value: string;
106
- target: string;
107
- perYear: string;
108
- difference: string;
109
- score: LeasingQuoteMetricsScore;
110
- };
111
- cashflow: {
112
- deficit: string;
113
- balanced: boolean;
114
- score: LeasingQuoteMetricsScore;
115
- };
116
- profitability: {
117
- leasing: string;
118
- vehicle: string;
119
- total: string;
120
- score: LeasingQuoteMetricsScore;
121
- };
122
- taxes: {
123
- yearlyRetailPrice: string;
124
- monthlyRetailPrice: string;
125
- yearlyRoadTax: string;
126
- oneTimeRoadTax: string;
127
- };
128
- insurance: {
129
- yearlyRetailPrice: string;
130
- monthlyRetailPrice: string;
131
- civilLiabilities: string;
132
- allRisks: string;
133
- specialTechnicalInsurance: string;
134
- roadAssistance: string;
135
- };
136
- costs: {
137
- financingAmount: string;
138
- finalCostPrice: string;
139
- monhtly: string;
140
- trackAndTrace: string;
141
- };
142
- };
143
-
144
- type BaseLeasingQuote = {
145
- opportunityId: string;
146
- calculatorInput: LeasingCalculatorInput;
147
- calculatorOutput: LeasingCalculatorOutput;
148
- type: OpportunityType;
149
- preferredLanguage: string;
150
- };
151
-
152
- export type NewLeasingQuote = BaseLeasingQuote & {
153
- id?: undefined;
154
- createdAt?: undefined;
155
- createdBy?: undefined;
156
- modifiedAt?: undefined;
157
- modifiedBy?: undefined;
158
- active: true;
159
- };
160
-
161
- export type LeasingQuote = BaseLeasingQuote & {
162
- id: string;
163
- createdAt: string;
164
- createdBy: string;
165
- modifiedAt: string;
166
- modifiedBy: string;
167
- validationBy?: string;
168
- validationAt?: string;
169
- cancelledBy?: string;
170
- cancelledAt?: string;
171
- customerFeedbackAt?: string;
172
- customerFeedbackBy?: string;
173
- version: number;
174
- status: QuoteStatus;
175
- proformaPdf?: AttachmentValue;
176
- quotePdf?: AttachmentValue;
177
- active: boolean;
178
- contactId: string;
179
- vehicleId: string;
180
- organizationId: string;
181
- };
182
-
183
- export type QuoteUpdate = {
184
- status?: QuoteStatus;
185
- active?: boolean;
186
- };