@riocrypto/common-server 1.0.2455 → 1.0.2457
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.
|
@@ -13,12 +13,12 @@ exports.getOrderFromReference = void 0;
|
|
|
13
13
|
const order_1 = require("../models/order");
|
|
14
14
|
const common_1 = require("@riocrypto/common");
|
|
15
15
|
const getOrderFromReference = (reference, mongoose) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
// Ensure reference is defined
|
|
17
|
-
if (!reference
|
|
18
|
-
throw new Error("Invalid reference.
|
|
16
|
+
// Ensure reference is defined
|
|
17
|
+
if (!reference) {
|
|
18
|
+
throw new Error("Invalid reference. Reference cannot be empty.");
|
|
19
19
|
}
|
|
20
20
|
// Convert reference to lowercase to ensure case-insensitive comparison
|
|
21
|
-
const
|
|
21
|
+
const referenceText = reference.toLowerCase();
|
|
22
22
|
const Order = (0, order_1.buildOrder)(mongoose);
|
|
23
23
|
const orders = yield Order.find({
|
|
24
24
|
status: {
|
|
@@ -29,7 +29,7 @@ const getOrderFromReference = (reference, mongoose) => __awaiter(void 0, void 0,
|
|
|
29
29
|
],
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
-
const order = orders.find((order) => order.id.toString().
|
|
32
|
+
const order = orders.find((order) => referenceText.includes(order.id.toString().toLowerCase()));
|
|
33
33
|
if (!order) {
|
|
34
34
|
throw new Error("Order not found");
|
|
35
35
|
}
|
|
@@ -18,6 +18,7 @@ interface AdminTaskAttrs {
|
|
|
18
18
|
originCLABE?: string;
|
|
19
19
|
originBlockchainAddress?: string;
|
|
20
20
|
destinationBlockchainAddress?: string;
|
|
21
|
+
destinationVaultUserId?: string;
|
|
21
22
|
originAccountHolderName?: string;
|
|
22
23
|
destinationBank?: string;
|
|
23
24
|
reference?: string;
|
|
@@ -40,6 +41,7 @@ interface AdminTaskDoc extends Document {
|
|
|
40
41
|
originCLABE?: string;
|
|
41
42
|
originBlockchainAddress?: string;
|
|
42
43
|
destinationBlockchainAddress?: string;
|
|
44
|
+
destinationVaultUserId?: string;
|
|
43
45
|
originAccountHolderName?: string;
|
|
44
46
|
destinationBank?: string;
|
|
45
47
|
reference?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2457",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.2223",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|