@riocrypto/common-server 1.0.2074 → 1.0.2076

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 { Fiat, Crypto } from "@riocrypto/common";
1
+ import { Fiat, Crypto, Country } from "@riocrypto/common";
2
2
  import { PreSettlementTransactionType } from "@riocrypto/common";
3
3
  import mongoose from "mongoose";
4
4
  interface PreSettlementTransactionAttrs {
@@ -6,6 +6,7 @@ interface PreSettlementTransactionAttrs {
6
6
  type: PreSettlementTransactionType;
7
7
  amount: number;
8
8
  currency: Fiat | Crypto;
9
+ country: Country;
9
10
  orderId?: string;
10
11
  }
11
12
  interface PreSettlementTransactionDoc extends mongoose.Document {
@@ -13,6 +14,7 @@ interface PreSettlementTransactionDoc extends mongoose.Document {
13
14
  type: PreSettlementTransactionType;
14
15
  amount: number;
15
16
  currency: Fiat | Crypto;
17
+ country: Country;
16
18
  orderId?: string;
17
19
  }
18
20
  interface PreSettlementTransactionModel extends mongoose.Model<PreSettlementTransactionDoc> {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildPreSettlementTransaction = void 0;
4
4
  const common_1 = require("@riocrypto/common");
5
+ const common_2 = require("@riocrypto/common");
5
6
  const buildPreSettlementTransaction = (mongoose) => {
6
7
  // if model is already defined, return it
7
8
  if (mongoose.models.PreSettlementTransaction) {
@@ -13,7 +14,7 @@ const buildPreSettlementTransaction = (mongoose) => {
13
14
  },
14
15
  type: {
15
16
  type: String,
16
- enum: Object.values(common_1.PreSettlementTransactionType),
17
+ enum: Object.values(common_2.PreSettlementTransactionType),
17
18
  },
18
19
  amount: {
19
20
  type: Number,
@@ -21,6 +22,10 @@ const buildPreSettlementTransaction = (mongoose) => {
21
22
  currency: {
22
23
  type: String,
23
24
  },
25
+ country: {
26
+ type: String,
27
+ enum: Object.values(common_1.Country),
28
+ },
24
29
  orderId: {
25
30
  type: String,
26
31
  },
@@ -1,4 +1,4 @@
1
- import { OnboardingStatus, PlatformFeeRange, UserAttribute, UserType, CountryOfOrigin, RiskTier, ImmigrationStatus, Country, Fiat, Crypto, PreSettlementTransactionType } from "@riocrypto/common";
1
+ import { OnboardingStatus, PlatformFeeRange, UserAttribute, UserType, CountryOfOrigin, RiskTier, ImmigrationStatus, Country, Fiat, Crypto } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface UserAttrs {
4
4
  createdAt: Date;
@@ -124,9 +124,9 @@ interface UserAttrs {
124
124
  };
125
125
  };
126
126
  attioRecordId?: string;
127
- preSettlementTransactions?: {
128
- [transactionType in PreSettlementTransactionType]?: {
129
- [currency in Fiat | Crypto]?: string;
127
+ preSettlementAmount?: {
128
+ [country in Country]?: {
129
+ [currency in Fiat | Crypto]?: number;
130
130
  };
131
131
  };
132
132
  }
@@ -258,9 +258,9 @@ interface UserDoc extends Document {
258
258
  };
259
259
  };
260
260
  };
261
- preSettlementTransactions?: {
262
- [transactionType in PreSettlementTransactionType]?: {
263
- [currency in Fiat | Crypto]?: string;
261
+ preSettlementAmount?: {
262
+ [country in Country]?: {
263
+ [currency in Fiat | Crypto]?: number;
264
264
  };
265
265
  };
266
266
  }
@@ -338,7 +338,7 @@ const buildUser = (mongoose) => {
338
338
  },
339
339
  },
340
340
  },
341
- preSettlementTransactions: {
341
+ preSettlementAmount: {
342
342
  type: Object,
343
343
  },
344
344
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2074",
3
+ "version": "1.0.2076",
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.1812",
31
+ "@riocrypto/common": "^1.0.1816",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",