@riocrypto/common-server 1.0.653 → 1.0.655

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.
@@ -4,4 +4,5 @@ export declare const getPlatformAndPartnerFees: (mongoose: Mongoose, amountFiat:
4
4
  platformFeeFiat: number;
5
5
  platformFeeFiatTax: number;
6
6
  partnerFeeFiat: number;
7
+ feesComped: boolean;
7
8
  }>;
@@ -20,6 +20,7 @@ const getPlatformAndPartnerFees = (mongoose, amountFiat, fiat, processor, countr
20
20
  let platformFeeFiat;
21
21
  let platformFeeFiatTax = 0;
22
22
  let partnerFeeFiat = 0;
23
+ let feesComped = false;
23
24
  let amountUSD;
24
25
  let conversionRateToUSD = 0;
25
26
  const RioSettings = (0, rio_settings_1.buildRioSettings)(mongoose);
@@ -48,6 +49,9 @@ const getPlatformAndPartnerFees = (mongoose, amountFiat, fiat, processor, countr
48
49
  if (!partner) {
49
50
  throw new common_1.PartnerNotFoundError();
50
51
  }
52
+ if (partner.feesComped) {
53
+ feesComped = true;
54
+ }
51
55
  platformFeeFiat = amountFiat * partner.platformFee;
52
56
  partnerFeeFiat = amountFiat * partner.partnerFee;
53
57
  }
@@ -98,6 +102,7 @@ const getPlatformAndPartnerFees = (mongoose, amountFiat, fiat, processor, countr
98
102
  platformFeeFiat,
99
103
  platformFeeFiatTax,
100
104
  partnerFeeFiat,
105
+ feesComped,
101
106
  };
102
107
  });
103
108
  exports.getPlatformAndPartnerFees = getPlatformAndPartnerFees;
@@ -8,6 +8,8 @@ interface PartnerAttrs {
8
8
  platformFee: number;
9
9
  color?: string;
10
10
  logo?: string;
11
+ logoDark?: string;
12
+ feesComped?: boolean;
11
13
  }
12
14
  interface PartnerDoc extends Document {
13
15
  authId: string;
@@ -18,6 +20,7 @@ interface PartnerDoc extends Document {
18
20
  color?: string;
19
21
  logo?: string;
20
22
  logoDark?: string;
23
+ feesComped?: boolean;
21
24
  }
22
25
  interface PartnerModel extends Model<PartnerDoc> {
23
26
  build(attrs: PartnerAttrs): PartnerDoc;
@@ -36,6 +36,9 @@ const buildPartner = (mongoose) => {
36
36
  logoDark: {
37
37
  type: String,
38
38
  },
39
+ feesComped: {
40
+ type: Boolean,
41
+ },
39
42
  }, {
40
43
  toJSON: {
41
44
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.653",
3
+ "version": "1.0.655",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@aws-sdk/client-s3": "^3.297.0",
25
25
  "@everapi/currencyapi-js": "^1.0.6",
26
26
  "@google-cloud/storage": "^6.9.5",
27
- "@riocrypto/common": "^1.0.596",
27
+ "@riocrypto/common": "^1.0.597",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",