@bisondesk/core-sdk 1.0.441 → 1.0.443
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/apis/opportunities.d.ts +1 -0
- package/lib/apis/opportunities.d.ts.map +1 -1
- package/lib/apis/opportunities.js +12 -0
- package/lib/apis/opportunities.js.map +1 -1
- package/lib/apis/tenants.js +1 -1
- package/lib/apis/tenants.js.map +1 -1
- package/lib/apis/vehicles.js +1 -1
- package/lib/apis/vehicles.js.map +1 -1
- package/lib/types/crm.d.ts +1 -0
- package/lib/types/crm.d.ts.map +1 -1
- package/lib/types/crm.js.map +1 -1
- package/lib/types/opportunities.d.ts +13 -0
- package/lib/types/opportunities.d.ts.map +1 -1
- package/lib/types/opportunities.js.map +1 -1
- package/lib/types/user-performance.d.ts +85 -0
- package/lib/types/user-performance.d.ts.map +1 -0
- package/lib/types/user-performance.js +7 -0
- package/lib/types/user-performance.js.map +1 -0
- package/lib/types/vehicle-performance.d.ts +78 -0
- package/lib/types/vehicle-performance.d.ts.map +1 -0
- package/lib/types/vehicle-performance.js +2 -0
- package/lib/types/vehicle-performance.js.map +1 -0
- package/lib/types/vehicles.d.ts +1 -1
- package/lib/types/vehicles.d.ts.map +1 -1
- package/lib/types/vehicles.js.map +1 -1
- package/lib/utils/vehicles.js +1 -1
- package/lib/utils/vehicles.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/opportunities.ts +20 -0
- package/src/apis/tenants.ts +1 -1
- package/src/apis/vehicles.ts +1 -1
- package/src/types/crm.ts +2 -0
- package/src/types/opportunities.ts +14 -0
- package/src/types/user-performance.ts +103 -0
- package/src/types/vehicle-performance.ts +106 -0
- package/src/utils/vehicles.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { OpportunityType } from '../constants.js';
|
|
2
|
+
import { VehicleSaleDealStatus, VehicleSaleLogisticsStatus } from './opportunities.js';
|
|
3
|
+
import { VehiclePurchaseDealStatus, VehiclePurchaseLogisticsStatus } from './vehicles.js';
|
|
4
|
+
|
|
5
|
+
export type VehicleSaleOverview = {
|
|
6
|
+
opportunityId: string;
|
|
7
|
+
type: OpportunityType;
|
|
8
|
+
userId: string; // account manager of the latest opportunity (if opportunity is >= review)
|
|
9
|
+
|
|
10
|
+
// client details
|
|
11
|
+
clientId: string;
|
|
12
|
+
clientCode: number;
|
|
13
|
+
clientCountryCode: string;
|
|
14
|
+
clientVat?: string;
|
|
15
|
+
conglomerate?: boolean;
|
|
16
|
+
clientEmail?: string;
|
|
17
|
+
clientPhone?: string;
|
|
18
|
+
|
|
19
|
+
// vehicle details
|
|
20
|
+
dealStatus: VehicleSaleDealStatus;
|
|
21
|
+
logisticsStatus: VehicleSaleLogisticsStatus;
|
|
22
|
+
|
|
23
|
+
// opportunity dates
|
|
24
|
+
createdAt: string;
|
|
25
|
+
engagedAt?: string;
|
|
26
|
+
acceptedAt?: string;
|
|
27
|
+
validatedAt?: string;
|
|
28
|
+
reviewedAt?: string;
|
|
29
|
+
preparedAt?: string;
|
|
30
|
+
deliveredAt?: string;
|
|
31
|
+
wonAt?: string;
|
|
32
|
+
|
|
33
|
+
saleAt?: string; // this is the date that should be considered for the sale according to TJ (often the same as fullPaymentAt)
|
|
34
|
+
|
|
35
|
+
// money-related details
|
|
36
|
+
firstInvoiceIssuedAt?: string;
|
|
37
|
+
lastInvoiceIssuedAt?: string;
|
|
38
|
+
firstPaymentAt?: string;
|
|
39
|
+
fullPaymentAt?: string;
|
|
40
|
+
expectedAmount: string; // from quote(s)
|
|
41
|
+
actualAmount: string; // from all invoices
|
|
42
|
+
lifetimeActualAmount: string; // sum of all invoices from all opportunities for this vehicle
|
|
43
|
+
|
|
44
|
+
// is there an invoice with category related to the purchase of commercial vehicle
|
|
45
|
+
// (we probably need a way to flag those categories since it is also important for the stocklist)
|
|
46
|
+
hasMainInvoice?: boolean;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type VehiclePurchaseOverview = {
|
|
50
|
+
userId: string; // purchaser
|
|
51
|
+
|
|
52
|
+
dealStatus: VehiclePurchaseDealStatus;
|
|
53
|
+
logisticsStatus: VehiclePurchaseLogisticsStatus;
|
|
54
|
+
|
|
55
|
+
supplierId: string;
|
|
56
|
+
supplierCode: string;
|
|
57
|
+
supplierCountryCode: string;
|
|
58
|
+
supplierVat?: string;
|
|
59
|
+
conglomerate?: boolean;
|
|
60
|
+
supplierEmail?: string;
|
|
61
|
+
supplierPhone?: string;
|
|
62
|
+
|
|
63
|
+
// money-related details
|
|
64
|
+
firstInvoiceIssuedAt?: string;
|
|
65
|
+
lastInvoiceIssuedAt?: string;
|
|
66
|
+
firstPaymentAt?: string;
|
|
67
|
+
fullPaymentAt?: string;
|
|
68
|
+
expectedAmount: string;
|
|
69
|
+
actualAmount: string;
|
|
70
|
+
|
|
71
|
+
purchaseAt?: string; // this is the date that should be considered for the purchase according to TJ (often the same as fullPaymentAt)
|
|
72
|
+
|
|
73
|
+
// log
|
|
74
|
+
marketingAt?: string; // no vehicle in our parking, just digital marketing
|
|
75
|
+
evaluationAt?: string; // in consignation
|
|
76
|
+
purchaseAgreedAt?: string;
|
|
77
|
+
// firstPaymentAllowedAt?: string;
|
|
78
|
+
// firstPaymentSentAt?: string;
|
|
79
|
+
// fullPaymentAllowedAt?: string;
|
|
80
|
+
// fullPaymentSentAt?: string;
|
|
81
|
+
arrivedAt?: string;
|
|
82
|
+
checkedInAt?: string;
|
|
83
|
+
|
|
84
|
+
hasMainInvoice?: boolean;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export type VehicleProfitOverview = {
|
|
88
|
+
expectedProfit?: string;
|
|
89
|
+
expectedRoi?: string;
|
|
90
|
+
|
|
91
|
+
actualProfit?: string;
|
|
92
|
+
actualRoi?: string;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type VehicleSummary = {
|
|
96
|
+
branch: string;
|
|
97
|
+
stockNumber: string;
|
|
98
|
+
id: string;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type VehicleBusinessOverview = {
|
|
102
|
+
vehicle: VehicleSummary;
|
|
103
|
+
purchase: VehiclePurchaseOverview;
|
|
104
|
+
sale?: VehicleSaleOverview;
|
|
105
|
+
profit?: VehicleProfitOverview;
|
|
106
|
+
};
|
package/src/utils/vehicles.ts
CHANGED
|
@@ -49,7 +49,7 @@ export const getInternalTitle = ({
|
|
|
49
49
|
bodywork?: string;
|
|
50
50
|
}): string => {
|
|
51
51
|
if (category === Categories.Trailer || category === Categories.SemiTrailer) {
|
|
52
|
-
return [make, modelName, bodywork]
|
|
52
|
+
return [make, modelName, modelTypeName, bodywork]
|
|
53
53
|
.filter((v): v is string => !!v)
|
|
54
54
|
.map((v) => v.trim())
|
|
55
55
|
.join(' ')
|