@riocrypto/common-server 1.0.2075 → 1.0.2077

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,20 +1,18 @@
1
- import { Fiat, Crypto, Country } from "@riocrypto/common";
1
+ import { CurrencyWithCountry } from "@riocrypto/common";
2
2
  import { PreSettlementTransactionType } from "@riocrypto/common";
3
3
  import mongoose from "mongoose";
4
4
  interface PreSettlementTransactionAttrs {
5
5
  userId: string;
6
6
  type: PreSettlementTransactionType;
7
7
  amount: number;
8
- currency: Fiat | Crypto;
9
- country: Country;
8
+ currency: CurrencyWithCountry;
10
9
  orderId?: string;
11
10
  }
12
11
  interface PreSettlementTransactionDoc extends mongoose.Document {
13
12
  userId: string;
14
13
  type: PreSettlementTransactionType;
15
14
  amount: number;
16
- currency: Fiat | Crypto;
17
- country: Country;
15
+ currency: CurrencyWithCountry;
18
16
  orderId?: string;
19
17
  }
20
18
  interface PreSettlementTransactionModel extends mongoose.Model<PreSettlementTransactionDoc> {
@@ -2,7 +2,6 @@
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");
6
5
  const buildPreSettlementTransaction = (mongoose) => {
7
6
  // if model is already defined, return it
8
7
  if (mongoose.models.PreSettlementTransaction) {
@@ -14,7 +13,7 @@ const buildPreSettlementTransaction = (mongoose) => {
14
13
  },
15
14
  type: {
16
15
  type: String,
17
- enum: Object.values(common_2.PreSettlementTransactionType),
16
+ enum: Object.values(common_1.PreSettlementTransactionType),
18
17
  },
19
18
  amount: {
20
19
  type: Number,
@@ -22,10 +21,6 @@ const buildPreSettlementTransaction = (mongoose) => {
22
21
  currency: {
23
22
  type: String,
24
23
  },
25
- country: {
26
- type: String,
27
- enum: Object.values(common_1.Country),
28
- },
29
24
  orderId: {
30
25
  type: String,
31
26
  },
@@ -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, CurrencyWithCountry } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface UserAttrs {
4
4
  createdAt: Date;
@@ -124,10 +124,8 @@ interface UserAttrs {
124
124
  };
125
125
  };
126
126
  attioRecordId?: string;
127
- preSettlementTransactions?: {
128
- [transactionType in PreSettlementTransactionType]?: {
129
- [currency in Fiat | Crypto]?: string;
130
- };
127
+ preSettlementAmount?: {
128
+ [currency in CurrencyWithCountry]?: number;
131
129
  };
132
130
  }
133
131
  interface UserModel extends Model<UserDoc> {
@@ -258,10 +256,8 @@ interface UserDoc extends Document {
258
256
  };
259
257
  };
260
258
  };
261
- preSettlementTransactions?: {
262
- [transactionType in PreSettlementTransactionType]?: {
263
- [currency in Fiat | Crypto]?: string;
264
- };
259
+ preSettlementAmount?: {
260
+ [currency in CurrencyWithCountry]?: number;
265
261
  };
266
262
  }
267
263
  declare const buildUser: (mongoose: Mongoose) => UserModel;
@@ -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.2075",
3
+ "version": "1.0.2077",
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.1816",
31
+ "@riocrypto/common": "^1.0.1818",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",