@unchainedshop/core-quotations 3.1.11 → 3.1.13
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/QuotationStatus.d.ts +8 -0
- package/lib/db/QuotationStatus.d.ts.map +1 -0
- package/lib/db/QuotationStatus.js +9 -0
- package/lib/db/QuotationStatus.js.map +1 -0
- package/lib/db/QuotationsSchema.d.ts +3 -0
- package/lib/db/QuotationsSchema.d.ts.map +1 -0
- package/lib/db/QuotationsSchema.js +31 -0
- package/lib/db/QuotationsSchema.js.map +1 -0
- package/lib/director/QuotationAdapter.d.ts +3 -0
- package/lib/director/QuotationAdapter.d.ts.map +1 -0
- package/lib/director/QuotationAdapter.js +40 -0
- package/lib/director/QuotationAdapter.js.map +1 -0
- package/lib/director/QuotationDirector.d.ts +3 -0
- package/lib/director/QuotationDirector.d.ts.map +1 -0
- package/lib/director/QuotationDirector.js +89 -0
- package/lib/director/QuotationDirector.js.map +1 -0
- package/lib/director/QuotationError.d.ts +7 -0
- package/lib/director/QuotationError.d.ts.map +1 -0
- package/lib/director/QuotationError.js +8 -0
- package/lib/director/QuotationError.js.map +1 -0
- package/lib/migrations/20250502111800-currency-code.d.ts +3 -0
- package/lib/migrations/20250502111800-currency-code.d.ts.map +1 -0
- package/lib/migrations/20250502111800-currency-code.js +14 -0
- package/lib/migrations/20250502111800-currency-code.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationStatus.d.ts","sourceRoot":"","sources":["../../src/db/QuotationStatus.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACzB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
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
|
+
//# sourceMappingURL=QuotationStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationStatus.js","sourceRoot":"","sources":["../../src/db/QuotationStatus.ts"],"names":[],"mappings":"AAAA,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationsSchema.d.ts","sourceRoot":"","sources":["../../src/db/QuotationsSchema.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,gBAAgB,cA+B5B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Schemas } from '@unchainedshop/utils';
|
|
2
|
+
import SimpleSchema from 'simpl-schema';
|
|
3
|
+
export const QuotationsSchema = new SimpleSchema({
|
|
4
|
+
userId: { type: String, required: true },
|
|
5
|
+
productId: { type: String, required: true },
|
|
6
|
+
status: { type: String, required: true },
|
|
7
|
+
quotationNumber: String,
|
|
8
|
+
price: String,
|
|
9
|
+
expires: Date,
|
|
10
|
+
rejected: Date,
|
|
11
|
+
meta: { type: Object, blackbox: true },
|
|
12
|
+
fullfilled: Date,
|
|
13
|
+
context: { type: Object, blackbox: true },
|
|
14
|
+
currency: String,
|
|
15
|
+
countryCode: String,
|
|
16
|
+
configuration: Array,
|
|
17
|
+
'configuration.$': {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
'configuration.$.key': {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
'configuration.$.value': {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
...Schemas.logFields,
|
|
29
|
+
...Schemas.timestampFields,
|
|
30
|
+
}, { requiredByDefault: false });
|
|
31
|
+
//# sourceMappingURL=QuotationsSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationsSchema.js","sourceRoot":"","sources":["../../src/db/QuotationsSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,YAAY,CAC9C;IACE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACxC,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC3C,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACxC,eAAe,EAAE,MAAM;IACvB,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,MAAM;IACnB,aAAa,EAAE,KAAK;IACpB,iBAAiB,EAAE;QACjB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACf;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACf;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,MAAM;KACb;IAED,GAAG,OAAO,CAAC,SAAS;IACpB,GAAG,OAAO,CAAC,eAAe;CAC3B,EACD,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationAdapter.d.ts","sourceRoot":"","sources":["../../src/director/QuotationAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,eAAO,MAAM,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,CA8CjF,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { log, LogLevel } from '@unchainedshop/logger';
|
|
2
|
+
import { QuotationError } from './QuotationError.js';
|
|
3
|
+
export const QuotationAdapter = {
|
|
4
|
+
orderIndex: 0,
|
|
5
|
+
isActivatedFor: () => {
|
|
6
|
+
return false;
|
|
7
|
+
},
|
|
8
|
+
actions: () => {
|
|
9
|
+
return {
|
|
10
|
+
configurationError: () => {
|
|
11
|
+
return QuotationError.NOT_IMPLEMENTED;
|
|
12
|
+
},
|
|
13
|
+
isManualRequestVerificationRequired: async () => {
|
|
14
|
+
return true;
|
|
15
|
+
},
|
|
16
|
+
isManualProposalRequired: async () => {
|
|
17
|
+
return true;
|
|
18
|
+
},
|
|
19
|
+
quote: async () => {
|
|
20
|
+
return {};
|
|
21
|
+
},
|
|
22
|
+
rejectRequest: async () => {
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
submitRequest: async () => {
|
|
26
|
+
return true;
|
|
27
|
+
},
|
|
28
|
+
verifyRequest: async () => {
|
|
29
|
+
return true;
|
|
30
|
+
},
|
|
31
|
+
transformItemConfiguration: async ({ quantity, configuration }) => {
|
|
32
|
+
return { quantity, configuration };
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
log(message, { level = LogLevel.Debug, ...options } = {}) {
|
|
37
|
+
return log(message, { level, ...options });
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=QuotationAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationAdapter.js","sourceRoot":"","sources":["../../src/director/QuotationAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAyD;IACpF,UAAU,EAAE,CAAC;IAEb,cAAc,EAAE,GAAG,EAAE;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,EAAE,GAAG,EAAE;QACZ,OAAO;YACL,kBAAkB,EAAE,GAAG,EAAE;gBACvB,OAAO,cAAc,CAAC,eAAe,CAAC;YACxC,CAAC;YAED,mCAAmC,EAAE,KAAK,IAAI,EAAE;gBAC9C,OAAO,IAAI,CAAC;YACd,CAAC;YAED,wBAAwB,EAAE,KAAK,IAAI,EAAE;gBACnC,OAAO,IAAI,CAAC;YACd,CAAC;YAED,KAAK,EAAE,KAAK,IAAI,EAAE;gBAChB,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,aAAa,EAAE,KAAK,IAAI,EAAE;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;YAED,aAAa,EAAE,KAAK,IAAI,EAAE;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;YAED,aAAa,EAAE,KAAK,IAAI,EAAE;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;YAED,0BAA0B,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,EAAE;gBAChE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;YACrC,CAAC;SACF,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,OAAe,EAAE,EAAE,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE;QAC9D,OAAO,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationDirector.d.ts","sourceRoot":"","sources":["../../src/director/QuotationDirector.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,kBAAkB,EAEnB,MAAM,oCAAoC,CAAC;AAsB5C,eAAO,MAAM,iBAAiB,EAAE,kBA2E/B,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { LogLevel, log } from '@unchainedshop/logger';
|
|
2
|
+
import { BaseDirector } from '@unchainedshop/utils';
|
|
3
|
+
import { QuotationError } from './QuotationError.js';
|
|
4
|
+
const baseDirector = BaseDirector('QuotationDirector', {
|
|
5
|
+
adapterSortKey: 'orderIndex',
|
|
6
|
+
});
|
|
7
|
+
const findAppropriateAdapters = (quotationContext, unchainedAPI) => baseDirector.getAdapters({
|
|
8
|
+
adapterFilter: (Adapter) => {
|
|
9
|
+
const activated = Adapter.isActivatedFor(quotationContext, unchainedAPI);
|
|
10
|
+
if (!activated) {
|
|
11
|
+
log(`Quotation Director -> ${Adapter.key} (${Adapter.version}) skipped`, {
|
|
12
|
+
level: LogLevel.Warning,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return activated;
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
export const QuotationDirector = {
|
|
19
|
+
...baseDirector,
|
|
20
|
+
actions: async (quotationContext, unchainedAPI) => {
|
|
21
|
+
const context = { ...quotationContext, ...unchainedAPI };
|
|
22
|
+
const Adapter = findAppropriateAdapters(quotationContext, unchainedAPI)?.shift();
|
|
23
|
+
if (!Adapter) {
|
|
24
|
+
throw new Error('No suitable quotation plugin available for this context');
|
|
25
|
+
}
|
|
26
|
+
const adapter = Adapter.actions(context);
|
|
27
|
+
return {
|
|
28
|
+
configurationError: () => {
|
|
29
|
+
try {
|
|
30
|
+
return adapter.configurationError();
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
log('QuotationDirector -> Error while checking for configurationError', {
|
|
34
|
+
level: LogLevel.Warning,
|
|
35
|
+
...error,
|
|
36
|
+
});
|
|
37
|
+
return QuotationError.ADAPTER_NOT_FOUND;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
isManualRequestVerificationRequired: async () => {
|
|
41
|
+
try {
|
|
42
|
+
const isRequired = await adapter.isManualRequestVerificationRequired();
|
|
43
|
+
return isRequired;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
log('QuotationDirector -> Error while checking if is manual request verification required', {
|
|
47
|
+
level: LogLevel.Error,
|
|
48
|
+
...error,
|
|
49
|
+
});
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
isManualProposalRequired: async () => {
|
|
54
|
+
try {
|
|
55
|
+
const isRequired = await adapter.isManualProposalRequired();
|
|
56
|
+
return isRequired;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
log('QuotationDirector -> Error while checking if is manual proposal required', {
|
|
60
|
+
level: LogLevel.Error,
|
|
61
|
+
...error,
|
|
62
|
+
});
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
quote: adapter.quote,
|
|
67
|
+
rejectRequest: adapter.rejectRequest,
|
|
68
|
+
submitRequest: adapter.submitRequest,
|
|
69
|
+
verifyRequest: adapter.verifyRequest,
|
|
70
|
+
transformItemConfiguration: async ({ quantity, configuration }) => {
|
|
71
|
+
try {
|
|
72
|
+
const itemConfiguration = await adapter.transformItemConfiguration({
|
|
73
|
+
quantity,
|
|
74
|
+
configuration,
|
|
75
|
+
});
|
|
76
|
+
return itemConfiguration;
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
log('QuotationDirector -> Error while transforming item configuration', {
|
|
80
|
+
level: LogLevel.Error,
|
|
81
|
+
...error,
|
|
82
|
+
});
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=QuotationDirector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationDirector.js","sourceRoot":"","sources":["../../src/director/QuotationDirector.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare enum QuotationError {
|
|
2
|
+
ADAPTER_NOT_FOUND = "ADAPTER_NOT_FOUND",
|
|
3
|
+
NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
|
|
4
|
+
INCOMPLETE_CONFIGURATION = "INCOMPLETE_CONFIGURATION",
|
|
5
|
+
WRONG_CREDENTIALS = "WRONG_CREDENTIALS"
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=QuotationError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationError.d.ts","sourceRoot":"","sources":["../../src/director/QuotationError.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,iBAAiB,sBAAsB;IACvC,eAAe,oBAAoB;IACnC,wBAAwB,6BAA6B;IACrD,iBAAiB,sBAAsB;CACxC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var QuotationError;
|
|
2
|
+
(function (QuotationError) {
|
|
3
|
+
QuotationError["ADAPTER_NOT_FOUND"] = "ADAPTER_NOT_FOUND";
|
|
4
|
+
QuotationError["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
5
|
+
QuotationError["INCOMPLETE_CONFIGURATION"] = "INCOMPLETE_CONFIGURATION";
|
|
6
|
+
QuotationError["WRONG_CREDENTIALS"] = "WRONG_CREDENTIALS";
|
|
7
|
+
})(QuotationError || (QuotationError = {}));
|
|
8
|
+
//# sourceMappingURL=QuotationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotationError.js","sourceRoot":"","sources":["../../src/director/QuotationError.ts"],"names":[],"mappings":"AAAA,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20250502111800-currency-code.d.ts","sourceRoot":"","sources":["../../src/migrations/20250502111800-currency-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,QAczE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QuotationsCollection } from '../quotations-index.js';
|
|
2
|
+
export default function renameCurrencyCode(repository) {
|
|
3
|
+
repository?.register({
|
|
4
|
+
id: 20250502113100,
|
|
5
|
+
name: 'Rename quotation.currency to quotation.currencyCode',
|
|
6
|
+
up: async () => {
|
|
7
|
+
const Quotations = await QuotationsCollection(repository.db);
|
|
8
|
+
await Quotations.updateMany({}, {
|
|
9
|
+
$rename: { currency: 'currencyCode' },
|
|
10
|
+
});
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=20250502111800-currency-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20250502111800-currency-code.js","sourceRoot":"","sources":["../../src/migrations/20250502111800-currency-code.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,UAA+B;IACxE,UAAU,EAAE,QAAQ,CAAC;QACnB,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,qDAAqD;QAC3D,EAAE,EAAE,KAAK,IAAI,EAAE;YACb,MAAM,UAAU,GAAG,MAAM,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAC7D,MAAM,UAAU,CAAC,UAAU,CACzB,EAAE,EACF;gBACE,OAAO,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE;aACtC,CACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-quotations",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.13",
|
|
4
4
|
"main": "lib/quotations-index.js",
|
|
5
5
|
"types": "lib/quotations-index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@unchainedshop/events": "^3.1.
|
|
35
|
-
"@unchainedshop/logger": "^3.1.
|
|
36
|
-
"@unchainedshop/utils": "^3.1.
|
|
34
|
+
"@unchainedshop/events": "^3.1.13",
|
|
35
|
+
"@unchainedshop/logger": "^3.1.13",
|
|
36
|
+
"@unchainedshop/utils": "^3.1.13"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^
|
|
40
|
-
"tsx": "^4.
|
|
41
|
-
"typescript": "^5.8.
|
|
39
|
+
"@types/node": "^24.0.4",
|
|
40
|
+
"tsx": "^4.20.3",
|
|
41
|
+
"typescript": "^5.8.3"
|
|
42
42
|
}
|
|
43
43
|
}
|