@riocrypto/common 1.0.2343 → 1.0.2345
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,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Side } from "../types/side";
|
|
2
2
|
import { User } from "../types/user";
|
|
3
|
-
export declare const getCanDisburseWithoutCosigner: (user: User,
|
|
3
|
+
export declare const getCanDisburseWithoutCosigner: (user: User, side: Side) => boolean | undefined;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getCanDisburseWithoutCosigner = void 0;
|
|
4
4
|
const side_1 = require("../types/side");
|
|
5
5
|
const user_attribute_1 = require("../types/user-attribute");
|
|
6
|
-
const getCanDisburseWithoutCosigner = (user,
|
|
6
|
+
const getCanDisburseWithoutCosigner = (user, side) => {
|
|
7
7
|
var _a, _b, _c, _d;
|
|
8
8
|
// If between 8am and 3:40pm Mexico City time, check if user has disburseMorningBuyOrdersWithoutCosigner or disburseMorningSellOrdersWithoutCosigner
|
|
9
9
|
// If between 3:40pm and 8am Mexico City time, check if user has disburseEveningBuyOrdersWithoutCosigner or disburseEveningSellOrdersWithoutCosigner
|
|
@@ -23,7 +23,7 @@ const getCanDisburseWithoutCosigner = (user, order) => {
|
|
|
23
23
|
// Check if current time is in morning period (8:00 AM - 3:40 PM)
|
|
24
24
|
if (currentTime >= morningStart.getTime() &&
|
|
25
25
|
currentTime < morningEnd.getTime()) {
|
|
26
|
-
return
|
|
26
|
+
return side === side_1.Side.Buy
|
|
27
27
|
? (_a = user.attributes) === null || _a === void 0 ? void 0 : _a.includes(user_attribute_1.UserAttribute.DisburseMorningBuyOrdersWithoutCosigner)
|
|
28
28
|
: (_b = user.attributes) === null || _b === void 0 ? void 0 : _b.includes(user_attribute_1.UserAttribute.DisburseMorningSellOrdersWithoutCosigner);
|
|
29
29
|
}
|
|
@@ -31,7 +31,7 @@ const getCanDisburseWithoutCosigner = (user, order) => {
|
|
|
31
31
|
// For evening period, we need to handle the case where it spans across midnight
|
|
32
32
|
const isEveningPeriod = currentTime >= eveningStart.getTime() || currentTime < eveningEnd.getTime();
|
|
33
33
|
if (isEveningPeriod) {
|
|
34
|
-
return
|
|
34
|
+
return side === side_1.Side.Buy
|
|
35
35
|
? (_c = user.attributes) === null || _c === void 0 ? void 0 : _c.includes(user_attribute_1.UserAttribute.DisburseEveningBuyOrdersWithoutCosigner)
|
|
36
36
|
: (_d = user.attributes) === null || _d === void 0 ? void 0 : _d.includes(user_attribute_1.UserAttribute.DisburseEveningSellOrdersWithoutCosigner);
|
|
37
37
|
}
|
package/build/types/user.d.ts
CHANGED