@bisondesk/core-sdk 1.0.21 → 1.0.23-B
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/crm.d.ts +39 -0
- package/lib/apis/crm.d.ts.map +1 -0
- package/lib/apis/crm.js +201 -0
- package/lib/apis/crm.js.map +1 -0
- package/lib/apis/documents.d.ts +4 -0
- package/lib/apis/documents.d.ts.map +1 -0
- package/lib/apis/documents.js +47 -0
- package/lib/apis/documents.js.map +1 -0
- package/lib/apis/internet-vehicles.d.ts +3 -0
- package/lib/apis/internet-vehicles.d.ts.map +1 -0
- package/lib/apis/internet-vehicles.js +27 -0
- package/lib/apis/internet-vehicles.js.map +1 -0
- package/lib/apis/leasing-administration.d.ts +8 -0
- package/lib/apis/leasing-administration.d.ts.map +1 -0
- package/lib/apis/leasing-administration.js +49 -0
- package/lib/apis/leasing-administration.js.map +1 -0
- package/lib/apis/leasing.d.ts +19 -0
- package/lib/apis/leasing.d.ts.map +1 -0
- package/lib/apis/leasing.js +168 -0
- package/lib/apis/leasing.js.map +1 -0
- package/lib/apis/opportunities.d.ts +9 -0
- package/lib/apis/opportunities.d.ts.map +1 -0
- package/lib/apis/opportunities.js +94 -0
- package/lib/apis/opportunities.js.map +1 -0
- package/lib/apis/picklists.d.ts +5 -0
- package/lib/apis/picklists.d.ts.map +1 -0
- package/lib/apis/picklists.js +44 -0
- package/lib/apis/picklists.js.map +1 -0
- package/lib/apis/tenants.d.ts +7 -0
- package/lib/apis/tenants.d.ts.map +1 -0
- package/lib/apis/tenants.js +80 -0
- package/lib/apis/tenants.js.map +1 -0
- package/lib/apis/users.d.ts +3 -0
- package/lib/apis/users.d.ts.map +1 -0
- package/lib/apis/users.js +26 -0
- package/lib/apis/users.js.map +1 -0
- package/lib/apis/utils.d.ts +9 -0
- package/lib/apis/utils.d.ts.map +1 -0
- package/lib/apis/utils.js +23 -0
- package/lib/apis/utils.js.map +1 -0
- package/lib/apis/vehicles.d.ts +18 -0
- package/lib/apis/vehicles.d.ts.map +1 -0
- package/lib/apis/vehicles.js +159 -0
- package/lib/apis/vehicles.js.map +1 -0
- package/lib/constants.d.ts +77 -0
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +924 -1
- package/lib/constants.js.map +1 -1
- package/lib/ddb-entities.d.ts +2 -0
- package/lib/ddb-entities.d.ts.map +1 -0
- package/lib/ddb-entities.js +5 -0
- package/lib/ddb-entities.js.map +1 -0
- package/lib/types/activities.d.ts +38 -0
- package/lib/types/activities.d.ts.map +1 -0
- package/lib/types/activities.js +16 -0
- package/lib/types/activities.js.map +1 -0
- package/lib/types/crm.d.ts +103 -30
- package/lib/types/crm.d.ts.map +1 -1
- package/lib/types/crm.js +16 -0
- package/lib/types/crm.js.map +1 -1
- package/lib/types/definitions.d.ts +15 -13
- package/lib/types/definitions.d.ts.map +1 -1
- package/lib/types/documents.d.ts +105 -0
- package/lib/types/documents.d.ts.map +1 -0
- package/lib/types/{interests.js → documents.js} +1 -1
- package/lib/types/documents.js.map +1 -0
- package/lib/types/fields.d.ts +26 -25
- package/lib/types/fields.d.ts.map +1 -1
- package/lib/types/fields.js +4 -0
- package/lib/types/fields.js.map +1 -1
- package/lib/types/internet-vehicles.d.ts +64 -0
- package/lib/types/internet-vehicles.d.ts.map +1 -0
- package/lib/types/internet-vehicles.js +3 -0
- package/lib/types/internet-vehicles.js.map +1 -0
- package/lib/types/leads.d.ts +134 -0
- package/lib/types/leads.d.ts.map +1 -0
- package/lib/types/leads.js +3 -0
- package/lib/types/leads.js.map +1 -0
- package/lib/types/leasing-administration.d.ts +107 -0
- package/lib/types/leasing-administration.d.ts.map +1 -0
- package/lib/types/leasing-administration.js +3 -0
- package/lib/types/leasing-administration.js.map +1 -0
- package/lib/types/leasing-search.d.ts +22 -0
- package/lib/types/leasing-search.d.ts.map +1 -0
- package/lib/types/leasing-search.js +3 -0
- package/lib/types/leasing-search.js.map +1 -0
- package/lib/types/leasing-settings.d.ts +113 -0
- package/lib/types/leasing-settings.d.ts.map +1 -0
- package/lib/types/leasing-settings.js +10 -0
- package/lib/types/leasing-settings.js.map +1 -0
- package/lib/types/leasing.d.ts +322 -0
- package/lib/types/leasing.d.ts.map +1 -0
- package/lib/types/leasing.js +24 -0
- package/lib/types/leasing.js.map +1 -0
- package/lib/types/machines.d.ts +38 -0
- package/lib/types/machines.d.ts.map +1 -0
- package/lib/types/machines.js +3 -0
- package/lib/types/machines.js.map +1 -0
- package/lib/types/opportunities.d.ts +448 -0
- package/lib/types/opportunities.d.ts.map +1 -0
- package/lib/types/opportunities.js +68 -0
- package/lib/types/opportunities.js.map +1 -0
- package/lib/types/payments.d.ts +38 -0
- package/lib/types/payments.d.ts.map +1 -0
- package/lib/types/payments.js +9 -0
- package/lib/types/payments.js.map +1 -0
- package/lib/types/picklists.d.ts +15 -4
- package/lib/types/picklists.d.ts.map +1 -1
- package/lib/types/quotes.d.ts +173 -0
- package/lib/types/quotes.d.ts.map +1 -0
- package/lib/types/quotes.js +26 -0
- package/lib/types/quotes.js.map +1 -0
- package/lib/types/recently-viewed.d.ts +33 -0
- package/lib/types/recently-viewed.d.ts.map +1 -0
- package/lib/types/recently-viewed.js +3 -0
- package/lib/types/recently-viewed.js.map +1 -0
- package/lib/types/saved-filters.d.ts +20 -0
- package/lib/types/saved-filters.d.ts.map +1 -0
- package/lib/types/saved-filters.js +3 -0
- package/lib/types/saved-filters.js.map +1 -0
- package/lib/types/search.d.ts +26 -4
- package/lib/types/search.d.ts.map +1 -1
- package/lib/types/search.js.map +1 -1
- package/lib/types/settings.d.ts +50 -0
- package/lib/types/settings.d.ts.map +1 -0
- package/lib/types/settings.js +3 -0
- package/lib/types/settings.js.map +1 -0
- package/lib/types/storage.d.ts +1 -11
- package/lib/types/storage.d.ts.map +1 -1
- package/lib/types/storage.js +15 -0
- package/lib/types/storage.js.map +1 -1
- package/lib/types/templates.d.ts +35 -0
- package/lib/types/templates.d.ts.map +1 -0
- package/lib/types/templates.js +9 -0
- package/lib/types/templates.js.map +1 -0
- package/lib/types/tenants.d.ts +32 -9
- package/lib/types/tenants.d.ts.map +1 -1
- package/lib/types/tenants.js +11 -0
- package/lib/types/tenants.js.map +1 -1
- package/lib/types/users.d.ts +11 -3
- package/lib/types/users.d.ts.map +1 -1
- package/lib/types/utils.d.ts +20 -0
- package/lib/types/utils.d.ts.map +1 -1
- package/lib/types/utils.js +6 -0
- package/lib/types/utils.js.map +1 -1
- package/lib/types/vehicles.d.ts +406 -92
- package/lib/types/vehicles.d.ts.map +1 -1
- package/lib/types/vehicles.js +54 -1
- package/lib/types/vehicles.js.map +1 -1
- package/lib/types/website.d.ts +24 -0
- package/lib/types/website.d.ts.map +1 -0
- package/lib/types/website.js +3 -0
- package/lib/types/website.js.map +1 -0
- package/lib/utils/forms.d.ts +6 -0
- package/lib/utils/forms.d.ts.map +1 -0
- package/lib/utils/forms.js +33 -0
- package/lib/utils/forms.js.map +1 -0
- package/lib/utils/leasing.d.ts +3 -0
- package/lib/utils/leasing.d.ts.map +1 -0
- package/lib/utils/leasing.js +10 -0
- package/lib/utils/leasing.js.map +1 -0
- package/lib/utils/slug.d.ts +3 -0
- package/lib/utils/slug.d.ts.map +1 -0
- package/lib/utils/slug.js +23 -0
- package/lib/utils/slug.js.map +1 -0
- package/lib/utils/tenants.d.ts +4 -0
- package/lib/utils/tenants.d.ts.map +1 -0
- package/lib/utils/tenants.js +16 -0
- package/lib/utils/tenants.js.map +1 -0
- package/lib/utils/vehicles.d.ts +12 -0
- package/lib/utils/vehicles.d.ts.map +1 -0
- package/lib/utils/vehicles.js +73 -0
- package/lib/utils/vehicles.js.map +1 -0
- package/package.json +8 -6
- package/src/apis/crm.ts +302 -0
- package/src/apis/documents.ts +54 -0
- package/src/apis/internet-vehicles.ts +23 -0
- package/src/apis/leasing-administration.ts +70 -0
- package/src/apis/leasing.ts +257 -0
- package/src/apis/opportunities.ts +133 -0
- package/src/apis/picklists.ts +50 -0
- package/src/apis/tenants.ts +100 -0
- package/src/apis/users.ts +22 -0
- package/src/apis/utils.ts +23 -0
- package/src/apis/vehicles.ts +229 -0
- package/src/constants.ts +930 -1
- package/src/ddb-entities.ts +1 -0
- package/src/environment.d.ts +6 -0
- package/src/types/activities.ts +41 -0
- package/src/types/crm.ts +118 -30
- package/src/types/definitions.ts +19 -12
- package/src/types/documents.ts +110 -0
- package/src/types/fields.ts +72 -31
- package/src/types/internet-vehicles.ts +67 -0
- package/src/types/leads.ts +144 -0
- package/src/types/leasing-administration.ts +131 -0
- package/src/types/leasing-search.ts +24 -0
- package/src/types/leasing-settings.ts +111 -0
- package/src/types/leasing.ts +360 -0
- package/src/types/machines.ts +40 -0
- package/src/types/opportunities.ts +496 -0
- package/src/types/payments.ts +40 -0
- package/src/types/picklists.ts +26 -7
- package/src/types/quotes.ts +186 -0
- package/src/types/recently-viewed.ts +45 -0
- package/src/types/saved-filters.ts +21 -0
- package/src/types/search.ts +34 -4
- package/src/types/settings.ts +51 -0
- package/src/types/storage.ts +1 -12
- package/src/types/templates.ts +40 -0
- package/src/types/tenants.ts +37 -11
- package/src/types/users.ts +17 -3
- package/src/types/utils.ts +25 -0
- package/src/types/vehicles.ts +461 -93
- package/src/types/website.ts +28 -0
- package/src/utils/forms.ts +32 -0
- package/src/utils/leasing.ts +14 -0
- package/src/utils/slug.ts +19 -0
- package/src/utils/tenants.ts +14 -0
- package/src/utils/vehicles.ts +92 -0
- package/tsconfig.tsbuildinfo +1 -2995
- package/lib/types/interests.d.ts +0 -23
- package/lib/types/interests.d.ts.map +0 -1
- package/lib/types/interests.js.map +0 -1
- package/src/types/interests.ts +0 -20
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AttachmentValue, Requester } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
+
import { BusinessEntityIds } from '../constants';
|
|
3
|
+
|
|
4
|
+
export type ViewedItemsRequest = {
|
|
5
|
+
businessEntity?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type NewViewedItem = {
|
|
10
|
+
businessEntity: BusinessEntityIds;
|
|
11
|
+
id: string;
|
|
12
|
+
viewedAt: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type ViewedItemMeta = {
|
|
16
|
+
title: string;
|
|
17
|
+
subtitle: string;
|
|
18
|
+
thumbnail?: AttachmentValue | null; // null signals that it can have a thumbnail, it is just not available
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ViewedItem = ViewedItemMeta & {
|
|
22
|
+
viewedAt: string;
|
|
23
|
+
id: string;
|
|
24
|
+
actions: string[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type RawViewedItem = {
|
|
28
|
+
id: string;
|
|
29
|
+
viewedAt: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type ViewedItemHandler = (
|
|
33
|
+
requester: Requester,
|
|
34
|
+
req: ViewedItemsRequest,
|
|
35
|
+
itemsBusinessEntity: BusinessEntityIds,
|
|
36
|
+
items: RawViewedItem[]
|
|
37
|
+
) => Promise<ViewedItem[]>;
|
|
38
|
+
|
|
39
|
+
export type ViewedItemsContextHandlers = {
|
|
40
|
+
[entity in BusinessEntityIds]?: ViewedItemHandler;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type ViewedItemsHandlersCollection = {
|
|
44
|
+
[entity in BusinessEntityIds]?: ViewedItemsContextHandlers;
|
|
45
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BusinessEntityIds } from '../constants';
|
|
2
|
+
import { ComplexFilter } from './search';
|
|
3
|
+
|
|
4
|
+
type SavedFilterQuery = {
|
|
5
|
+
conditions: {
|
|
6
|
+
[fieldId: string]: ComplexFilter;
|
|
7
|
+
};
|
|
8
|
+
fullText?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type SavedFilter = SavedFilterQuery & {
|
|
12
|
+
id: string;
|
|
13
|
+
businessEntityId: BusinessEntityIds;
|
|
14
|
+
name: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type NewSavedFilterRequest = SavedFilterQuery & {
|
|
19
|
+
businessEntityId: BusinessEntityIds;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
package/src/types/search.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// Generic stuff
|
|
3
3
|
///////////////////////////////////////////////////////
|
|
4
4
|
|
|
5
|
+
import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
|
|
6
|
+
import { FieldTypes, NumberMeta } from './fields';
|
|
7
|
+
|
|
5
8
|
export enum ConditionType {
|
|
6
9
|
and = 'AND',
|
|
7
10
|
or = 'OR',
|
|
@@ -90,6 +93,13 @@ export type SearchRequest = {
|
|
|
90
93
|
sortBy?: SortFilter[];
|
|
91
94
|
};
|
|
92
95
|
|
|
96
|
+
export type PublicSearchRequest = {
|
|
97
|
+
limit: number;
|
|
98
|
+
offset?: number;
|
|
99
|
+
query?: ComplexFilter;
|
|
100
|
+
sortBy?: SortFilter[];
|
|
101
|
+
};
|
|
102
|
+
|
|
93
103
|
///////////////////////////////////////////////////////
|
|
94
104
|
// Aggregations
|
|
95
105
|
///////////////////////////////////////////////////////
|
|
@@ -107,11 +117,24 @@ export enum AggregationType {
|
|
|
107
117
|
}
|
|
108
118
|
|
|
109
119
|
export type TermAggregation = {
|
|
110
|
-
|
|
111
|
-
|
|
120
|
+
titles: MultiLangValue;
|
|
121
|
+
fieldId: string;
|
|
112
122
|
type: AggregationType.term;
|
|
123
|
+
|
|
113
124
|
orderBy?: 'count' | 'field';
|
|
114
|
-
}
|
|
125
|
+
} & (
|
|
126
|
+
| {
|
|
127
|
+
fieldType: FieldTypes.picklist;
|
|
128
|
+
picklistId: string;
|
|
129
|
+
}
|
|
130
|
+
| {
|
|
131
|
+
fieldType: FieldTypes.number;
|
|
132
|
+
meta?: NumberMeta;
|
|
133
|
+
}
|
|
134
|
+
| {
|
|
135
|
+
fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;
|
|
136
|
+
}
|
|
137
|
+
);
|
|
115
138
|
|
|
116
139
|
export type Range =
|
|
117
140
|
| {
|
|
@@ -128,10 +151,12 @@ export type Range =
|
|
|
128
151
|
};
|
|
129
152
|
|
|
130
153
|
export type RangeAggregation = {
|
|
131
|
-
|
|
154
|
+
titles: MultiLangValue;
|
|
155
|
+
fieldId: string;
|
|
132
156
|
type: AggregationType.range;
|
|
133
157
|
step: number;
|
|
134
158
|
ranges: Range[];
|
|
159
|
+
format?: NumberMeta;
|
|
135
160
|
};
|
|
136
161
|
|
|
137
162
|
export type Aggregation = TermAggregation | RangeAggregation;
|
|
@@ -151,3 +176,8 @@ export type AggregationResult = {
|
|
|
151
176
|
export type AggregationResultSet = {
|
|
152
177
|
[field: string]: AggregationResult[];
|
|
153
178
|
};
|
|
179
|
+
|
|
180
|
+
export type AggregationResponse<M = {}> = {
|
|
181
|
+
results: AggregationResultSet;
|
|
182
|
+
meta: M;
|
|
183
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type WebsiteSettings = {
|
|
2
|
+
contacts: {
|
|
3
|
+
destinations: string[];
|
|
4
|
+
};
|
|
5
|
+
leasing?: {
|
|
6
|
+
interestRate: number;
|
|
7
|
+
initialValues: {
|
|
8
|
+
residual: number;
|
|
9
|
+
deposit: number;
|
|
10
|
+
periods: number;
|
|
11
|
+
};
|
|
12
|
+
maxPeriods: number;
|
|
13
|
+
};
|
|
14
|
+
gatsbyCloud?: {
|
|
15
|
+
webhook: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type HyperportalSettings = {
|
|
20
|
+
hcTenantId: string;
|
|
21
|
+
crm: {
|
|
22
|
+
active: boolean;
|
|
23
|
+
};
|
|
24
|
+
vehicles: {
|
|
25
|
+
active: boolean;
|
|
26
|
+
ignoreBeforeDate?: string; // do not modify vehicles created before this date;
|
|
27
|
+
};
|
|
28
|
+
leasing: {
|
|
29
|
+
active: boolean;
|
|
30
|
+
contractTransferDefinitionId: string;
|
|
31
|
+
contractDealDefinitionId: string;
|
|
32
|
+
contractOwner: { [countryCode: string]: string };
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type HyperportalMachinesSettings = {
|
|
37
|
+
hcTenantId: string;
|
|
38
|
+
active: boolean;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type LeasingCreditorBranch = {
|
|
42
|
+
bciNumber: string;
|
|
43
|
+
vatNumber: string;
|
|
44
|
+
licenceDate: string;
|
|
45
|
+
becrisFirstReportDate: string;
|
|
46
|
+
becrisStartDate: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type LeasingCreditorSettings = {
|
|
50
|
+
[branchId: string]: LeasingCreditorBranch;
|
|
51
|
+
};
|
package/src/types/storage.ts
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
id: string;
|
|
3
|
-
uploadUrl: string;
|
|
4
|
-
downloadUrl: string;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export type GetUploadUrlRequest = {
|
|
8
|
-
businessEntityId: string;
|
|
9
|
-
fieldId: string;
|
|
10
|
-
fileName: string;
|
|
11
|
-
contentType: string;
|
|
12
|
-
};
|
|
1
|
+
export * from '@bisondesk/commons-sdk/lib/storage';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export enum TemplateType {
|
|
2
|
+
Email = 'email',
|
|
3
|
+
Sms = 'sms',
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type TemplateContent =
|
|
7
|
+
| {
|
|
8
|
+
type: TemplateType.Email;
|
|
9
|
+
subject: string;
|
|
10
|
+
content: {
|
|
11
|
+
html: string;
|
|
12
|
+
design: any;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
| {
|
|
16
|
+
type: TemplateType.Sms;
|
|
17
|
+
content: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type NewTemplateRequest = {
|
|
21
|
+
id?: string;
|
|
22
|
+
country: string;
|
|
23
|
+
name: string;
|
|
24
|
+
} & TemplateContent;
|
|
25
|
+
|
|
26
|
+
export type Template = {
|
|
27
|
+
id: string;
|
|
28
|
+
modifiedAt: string;
|
|
29
|
+
modifiedBy: string;
|
|
30
|
+
country: string;
|
|
31
|
+
name: string;
|
|
32
|
+
} & TemplateContent;
|
|
33
|
+
|
|
34
|
+
export type TemplateInfo = {
|
|
35
|
+
id: string;
|
|
36
|
+
countries: string[];
|
|
37
|
+
modifiedAt: string;
|
|
38
|
+
name: string;
|
|
39
|
+
type: TemplateType;
|
|
40
|
+
};
|
package/src/types/tenants.ts
CHANGED
|
@@ -1,29 +1,55 @@
|
|
|
1
1
|
import { Region } from '@bisondesk/commons-sdk/lib/types';
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export type PublicTenant = {
|
|
4
|
+
defaultCountry: string;
|
|
5
|
+
defaultCurrency: string;
|
|
6
|
+
defaultLanguage: string;
|
|
7
|
+
id: string; // the id is provided on creation bc we assume tenants will be created by someone on the team
|
|
6
8
|
name: string;
|
|
7
|
-
|
|
9
|
+
region: Region;
|
|
8
10
|
subdomain: string;
|
|
9
|
-
currency: string;
|
|
10
|
-
};
|
|
11
11
|
|
|
12
|
-
export type Tenant = NewTenant & {
|
|
13
|
-
id: string;
|
|
14
|
-
subdomain: string;
|
|
15
12
|
// Pay attention to what information is added here since
|
|
16
13
|
// the tenant can be obtained without authentication
|
|
17
14
|
};
|
|
18
15
|
|
|
16
|
+
export enum TenantModule {
|
|
17
|
+
CRM = 'crm',
|
|
18
|
+
Docs = 'docs',
|
|
19
|
+
Leads = 'leads',
|
|
20
|
+
Leasing = 'leasing',
|
|
21
|
+
Market = 'market',
|
|
22
|
+
Opportunities = 'opportunities',
|
|
23
|
+
VehiclesMasterData = 'vehicles_master_data',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type Tenant = PublicTenant & {
|
|
27
|
+
languages: [string, ...string[]];
|
|
28
|
+
conglomerate?: string;
|
|
29
|
+
emailDomain: string;
|
|
30
|
+
hyperdmsIds?: string[];
|
|
31
|
+
hyperportalId?: string;
|
|
32
|
+
exactAccounting?: boolean;
|
|
33
|
+
branches: [Branch, ...Branch[]];
|
|
34
|
+
modules: TenantModule[];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type Branch = {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
country: string;
|
|
41
|
+
exactAccounting?: boolean;
|
|
42
|
+
currency: string;
|
|
43
|
+
adminNumberPrefix: string;
|
|
44
|
+
stockNumberPrefix: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
19
47
|
export type HdmsVehiclesSync = {
|
|
20
48
|
active: boolean;
|
|
21
|
-
filterName: string;
|
|
22
49
|
};
|
|
23
50
|
|
|
24
51
|
export type HdmsCrmSync = {
|
|
25
52
|
active: boolean;
|
|
26
|
-
filterName: string;
|
|
27
53
|
};
|
|
28
54
|
|
|
29
55
|
export type TenantSyncSettings = {
|
package/src/types/users.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AppRoles } from '@bisondesk/commons-sdk/lib/constants';
|
|
2
|
+
import {
|
|
3
|
+
AttachmentValue,
|
|
4
|
+
PhoneNumberRawValue,
|
|
5
|
+
PhoneNumberValue,
|
|
6
|
+
} from '@bisondesk/commons-sdk/lib/types';
|
|
2
7
|
|
|
3
8
|
export type NewUserRequest = {
|
|
4
9
|
email: string;
|
|
@@ -6,7 +11,16 @@ export type NewUserRequest = {
|
|
|
6
11
|
language: string;
|
|
7
12
|
lastName: string;
|
|
8
13
|
phone: PhoneNumberRawValue;
|
|
9
|
-
|
|
14
|
+
picture?: AttachmentValue;
|
|
15
|
+
roles: AppRoles[];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type ValidNewUserRequest = Omit<NewUserRequest, 'phone'> & {
|
|
19
|
+
phone: PhoneNumberValue;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type UpdateUserRequest = Omit<User, 'phone'> & {
|
|
23
|
+
phone: PhoneNumberRawValue | PhoneNumberValue;
|
|
10
24
|
};
|
|
11
25
|
|
|
12
26
|
export type User = {
|
|
@@ -19,7 +33,7 @@ export type User = {
|
|
|
19
33
|
lastName: string;
|
|
20
34
|
phone: PhoneNumberValue;
|
|
21
35
|
picture?: AttachmentValue;
|
|
22
|
-
roles:
|
|
36
|
+
roles: AppRoles[];
|
|
23
37
|
updatedAt: string;
|
|
24
38
|
};
|
|
25
39
|
|
package/src/types/utils.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
+
import { AdHocPicklistValueDisplay } from './picklists';
|
|
3
|
+
|
|
1
4
|
export type CountryInfo = {
|
|
2
5
|
code: string; // code is ISO 3166-1 alpha-2
|
|
3
6
|
name: string;
|
|
@@ -25,3 +28,25 @@ export type Country = {
|
|
|
25
28
|
name: string;
|
|
26
29
|
dialCode: number;
|
|
27
30
|
};
|
|
31
|
+
|
|
32
|
+
export type ReferenceData = {
|
|
33
|
+
recordTitles: AdHocRecordTitles;
|
|
34
|
+
picklistTitles: AdHocPicklistValueDisplay;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type AdHocRecordTitles = {
|
|
38
|
+
[businessEntityId: string]: {
|
|
39
|
+
[recordId: string]: string | MultiLangValue;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type DataRecord<T, M = undefined> = {
|
|
44
|
+
record: T;
|
|
45
|
+
meta?: M; // typically ReferenceData
|
|
46
|
+
actions: string[];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export enum PricePercentageMode {
|
|
50
|
+
CURRENCY = 'currency',
|
|
51
|
+
PERCENTAGE = 'percentage',
|
|
52
|
+
}
|