@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 @@
|
|
|
1
|
+
export const ITEM_VIEWS_KEY = 'views';
|
|
@@ -0,0 +1,41 @@
|
|
|
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/crm.ts
CHANGED
|
@@ -1,53 +1,141 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
LocationValue,
|
|
3
|
+
PhoneNumberRawValue,
|
|
4
|
+
PhoneNumberValue,
|
|
5
|
+
SearchPermissions,
|
|
6
|
+
} from '@bisondesk/commons-sdk/lib/types';
|
|
7
|
+
import { PublicSearchDefinition } from './definitions';
|
|
8
|
+
import { LeasingContract } from './leasing';
|
|
9
|
+
import { ReferenceData } from './utils';
|
|
3
10
|
|
|
4
|
-
export type
|
|
11
|
+
export type CrmEvent = CrmOrganizationEvent | CrmContactEvent;
|
|
12
|
+
|
|
13
|
+
export type CrmContactEvent = {
|
|
14
|
+
contactId: string;
|
|
15
|
+
organizationId?: string;
|
|
16
|
+
action: 'upsert' | 'delete';
|
|
17
|
+
actionAt: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
tenantId: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type CrmOrganizationEvent = {
|
|
23
|
+
organizationId: string;
|
|
24
|
+
action: 'upsert' | 'delete';
|
|
25
|
+
actionAt: string;
|
|
26
|
+
userId: string;
|
|
27
|
+
tenantId: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type BaseOrganization = {
|
|
31
|
+
inUse: boolean;
|
|
5
32
|
countryCode: string;
|
|
6
|
-
|
|
7
|
-
createdBy: string;
|
|
8
|
-
externalId: number;
|
|
9
|
-
id: string;
|
|
33
|
+
syncedAt: string;
|
|
10
34
|
name: string;
|
|
11
35
|
segment?: string;
|
|
12
36
|
type?: 'COMPANY' | 'INDIVIDUAL';
|
|
13
37
|
vatNumber?: string;
|
|
38
|
+
addresses?: {
|
|
39
|
+
legal?: LocationValue;
|
|
40
|
+
transport?: LocationValue;
|
|
41
|
+
};
|
|
42
|
+
accountManagers: string[];
|
|
43
|
+
billingEmails?: string[];
|
|
44
|
+
skipPaymentReminders?: boolean;
|
|
45
|
+
trustworthy?: boolean;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type NewOrganization = BaseOrganization & {
|
|
49
|
+
id?: undefined;
|
|
50
|
+
externalId?: undefined;
|
|
51
|
+
createdAt?: undefined;
|
|
52
|
+
createdBy?: undefined;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type Organization = BaseOrganization & {
|
|
56
|
+
createdAt: string;
|
|
57
|
+
externalId: number;
|
|
58
|
+
createdBy: string;
|
|
59
|
+
id: string;
|
|
60
|
+
debt?: OrganizationDebtInfo;
|
|
61
|
+
blocked?: boolean;
|
|
62
|
+
blockedAt?: string;
|
|
63
|
+
blockedBy?: string;
|
|
64
|
+
blockedReason?: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type OrganizationDebtInfo = {
|
|
68
|
+
overdueSince?: string;
|
|
69
|
+
overdueInvoices: number;
|
|
70
|
+
overdueAmount: string;
|
|
71
|
+
unpaidInvoices: number;
|
|
72
|
+
unpaidAmount: string;
|
|
14
73
|
};
|
|
15
74
|
|
|
16
75
|
export type SearchOrganization = {
|
|
17
|
-
org:
|
|
76
|
+
org: Organization;
|
|
77
|
+
contract: LeasingContract[]; // important for the logic regarding leasing overdue reminders
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type PotentialDuplicatesReferenceData = ReferenceData & { blockIgnore?: boolean };
|
|
81
|
+
|
|
82
|
+
export type InputSearchOrganization = SearchOrganization & {
|
|
83
|
+
permissions: SearchPermissions;
|
|
18
84
|
};
|
|
19
85
|
|
|
20
86
|
export type SearchContact = {
|
|
21
|
-
|
|
22
|
-
|
|
87
|
+
contact: Contact;
|
|
88
|
+
org?: Organization;
|
|
23
89
|
};
|
|
24
90
|
|
|
25
|
-
export type
|
|
26
|
-
|
|
27
|
-
|
|
91
|
+
export type InputSearchContact = SearchContact & {
|
|
92
|
+
permissions: SearchPermissions;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type CrmPublicSearchDefinitions = {
|
|
96
|
+
searchOrg: PublicSearchDefinition;
|
|
97
|
+
searchContact: PublicSearchDefinition;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
type BaseContact = {
|
|
28
101
|
accountManager?: string;
|
|
102
|
+
countryCode?: string;
|
|
29
103
|
language?: string;
|
|
30
|
-
firstName?: string;
|
|
31
|
-
lastName: string;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
createdBy: string;
|
|
34
|
-
phones: PhoneNumberValue[];
|
|
35
104
|
emails: string[];
|
|
36
105
|
job?: string;
|
|
106
|
+
/** either firstName or lastName should be filled in */
|
|
107
|
+
firstName?: string;
|
|
108
|
+
lastName?: string;
|
|
109
|
+
organizationId?: string;
|
|
110
|
+
/** will not be filled if organizationId is present */
|
|
111
|
+
orgName?: string;
|
|
37
112
|
};
|
|
38
113
|
|
|
39
|
-
export type
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
language?: string;
|
|
45
|
-
name: string;
|
|
46
|
-
phone?: PhoneNumberValue;
|
|
47
|
-
remarks?: string;
|
|
114
|
+
export type NewContact = BaseContact & {
|
|
115
|
+
id?: undefined;
|
|
116
|
+
createdAt?: undefined;
|
|
117
|
+
createdBy?: undefined;
|
|
118
|
+
phones: Array<PhoneNumberValue | PhoneNumberRawValue>;
|
|
48
119
|
};
|
|
49
120
|
|
|
50
|
-
export type
|
|
51
|
-
|
|
52
|
-
|
|
121
|
+
export type Contact = BaseContact & {
|
|
122
|
+
id: string;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
createdBy: string;
|
|
125
|
+
phones: PhoneNumberValue[];
|
|
53
126
|
};
|
|
127
|
+
|
|
128
|
+
export enum SaveContactResolution {
|
|
129
|
+
IgnoreDuplicates = 'IGNORE_DUPLICATES',
|
|
130
|
+
BlockDuplicates = 'BLOCK_DUPLICATES',
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export enum SaveOrgResolution {
|
|
134
|
+
IgnoreDuplicates = 'IGNORE_DUPLICATES',
|
|
135
|
+
BlockDuplicates = 'BLOCK_DUPLICATES',
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export enum CrmSearchScope {
|
|
139
|
+
Tenant = 'tenant',
|
|
140
|
+
Conglomerate = 'conglomerate',
|
|
141
|
+
}
|
package/src/types/definitions.ts
CHANGED
|
@@ -5,28 +5,35 @@ import { Aggregation } from './search';
|
|
|
5
5
|
// These definitions are sent to the UI
|
|
6
6
|
//
|
|
7
7
|
export type PublicSearchDefinition = {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
fields: { [fieldId: string]: SearchField };
|
|
9
|
+
aggs: Aggregation[];
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export type PublicSearchField = {
|
|
13
|
-
id: string;
|
|
14
|
-
titles: { [lang: string]: string };
|
|
15
|
-
agg?: Aggregation;
|
|
16
|
-
} & FieldTypeInfo;
|
|
17
|
-
|
|
18
12
|
//
|
|
19
13
|
// These definitions are for internal consumption
|
|
20
14
|
//
|
|
21
15
|
export type SearchDefinition = {
|
|
22
|
-
name: string;
|
|
23
16
|
fields: { [fieldId: string]: SearchField };
|
|
24
17
|
};
|
|
25
18
|
|
|
26
19
|
export type SearchField = {
|
|
27
20
|
id: string;
|
|
28
|
-
esMapping: unknown;
|
|
29
21
|
titles: { [lang: string]: string };
|
|
30
|
-
fullText?: boolean | ((lang: string) => string);
|
|
31
|
-
agg?: Aggregation;
|
|
32
22
|
} & FieldTypeInfo;
|
|
23
|
+
|
|
24
|
+
export type EsDefinitionField = {
|
|
25
|
+
esMapping: unknown;
|
|
26
|
+
sortKey?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type EsDefinition = {
|
|
30
|
+
name: string;
|
|
31
|
+
nestedEsPaths: string[];
|
|
32
|
+
fields: {
|
|
33
|
+
[fieldId: string]: EsDefinitionField;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type EsFullTextSearchDefinition = ((lang: string) => string)[];
|
|
38
|
+
|
|
39
|
+
export type EsAggregationsDefinition = Aggregation[];
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
};
|
package/src/types/fields.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
-
|
|
3
1
|
export enum FieldTypes {
|
|
2
|
+
attachment = 'attachment',
|
|
4
3
|
checkbox = 'checkbox',
|
|
4
|
+
collaborator = 'collaborator',
|
|
5
5
|
date = 'date',
|
|
6
6
|
email = 'email',
|
|
7
7
|
image = 'image',
|
|
8
|
+
link = 'link',
|
|
9
|
+
location = 'location',
|
|
8
10
|
multilang = 'multilang',
|
|
9
11
|
multiline = 'multiline',
|
|
10
12
|
number = 'number',
|
|
@@ -24,41 +26,72 @@ export enum DateGranularity {
|
|
|
24
26
|
yearMonthDayTime = 'yearMonthDayTime',
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
export type PhoneNumberValue = {
|
|
28
|
-
country?: string;
|
|
29
|
-
e164: string;
|
|
30
|
-
international: string;
|
|
31
|
-
national: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type PhoneNumberRawValue = {
|
|
35
|
-
defaultCountry?: string;
|
|
36
|
-
input: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type AttachmentValue = {
|
|
40
|
-
contentType: string;
|
|
41
|
-
fileName: string;
|
|
42
|
-
id: string;
|
|
43
|
-
size: number;
|
|
44
|
-
uploadedAt: string;
|
|
45
|
-
uploadedBy: string;
|
|
46
|
-
url: string;
|
|
47
|
-
descriptions?: string | MultiLangValue;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
29
|
//
|
|
51
30
|
// Field metas
|
|
52
31
|
//
|
|
53
32
|
type BaseMeta = {};
|
|
54
33
|
|
|
55
|
-
|
|
56
|
-
|
|
34
|
+
type NumberUnit =
|
|
35
|
+
| 'acre'
|
|
36
|
+
| 'bit'
|
|
37
|
+
| 'byte'
|
|
38
|
+
| 'celsius'
|
|
39
|
+
| 'centimeter'
|
|
40
|
+
| 'day'
|
|
41
|
+
| 'degree'
|
|
42
|
+
| 'fahrenheit'
|
|
43
|
+
| 'fluid-ounce'
|
|
44
|
+
| 'foot'
|
|
45
|
+
| 'gallon'
|
|
46
|
+
| 'gigabit'
|
|
47
|
+
| 'gigabyte'
|
|
48
|
+
| 'gram'
|
|
49
|
+
| 'hectare'
|
|
50
|
+
| 'hour'
|
|
51
|
+
| 'inch'
|
|
52
|
+
| 'kilobit'
|
|
53
|
+
| 'kilobyte'
|
|
54
|
+
| 'kilogram'
|
|
55
|
+
| 'kilometer'
|
|
56
|
+
| 'liter'
|
|
57
|
+
| 'megabit'
|
|
58
|
+
| 'megabyte'
|
|
59
|
+
| 'meter'
|
|
60
|
+
| 'mile'
|
|
61
|
+
| 'mile-scandinavian'
|
|
62
|
+
| 'milliliter'
|
|
63
|
+
| 'millimeter'
|
|
64
|
+
| 'millisecond'
|
|
65
|
+
| 'minute'
|
|
66
|
+
| 'month'
|
|
67
|
+
| 'ounce'
|
|
68
|
+
| 'percent'
|
|
69
|
+
| 'petabyte'
|
|
70
|
+
| 'pound'
|
|
71
|
+
| 'second'
|
|
72
|
+
| 'stone'
|
|
73
|
+
| 'terabit'
|
|
74
|
+
| 'terabyte'
|
|
75
|
+
| 'week'
|
|
76
|
+
| 'yard'
|
|
77
|
+
| 'year';
|
|
78
|
+
|
|
79
|
+
type BaseNumberMeta = {
|
|
57
80
|
minimumFractionDigits?: number;
|
|
58
81
|
maximumFractionDigits?: number;
|
|
59
|
-
unit?: string; // see full list https://github.com/unicode-org/cldr/blob/master/common/validity/unit.xml
|
|
60
82
|
useGrouping?: boolean;
|
|
61
|
-
}
|
|
83
|
+
} & (
|
|
84
|
+
| {
|
|
85
|
+
style: 'unit';
|
|
86
|
+
unit: NumberUnit;
|
|
87
|
+
}
|
|
88
|
+
| {
|
|
89
|
+
style?: 'currency' | 'decimal' | 'percent';
|
|
90
|
+
unit?: NumberUnit;
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
export type NumberMeta = BaseMeta & BaseNumberMeta;
|
|
62
95
|
|
|
63
96
|
export type DateMeta = BaseMeta & {
|
|
64
97
|
granularity: DateGranularity;
|
|
@@ -68,15 +101,23 @@ export type RatingMeta = BaseMeta & {
|
|
|
68
101
|
max: number;
|
|
69
102
|
};
|
|
70
103
|
|
|
104
|
+
export type PicklistMeta = BaseMeta & {
|
|
105
|
+
picklistId: string;
|
|
106
|
+
};
|
|
107
|
+
|
|
71
108
|
export type FieldTypeInfo =
|
|
109
|
+
| { type: FieldTypes.attachment }
|
|
72
110
|
| { type: FieldTypes.checkbox }
|
|
73
111
|
| { type: FieldTypes.date; meta: DateMeta }
|
|
74
112
|
| { type: FieldTypes.email }
|
|
75
113
|
| { type: FieldTypes.image }
|
|
114
|
+
| { type: FieldTypes.link }
|
|
115
|
+
| { type: FieldTypes.location }
|
|
76
116
|
| { type: FieldTypes.multilang }
|
|
77
117
|
| { type: FieldTypes.multiline }
|
|
78
118
|
| { type: FieldTypes.number; meta: NumberMeta }
|
|
79
119
|
| { type: FieldTypes.phoneNumber }
|
|
80
|
-
| { type: FieldTypes.picklist }
|
|
120
|
+
| { type: FieldTypes.picklist; meta: PicklistMeta }
|
|
81
121
|
| { type: FieldTypes.rating; meta: RatingMeta }
|
|
82
|
-
| { type: FieldTypes.text }
|
|
122
|
+
| { type: FieldTypes.text }
|
|
123
|
+
| { type: FieldTypes.collaborator };
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
};
|