@unchainedshop/core-quotations 3.0.0-alpha7 → 3.0.0-rc10
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/db/QuotationsCollection.d.ts +39 -2
- package/lib/db/QuotationsCollection.d.ts.map +1 -1
- package/lib/db/QuotationsCollection.js +8 -0
- package/lib/db/QuotationsCollection.js.map +1 -1
- package/lib/module/configureQuotationsModule.d.ts +31 -45
- package/lib/module/configureQuotationsModule.d.ts.map +1 -1
- package/lib/module/configureQuotationsModule.js +17 -124
- package/lib/module/configureQuotationsModule.js.map +1 -1
- package/lib/quotations-index.d.ts +1 -5
- package/lib/quotations-index.d.ts.map +1 -1
- package/lib/quotations-index.js +1 -5
- package/lib/quotations-index.js.map +1 -1
- package/lib/quotations-settings.d.ts +1 -1
- package/lib/quotations-settings.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/db/QuotationsCollection.ts +34 -2
- package/src/module/configureQuotationsModule.ts +50 -234
- package/src/quotations-index.ts +2 -8
- package/src/quotations-settings.ts +1 -1
- package/tsconfig.json +5 -7
- package/lib/db/QuotationStatus.d.ts +0 -8
- package/lib/db/QuotationStatus.d.ts.map +0 -1
- package/lib/db/QuotationStatus.js +0 -9
- package/lib/db/QuotationStatus.js.map +0 -1
- package/lib/director/QuotationAdapter.d.ts +0 -3
- package/lib/director/QuotationAdapter.d.ts.map +0 -1
- package/lib/director/QuotationAdapter.js +0 -40
- package/lib/director/QuotationAdapter.js.map +0 -1
- package/lib/director/QuotationDirector.d.ts +0 -3
- package/lib/director/QuotationDirector.d.ts.map +0 -1
- package/lib/director/QuotationDirector.js +0 -89
- package/lib/director/QuotationDirector.js.map +0 -1
- package/lib/director/QuotationError.d.ts +0 -7
- package/lib/director/QuotationError.d.ts.map +0 -1
- package/lib/director/QuotationError.js +0 -8
- package/lib/director/QuotationError.js.map +0 -1
- package/lib/types.d.ts +0 -69
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -16
- package/lib/types.js.map +0 -1
- package/src/db/QuotationStatus.ts +0 -7
- package/src/director/QuotationAdapter.ts +0 -51
- package/src/director/QuotationDirector.ts +0 -99
- package/src/director/QuotationError.ts +0 -6
- package/src/types.ts +0 -74
package/lib/types.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { IBaseAdapter, IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import type { TimestampFields, LogFields } from '@unchainedshop/mongodb';
|
|
3
|
-
import type { UnchainedCore } from '@unchainedshop/core';
|
|
4
|
-
export declare enum QuotationStatus {
|
|
5
|
-
REQUESTED = "REQUESTED",
|
|
6
|
-
PROCESSING = "PROCESSING",
|
|
7
|
-
PROPOSED = "PROPOSED",
|
|
8
|
-
FULLFILLED = "FULLFILLED",
|
|
9
|
-
REJECTED = "REJECTED"
|
|
10
|
-
}
|
|
11
|
-
export declare enum QuotationError {
|
|
12
|
-
ADAPTER_NOT_FOUND = "ADAPTER_NOT_FOUND",
|
|
13
|
-
NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
|
|
14
|
-
INCOMPLETE_CONFIGURATION = "INCOMPLETE_CONFIGURATION",
|
|
15
|
-
WRONG_CREDENTIALS = "WRONG_CREDENTIALS"
|
|
16
|
-
}
|
|
17
|
-
export type Quotation = {
|
|
18
|
-
_id?: string;
|
|
19
|
-
configuration?: Array<{
|
|
20
|
-
key: string;
|
|
21
|
-
value: string;
|
|
22
|
-
}>;
|
|
23
|
-
context?: any;
|
|
24
|
-
countryCode?: string;
|
|
25
|
-
currency?: string;
|
|
26
|
-
expires?: Date;
|
|
27
|
-
fullfilled?: Date;
|
|
28
|
-
meta?: any;
|
|
29
|
-
price?: number;
|
|
30
|
-
productId: string;
|
|
31
|
-
quotationNumber?: string;
|
|
32
|
-
rejected?: Date;
|
|
33
|
-
status: string;
|
|
34
|
-
userId: string;
|
|
35
|
-
} & LogFields & TimestampFields;
|
|
36
|
-
export type QuotationProposal = {
|
|
37
|
-
price?: number;
|
|
38
|
-
expires?: Date;
|
|
39
|
-
meta?: any;
|
|
40
|
-
};
|
|
41
|
-
export interface QuotationItemConfiguration {
|
|
42
|
-
quantity?: number;
|
|
43
|
-
configuration: Array<{
|
|
44
|
-
key: string;
|
|
45
|
-
value: string;
|
|
46
|
-
}>;
|
|
47
|
-
}
|
|
48
|
-
export type QuotationContext = {
|
|
49
|
-
quotation?: Quotation;
|
|
50
|
-
};
|
|
51
|
-
export interface QuotationAdapterActions {
|
|
52
|
-
configurationError: () => QuotationError;
|
|
53
|
-
isManualProposalRequired: () => Promise<boolean>;
|
|
54
|
-
isManualRequestVerificationRequired: () => Promise<boolean>;
|
|
55
|
-
quote: () => Promise<QuotationProposal>;
|
|
56
|
-
rejectRequest: (unchainedAPI?: any) => Promise<boolean>;
|
|
57
|
-
submitRequest: (unchainedAPI?: any) => Promise<boolean>;
|
|
58
|
-
verifyRequest: (unchainedAPI?: any) => Promise<boolean>;
|
|
59
|
-
transformItemConfiguration: (params: QuotationItemConfiguration) => Promise<QuotationItemConfiguration>;
|
|
60
|
-
}
|
|
61
|
-
export type IQuotationAdapter = IBaseAdapter & {
|
|
62
|
-
orderIndex: number;
|
|
63
|
-
isActivatedFor: (quotationContext: QuotationContext, unchainedAPI: UnchainedCore) => boolean;
|
|
64
|
-
actions: (params: QuotationContext & UnchainedCore) => QuotationAdapterActions;
|
|
65
|
-
};
|
|
66
|
-
export type IQuotationDirector = IBaseDirector<IQuotationAdapter> & {
|
|
67
|
-
actions: (quotationContext: QuotationContext, unchainedAPI: UnchainedCore) => Promise<QuotationAdapterActions>;
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=types.d.ts.map
|
package/lib/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACxE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
|
-
export var QuotationStatus;
|
|
2
|
-
(function (QuotationStatus) {
|
|
3
|
-
QuotationStatus["REQUESTED"] = "REQUESTED";
|
|
4
|
-
QuotationStatus["PROCESSING"] = "PROCESSING";
|
|
5
|
-
QuotationStatus["PROPOSED"] = "PROPOSED";
|
|
6
|
-
QuotationStatus["FULLFILLED"] = "FULLFILLED";
|
|
7
|
-
QuotationStatus["REJECTED"] = "REJECTED";
|
|
8
|
-
})(QuotationStatus || (QuotationStatus = {}));
|
|
9
|
-
export var QuotationError;
|
|
10
|
-
(function (QuotationError) {
|
|
11
|
-
QuotationError["ADAPTER_NOT_FOUND"] = "ADAPTER_NOT_FOUND";
|
|
12
|
-
QuotationError["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
13
|
-
QuotationError["INCOMPLETE_CONFIGURATION"] = "INCOMPLETE_CONFIGURATION";
|
|
14
|
-
QuotationError["WRONG_CREDENTIALS"] = "WRONG_CREDENTIALS";
|
|
15
|
-
})(QuotationError || (QuotationError = {}));
|
|
16
|
-
//# sourceMappingURL=types.js.map
|
package/lib/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;IACrB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;AACvB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,yDAAuC,CAAA;IACvC,qDAAmC,CAAA;IACnC,uEAAqD,CAAA;IACrD,yDAAuC,CAAA;AACzC,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { log, LogLevel } from '@unchainedshop/logger';
|
|
2
|
-
import { IQuotationAdapter } from '../types.js';
|
|
3
|
-
import { QuotationError } from './QuotationError.js';
|
|
4
|
-
|
|
5
|
-
export const QuotationAdapter: Omit<IQuotationAdapter, 'key' | 'label' | 'version'> = {
|
|
6
|
-
orderIndex: 0,
|
|
7
|
-
|
|
8
|
-
isActivatedFor: () => {
|
|
9
|
-
return false;
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
actions: () => {
|
|
13
|
-
return {
|
|
14
|
-
configurationError: () => {
|
|
15
|
-
return QuotationError.NOT_IMPLEMENTED;
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
isManualRequestVerificationRequired: async () => {
|
|
19
|
-
return true;
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
isManualProposalRequired: async () => {
|
|
23
|
-
return true;
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
quote: async () => {
|
|
27
|
-
return {};
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
rejectRequest: async () => {
|
|
31
|
-
return true;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
submitRequest: async () => {
|
|
35
|
-
return true;
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
verifyRequest: async () => {
|
|
39
|
-
return true;
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
transformItemConfiguration: async ({ quantity, configuration }) => {
|
|
43
|
-
return { quantity, configuration };
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
log(message: string, { level = LogLevel.Debug, ...options } = {}) {
|
|
49
|
-
return log(message, { level, ...options });
|
|
50
|
-
},
|
|
51
|
-
};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { LogLevel, log } from '@unchainedshop/logger';
|
|
2
|
-
import { IQuotationAdapter, IQuotationDirector, QuotationContext } from '../types.js';
|
|
3
|
-
import { BaseDirector } from '@unchainedshop/utils';
|
|
4
|
-
import { UnchainedCore } from '@unchainedshop/core';
|
|
5
|
-
import { QuotationError } from './QuotationError.js';
|
|
6
|
-
|
|
7
|
-
const baseDirector = BaseDirector<IQuotationAdapter>('QuotationDirector', {
|
|
8
|
-
adapterSortKey: 'orderIndex',
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const findAppropriateAdapters = (quotationContext: QuotationContext, unchainedAPI: UnchainedCore) =>
|
|
12
|
-
baseDirector.getAdapters({
|
|
13
|
-
adapterFilter: (Adapter: IQuotationAdapter) => {
|
|
14
|
-
const activated = Adapter.isActivatedFor(quotationContext, unchainedAPI);
|
|
15
|
-
if (!activated) {
|
|
16
|
-
log(`Quotation Director -> ${Adapter.key} (${Adapter.version}) skipped`, {
|
|
17
|
-
level: LogLevel.Warning,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return activated;
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export const QuotationDirector: IQuotationDirector = {
|
|
25
|
-
...baseDirector,
|
|
26
|
-
|
|
27
|
-
actions: async (quotationContext, unchainedAPI) => {
|
|
28
|
-
const context = { ...quotationContext, ...unchainedAPI };
|
|
29
|
-
|
|
30
|
-
const Adapter = findAppropriateAdapters(quotationContext, unchainedAPI)?.shift();
|
|
31
|
-
|
|
32
|
-
if (!Adapter) {
|
|
33
|
-
throw new Error('No suitable quotation plugin available for this context');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const adapter = Adapter.actions(context);
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
configurationError: () => {
|
|
40
|
-
try {
|
|
41
|
-
return adapter.configurationError();
|
|
42
|
-
} catch (error) {
|
|
43
|
-
log('QuotationDirector -> Error while checking for configurationError', {
|
|
44
|
-
level: LogLevel.Warning,
|
|
45
|
-
...error,
|
|
46
|
-
});
|
|
47
|
-
return QuotationError.ADAPTER_NOT_FOUND;
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
isManualRequestVerificationRequired: async () => {
|
|
52
|
-
try {
|
|
53
|
-
const isRequired = await adapter.isManualRequestVerificationRequired();
|
|
54
|
-
return isRequired;
|
|
55
|
-
} catch (error) {
|
|
56
|
-
log('QuotationDirector -> Error while checking if is manual request verification required', {
|
|
57
|
-
level: LogLevel.Error,
|
|
58
|
-
...error,
|
|
59
|
-
});
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
isManualProposalRequired: async () => {
|
|
65
|
-
try {
|
|
66
|
-
const isRequired = await adapter.isManualProposalRequired();
|
|
67
|
-
return isRequired;
|
|
68
|
-
} catch (error) {
|
|
69
|
-
log('QuotationDirector -> Error while checking if is manual proposal required', {
|
|
70
|
-
level: LogLevel.Error,
|
|
71
|
-
...error,
|
|
72
|
-
});
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
quote: adapter.quote,
|
|
78
|
-
rejectRequest: adapter.rejectRequest,
|
|
79
|
-
submitRequest: adapter.submitRequest,
|
|
80
|
-
verifyRequest: adapter.verifyRequest,
|
|
81
|
-
|
|
82
|
-
transformItemConfiguration: async ({ quantity, configuration }) => {
|
|
83
|
-
try {
|
|
84
|
-
const itemConfiguration = await adapter.transformItemConfiguration({
|
|
85
|
-
quantity,
|
|
86
|
-
configuration,
|
|
87
|
-
});
|
|
88
|
-
return itemConfiguration;
|
|
89
|
-
} catch (error) {
|
|
90
|
-
log('QuotationDirector -> Error while transforming item configuration', {
|
|
91
|
-
level: LogLevel.Error,
|
|
92
|
-
...error,
|
|
93
|
-
});
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
},
|
|
99
|
-
};
|
package/src/types.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { IBaseAdapter, IBaseDirector } from '@unchainedshop/utils';
|
|
2
|
-
import type { TimestampFields, LogFields } from '@unchainedshop/mongodb';
|
|
3
|
-
import type { UnchainedCore } from '@unchainedshop/core';
|
|
4
|
-
|
|
5
|
-
export enum QuotationStatus {
|
|
6
|
-
REQUESTED = 'REQUESTED',
|
|
7
|
-
PROCESSING = 'PROCESSING',
|
|
8
|
-
PROPOSED = 'PROPOSED',
|
|
9
|
-
FULLFILLED = 'FULLFILLED',
|
|
10
|
-
REJECTED = 'REJECTED',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export enum QuotationError {
|
|
14
|
-
ADAPTER_NOT_FOUND = 'ADAPTER_NOT_FOUND',
|
|
15
|
-
NOT_IMPLEMENTED = 'NOT_IMPLEMENTED',
|
|
16
|
-
INCOMPLETE_CONFIGURATION = 'INCOMPLETE_CONFIGURATION',
|
|
17
|
-
WRONG_CREDENTIALS = 'WRONG_CREDENTIALS',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type Quotation = {
|
|
21
|
-
_id?: string;
|
|
22
|
-
configuration?: Array<{ key: string; value: string }>;
|
|
23
|
-
context?: any;
|
|
24
|
-
countryCode?: string;
|
|
25
|
-
currency?: string;
|
|
26
|
-
expires?: Date;
|
|
27
|
-
fullfilled?: Date;
|
|
28
|
-
meta?: any;
|
|
29
|
-
price?: number;
|
|
30
|
-
productId: string;
|
|
31
|
-
quotationNumber?: string;
|
|
32
|
-
rejected?: Date;
|
|
33
|
-
status: string;
|
|
34
|
-
userId: string;
|
|
35
|
-
} & LogFields &
|
|
36
|
-
TimestampFields;
|
|
37
|
-
|
|
38
|
-
export type QuotationProposal = { price?: number; expires?: Date; meta?: any };
|
|
39
|
-
|
|
40
|
-
export interface QuotationItemConfiguration {
|
|
41
|
-
quantity?: number;
|
|
42
|
-
configuration: Array<{ key: string; value: string }>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type QuotationContext = {
|
|
46
|
-
quotation?: Quotation;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export interface QuotationAdapterActions {
|
|
50
|
-
configurationError: () => QuotationError;
|
|
51
|
-
isManualProposalRequired: () => Promise<boolean>;
|
|
52
|
-
isManualRequestVerificationRequired: () => Promise<boolean>;
|
|
53
|
-
quote: () => Promise<QuotationProposal>;
|
|
54
|
-
rejectRequest: (unchainedAPI?: any) => Promise<boolean>;
|
|
55
|
-
submitRequest: (unchainedAPI?: any) => Promise<boolean>;
|
|
56
|
-
verifyRequest: (unchainedAPI?: any) => Promise<boolean>;
|
|
57
|
-
|
|
58
|
-
transformItemConfiguration: (
|
|
59
|
-
params: QuotationItemConfiguration,
|
|
60
|
-
) => Promise<QuotationItemConfiguration>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export type IQuotationAdapter = IBaseAdapter & {
|
|
64
|
-
orderIndex: number;
|
|
65
|
-
isActivatedFor: (quotationContext: QuotationContext, unchainedAPI: UnchainedCore) => boolean;
|
|
66
|
-
actions: (params: QuotationContext & UnchainedCore) => QuotationAdapterActions;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export type IQuotationDirector = IBaseDirector<IQuotationAdapter> & {
|
|
70
|
-
actions: (
|
|
71
|
-
quotationContext: QuotationContext,
|
|
72
|
-
unchainedAPI: UnchainedCore,
|
|
73
|
-
) => Promise<QuotationAdapterActions>;
|
|
74
|
-
};
|