@riocrypto/common-server 1.0.776 → 1.0.777
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.
|
@@ -19,7 +19,6 @@ const user_1 = require("../models/user");
|
|
|
19
19
|
const calculate_aggregate_volume_1 = require("./calculate-aggregate-volume");
|
|
20
20
|
const getPlatformAndPartnerFees = (mongoose, amountFiat, fiat, processor, country, discount, partnerId, brokerId, user) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
21
|
var _a;
|
|
22
|
-
console.log("user", user);
|
|
23
22
|
let platformFeeFiat;
|
|
24
23
|
let platformFeeFiatTax = 0;
|
|
25
24
|
let partnerFeeFiat = 0;
|
|
@@ -71,11 +70,8 @@ const getPlatformAndPartnerFees = (mongoose, amountFiat, fiat, processor, countr
|
|
|
71
70
|
else {
|
|
72
71
|
volume = Number(amountUSD);
|
|
73
72
|
}
|
|
74
|
-
console.log("Volume", volume);
|
|
75
73
|
for (const range of user.platformFeeRanges) {
|
|
76
|
-
console.log(range);
|
|
77
74
|
if (range.min <= Number(volume) && range.max >= Number(volume)) {
|
|
78
|
-
console.log("Hit");
|
|
79
75
|
if (discount) {
|
|
80
76
|
if (discount > range.fee) {
|
|
81
77
|
throw new Error("Discount cannot be greater than platform fee");
|
|
@@ -91,7 +87,6 @@ const getPlatformAndPartnerFees = (mongoose, amountFiat, fiat, processor, countr
|
|
|
91
87
|
break;
|
|
92
88
|
}
|
|
93
89
|
}
|
|
94
|
-
console.log("platformFeeFiat", platformFeeFiat);
|
|
95
90
|
// @ts-ignore
|
|
96
91
|
if (platformFeeFiat === undefined) {
|
|
97
92
|
const netPlatformFee = rioSettings.platformFee - discount;
|
|
@@ -103,7 +98,6 @@ const getPlatformAndPartnerFees = (mongoose, amountFiat, fiat, processor, countr
|
|
|
103
98
|
partnerFeeFiat = 0;
|
|
104
99
|
}
|
|
105
100
|
else {
|
|
106
|
-
console.log("tribeca");
|
|
107
101
|
const netPlatformFee = rioSettings.platformFee - discount;
|
|
108
102
|
if (netPlatformFee < 0) {
|
|
109
103
|
throw new Error("Discount cannot be greater than platform fee");
|
|
@@ -112,7 +106,6 @@ const getPlatformAndPartnerFees = (mongoose, amountFiat, fiat, processor, countr
|
|
|
112
106
|
partnerFeeFiat = 0;
|
|
113
107
|
}
|
|
114
108
|
if (brokerId && !platformFeeFiat) {
|
|
115
|
-
console.log("plas");
|
|
116
109
|
const User = (0, user_1.buildUser)(mongoose);
|
|
117
110
|
const brokerCustomer = yield User.findById(brokerId);
|
|
118
111
|
if (!brokerCustomer) {
|