@unchainedshop/core-quotations 4.8.9 → 4.8.11
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mongodb, buildDbIndexes
|
|
1
|
+
import { mongodb, buildDbIndexes } from '@unchainedshop/mongodb';
|
|
2
2
|
export const QuotationStatus = {
|
|
3
3
|
REQUESTED: 'REQUESTED',
|
|
4
4
|
PROCESSING: 'PROCESSING',
|
|
@@ -8,30 +8,28 @@ export const QuotationStatus = {
|
|
|
8
8
|
};
|
|
9
9
|
export const QuotationsCollection = async (db) => {
|
|
10
10
|
const Quotations = db.collection('quotations');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
status: 1,
|
|
26
|
-
},
|
|
27
|
-
name: 'quotation_fulltext_search',
|
|
11
|
+
await buildDbIndexes(Quotations, [
|
|
12
|
+
{
|
|
13
|
+
index: {
|
|
14
|
+
_id: 'text',
|
|
15
|
+
userId: 'text',
|
|
16
|
+
quotationNumber: 'text',
|
|
17
|
+
status: 'text',
|
|
18
|
+
},
|
|
19
|
+
options: {
|
|
20
|
+
weights: {
|
|
21
|
+
_id: 8,
|
|
22
|
+
userId: 3,
|
|
23
|
+
quotationNumber: 6,
|
|
24
|
+
status: 1,
|
|
28
25
|
},
|
|
26
|
+
name: 'quotation_fulltext_search',
|
|
29
27
|
},
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
},
|
|
29
|
+
]);
|
|
32
30
|
await buildDbIndexes(Quotations, [
|
|
33
|
-
{ index: { userId: 1 } },
|
|
34
|
-
{ index: { productId: 1 } },
|
|
31
|
+
{ index: { userId: 1, status: 1 } },
|
|
32
|
+
{ index: { productId: 1, status: 1 } },
|
|
35
33
|
{ index: { status: 1 } },
|
|
36
34
|
]);
|
|
37
35
|
return Quotations;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SortDirection } from '@unchainedshop/utils';
|
|
2
2
|
import { QuotationStatus } from "../db/QuotationsCollection.js";
|
|
3
3
|
import { emit, registerEvents } from '@unchainedshop/events';
|
|
4
|
-
import { generateDbFilterById, buildSortOptions, mongodb, generateDbObjectId,
|
|
4
|
+
import { generateDbFilterById, buildSortOptions, mongodb, generateDbObjectId, } from '@unchainedshop/mongodb';
|
|
5
5
|
import { QuotationsCollection } from "../db/QuotationsCollection.js";
|
|
6
6
|
import { quotationsSettings } from "../quotations-settings.js";
|
|
7
7
|
import renameCurrencyCode from "../migrations/20250502111800-currency-code.js";
|
|
@@ -15,7 +15,6 @@ export const buildFindSelector = ({ userId, queryString, quotationIds } = {}) =>
|
|
|
15
15
|
selector._id = { $in: quotationIds };
|
|
16
16
|
}
|
|
17
17
|
if (queryString) {
|
|
18
|
-
assertDocumentDBCompatMode();
|
|
19
18
|
selector.$text = { $search: queryString };
|
|
20
19
|
}
|
|
21
20
|
return selector;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-quotations",
|
|
3
3
|
"description": "Quotation and RFQ management module for the Unchained Engine",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.11",
|
|
5
5
|
"main": "lib/quotations-index.js",
|
|
6
6
|
"types": "lib/quotations-index.d.ts",
|
|
7
7
|
"type": "module",
|