@bisondesk/core-sdk 1.0.255 → 1.0.257
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/cjs/apis/crm.js +2 -4
- package/lib/cjs/apis/crm.js.map +1 -1
- package/lib/cjs/apis/documents.js +14 -6
- package/lib/cjs/apis/documents.js.map +1 -1
- package/lib/cjs/apis/internet-vehicles.js +2 -4
- package/lib/cjs/apis/internet-vehicles.js.map +1 -1
- package/lib/cjs/apis/leasing-administration.js +2 -4
- package/lib/cjs/apis/leasing-administration.js.map +1 -1
- package/lib/cjs/apis/leasing.js +2 -4
- package/lib/cjs/apis/leasing.js.map +1 -1
- package/lib/cjs/apis/opportunities.js.map +1 -1
- package/lib/cjs/apis/picklists.js +2 -4
- package/lib/cjs/apis/picklists.js.map +1 -1
- package/lib/cjs/apis/tenants.js +2 -4
- package/lib/cjs/apis/tenants.js.map +1 -1
- package/lib/cjs/apis/users.js +2 -4
- package/lib/cjs/apis/users.js.map +1 -1
- package/lib/cjs/apis/utils.js.map +1 -1
- package/lib/cjs/apis/vehicles.js +2 -4
- package/lib/cjs/apis/vehicles.js.map +1 -1
- package/lib/cjs/constants.js +7 -1
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/ddb-entities.js.map +1 -1
- package/lib/cjs/types/activities.js.map +1 -1
- package/lib/cjs/types/crm.js.map +1 -1
- package/lib/cjs/types/definitions.js.map +1 -1
- package/lib/cjs/types/delivery-settings.js.map +1 -1
- package/lib/cjs/types/documents.js.map +1 -1
- package/lib/cjs/types/events.js.map +1 -1
- package/lib/cjs/types/fields.js.map +1 -1
- package/lib/cjs/types/internet-vehicles.js.map +1 -1
- package/lib/cjs/types/leads.js.map +1 -1
- package/lib/cjs/types/leasing-administration.js.map +1 -1
- package/lib/cjs/types/leasing-debtors.js.map +1 -1
- package/lib/cjs/types/leasing-search.js.map +1 -1
- package/lib/cjs/types/leasing-settings.js.map +1 -1
- package/lib/cjs/types/leasing.js.map +1 -1
- package/lib/cjs/types/machines.js.map +1 -1
- package/lib/cjs/types/opportunities.js +10 -1
- package/lib/cjs/types/opportunities.js.map +1 -1
- package/lib/cjs/types/payments.js.map +1 -1
- package/lib/cjs/types/picklists.js.map +1 -1
- package/lib/cjs/types/quotes.js.map +1 -1
- package/lib/cjs/types/recently-viewed.js.map +1 -1
- package/lib/cjs/types/saved-filters.js.map +1 -1
- package/lib/cjs/types/search.js.map +1 -1
- package/lib/cjs/types/settings.js.map +1 -1
- package/lib/cjs/types/storage.js +2 -15
- package/lib/cjs/types/storage.js.map +1 -1
- package/lib/cjs/types/templates.js.map +1 -1
- package/lib/cjs/types/tenants.js.map +1 -1
- package/lib/cjs/types/users.js.map +1 -1
- package/lib/cjs/types/utils.js.map +1 -1
- package/lib/cjs/types/vehicles.js.map +1 -1
- package/lib/cjs/types/website.js.map +1 -1
- package/lib/cjs/utils/forms.js +2 -4
- package/lib/cjs/utils/forms.js.map +1 -1
- package/lib/cjs/utils/leasing.js.map +1 -1
- package/lib/cjs/utils/opportunities.js +26 -6
- package/lib/cjs/utils/opportunities.js.map +1 -1
- package/lib/cjs/utils/slug.js +2 -4
- package/lib/cjs/utils/slug.js.map +1 -1
- package/lib/cjs/utils/tenants.js.map +1 -1
- package/lib/cjs/utils/vehicles.js.map +1 -1
- package/lib/esm/apis/crm.js.map +1 -1
- package/lib/esm/apis/documents.js +12 -2
- package/lib/esm/apis/documents.js.map +1 -1
- package/lib/esm/apis/internet-vehicles.js.map +1 -1
- package/lib/esm/apis/leasing-administration.js.map +1 -1
- package/lib/esm/apis/leasing.js.map +1 -1
- package/lib/esm/apis/opportunities.js.map +1 -1
- package/lib/esm/apis/picklists.js.map +1 -1
- package/lib/esm/apis/tenants.js.map +1 -1
- package/lib/esm/apis/users.js.map +1 -1
- package/lib/esm/apis/utils.js.map +1 -1
- package/lib/esm/apis/vehicles.js.map +1 -1
- package/lib/esm/constants.js +6 -0
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/ddb-entities.js.map +1 -1
- package/lib/esm/types/activities.js.map +1 -1
- package/lib/esm/types/crm.js.map +1 -1
- package/lib/esm/types/definitions.js.map +1 -1
- package/lib/esm/types/delivery-settings.js.map +1 -1
- package/lib/esm/types/documents.js.map +1 -1
- package/lib/esm/types/events.js.map +1 -1
- package/lib/esm/types/fields.js.map +1 -1
- package/lib/esm/types/internet-vehicles.js.map +1 -1
- package/lib/esm/types/leads.js.map +1 -1
- package/lib/esm/types/leasing-administration.js.map +1 -1
- package/lib/esm/types/leasing-debtors.js.map +1 -1
- package/lib/esm/types/leasing-search.js.map +1 -1
- package/lib/esm/types/leasing-settings.js.map +1 -1
- package/lib/esm/types/leasing.js.map +1 -1
- package/lib/esm/types/machines.js.map +1 -1
- package/lib/esm/types/opportunities.js +9 -0
- package/lib/esm/types/opportunities.js.map +1 -1
- package/lib/esm/types/payments.js.map +1 -1
- package/lib/esm/types/picklists.js.map +1 -1
- package/lib/esm/types/quotes.js.map +1 -1
- package/lib/esm/types/recently-viewed.js.map +1 -1
- package/lib/esm/types/saved-filters.js.map +1 -1
- package/lib/esm/types/search.js.map +1 -1
- package/lib/esm/types/settings.js.map +1 -1
- package/lib/esm/types/storage.js.map +1 -1
- package/lib/esm/types/templates.js.map +1 -1
- package/lib/esm/types/tenants.js.map +1 -1
- package/lib/esm/types/users.js.map +1 -1
- package/lib/esm/types/utils.js.map +1 -1
- package/lib/esm/types/vehicles.js.map +1 -1
- package/lib/esm/types/website.js.map +1 -1
- package/lib/esm/utils/forms.js.map +1 -1
- package/lib/esm/utils/leasing.js.map +1 -1
- package/lib/esm/utils/opportunities.js +22 -5
- package/lib/esm/utils/opportunities.js.map +1 -1
- package/lib/esm/utils/slug.js.map +1 -1
- package/lib/esm/utils/tenants.js.map +1 -1
- package/lib/esm/utils/vehicles.js.map +1 -1
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/apis/crm.d.ts.map +1 -1
- package/lib/types/apis/documents.d.ts.map +1 -1
- package/lib/types/apis/internet-vehicles.d.ts.map +1 -1
- package/lib/types/apis/leasing-administration.d.ts.map +1 -1
- package/lib/types/apis/leasing.d.ts.map +1 -1
- package/lib/types/apis/opportunities.d.ts.map +1 -1
- package/lib/types/apis/picklists.d.ts.map +1 -1
- package/lib/types/apis/tenants.d.ts.map +1 -1
- package/lib/types/apis/users.d.ts.map +1 -1
- package/lib/types/apis/utils.d.ts.map +1 -1
- package/lib/types/apis/vehicles.d.ts.map +1 -1
- package/lib/types/constants.d.ts +5 -0
- package/lib/types/constants.d.ts.map +1 -1
- package/lib/types/ddb-entities.d.ts.map +1 -1
- package/lib/types/types/activities.d.ts.map +1 -1
- package/lib/types/types/crm.d.ts.map +1 -1
- package/lib/types/types/definitions.d.ts.map +1 -1
- package/lib/types/types/delivery-settings.d.ts.map +1 -1
- package/lib/types/types/documents.d.ts.map +1 -1
- package/lib/types/types/events.d.ts.map +1 -1
- package/lib/types/types/fields.d.ts.map +1 -1
- package/lib/types/types/internet-vehicles.d.ts.map +1 -1
- package/lib/types/types/leads.d.ts.map +1 -1
- package/lib/types/types/leasing-administration.d.ts +16 -16
- package/lib/types/types/leasing-administration.d.ts.map +1 -1
- package/lib/types/types/leasing-debtors.d.ts.map +1 -1
- package/lib/types/types/leasing-search.d.ts.map +1 -1
- package/lib/types/types/leasing-settings.d.ts.map +1 -1
- package/lib/types/types/leasing.d.ts +17 -0
- package/lib/types/types/leasing.d.ts.map +1 -1
- package/lib/types/types/machines.d.ts.map +1 -1
- package/lib/types/types/opportunities.d.ts +37 -32
- package/lib/types/types/opportunities.d.ts.map +1 -1
- package/lib/types/types/payments.d.ts +28 -0
- package/lib/types/types/payments.d.ts.map +1 -1
- package/lib/types/types/picklists.d.ts.map +1 -1
- package/lib/types/types/quotes.d.ts +17 -0
- package/lib/types/types/quotes.d.ts.map +1 -1
- package/lib/types/types/recently-viewed.d.ts.map +1 -1
- package/lib/types/types/saved-filters.d.ts.map +1 -1
- package/lib/types/types/search.d.ts.map +1 -1
- package/lib/types/types/settings.d.ts.map +1 -1
- package/lib/types/types/storage.d.ts.map +1 -1
- package/lib/types/types/templates.d.ts.map +1 -1
- package/lib/types/types/tenants.d.ts +1 -0
- package/lib/types/types/tenants.d.ts.map +1 -1
- package/lib/types/types/users.d.ts.map +1 -1
- package/lib/types/types/utils.d.ts.map +1 -1
- package/lib/types/types/vehicles.d.ts +2 -2
- package/lib/types/types/vehicles.d.ts.map +1 -1
- package/lib/types/types/website.d.ts.map +1 -1
- package/lib/types/utils/forms.d.ts.map +1 -1
- package/lib/types/utils/leasing.d.ts.map +1 -1
- package/lib/types/utils/opportunities.d.ts +7 -2
- package/lib/types/utils/opportunities.d.ts.map +1 -1
- package/lib/types/utils/slug.d.ts.map +1 -1
- package/lib/types/utils/tenants.d.ts.map +1 -1
- package/lib/types/utils/vehicles.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/apis/documents.ts +13 -3
- package/src/constants.ts +6 -0
- package/src/types/leasing-administration.ts +16 -16
- package/src/types/leasing.ts +22 -3
- package/src/types/opportunities.ts +40 -31
- package/src/types/payments.ts +32 -0
- package/src/types/quotes.ts +19 -0
- package/src/types/tenants.ts +1 -0
- package/src/types/vehicles.ts +2 -2
- package/src/utils/opportunities.ts +31 -5
- package/tsconfig.json +2 -0
package/src/types/vehicles.ts
CHANGED
|
@@ -83,6 +83,7 @@ export type NewVehicleRequest = {
|
|
|
83
83
|
internet?: string;
|
|
84
84
|
};
|
|
85
85
|
media: {
|
|
86
|
+
internalPictures: AttachmentValue[];
|
|
86
87
|
pictures: AttachmentValue[];
|
|
87
88
|
videos: AttachmentValue[];
|
|
88
89
|
docs: Document[];
|
|
@@ -193,6 +194,7 @@ export type VehicleInternalInfo = {
|
|
|
193
194
|
metaId: string;
|
|
194
195
|
};
|
|
195
196
|
documents: Document[];
|
|
197
|
+
pictures: AttachmentValue[];
|
|
196
198
|
engineeringDocs: Document[];
|
|
197
199
|
pricing: {
|
|
198
200
|
premium?: string;
|
|
@@ -431,13 +433,11 @@ export type VehicleMarketing = {
|
|
|
431
433
|
titles: MultiLangValue;
|
|
432
434
|
remarks?: MultiLangValue;
|
|
433
435
|
marketingPlatforms: string[];
|
|
434
|
-
pictures: AttachmentValue[];
|
|
435
436
|
videos: AttachmentValue[];
|
|
436
437
|
overrides?: {
|
|
437
438
|
marketingPlatforms?: boolean;
|
|
438
439
|
remarks?: boolean;
|
|
439
440
|
titles?: boolean;
|
|
440
|
-
pictures?: boolean;
|
|
441
441
|
videos?: boolean;
|
|
442
442
|
};
|
|
443
443
|
};
|
|
@@ -1,15 +1,41 @@
|
|
|
1
1
|
import { Opportunity, OpportunityStatus, OpportunityStatusOrder } from '../types/opportunities';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type CompareInput = {
|
|
4
4
|
currentStatus: OpportunityStatus;
|
|
5
5
|
referenceStatus: OpportunityStatus;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const compareOpportunityStatus = (input: CompareInput) => {
|
|
7
9
|
const { currentStatus, referenceStatus } = input;
|
|
8
10
|
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
+
const currentStatusIdx = OpportunityStatusOrder.indexOf(currentStatus);
|
|
12
|
+
const referenceStatusIdx = OpportunityStatusOrder.indexOf(referenceStatus);
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
currentStatusIdx,
|
|
16
|
+
referenceStatusIdx,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const isSameOrAfterReferenceOpportunityStatus = (input: CompareInput): boolean => {
|
|
21
|
+
const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
|
|
11
22
|
|
|
12
|
-
return
|
|
23
|
+
return currentStatusIdx >= referenceStatusIdx;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const isSameOrBeforeReferenceOpportunityStatus = (input: CompareInput): boolean => {
|
|
27
|
+
const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
|
|
28
|
+
|
|
29
|
+
return currentStatusIdx <= referenceStatusIdx;
|
|
13
30
|
};
|
|
14
31
|
|
|
15
32
|
export const isOpportunityLost = (input: Opportunity): boolean => input.lostAt != null;
|
|
33
|
+
|
|
34
|
+
export const getOpportunityReservedStatus = (): OpportunityStatus[] => [
|
|
35
|
+
OpportunityStatus.REVIEW,
|
|
36
|
+
OpportunityStatus.PREPARATION,
|
|
37
|
+
OpportunityStatus.DELIVERY,
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
export const isOpportunityReserved = (input: Opportunity): boolean =>
|
|
41
|
+
getOpportunityReservedStatus().includes(input.status);
|