@riocrypto/common-server 1.0.2076 → 1.0.2078

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,20 @@
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
+ createdAt: Date;
5
6
  userId: string;
6
7
  type: PreSettlementTransactionType;
7
8
  amount: number;
8
- currency: Fiat | Crypto;
9
- country: Country;
9
+ currency: CurrencyWithCountry;
10
10
  orderId?: string;
11
11
  }
12
12
  interface PreSettlementTransactionDoc extends mongoose.Document {
13
+ createdAt: Date;
13
14
  userId: string;
14
15
  type: PreSettlementTransactionType;
15
16
  amount: number;
16
- currency: Fiat | Crypto;
17
- country: Country;
17
+ currency: CurrencyWithCountry;
18
18
  orderId?: string;
19
19
  }
20
20
  interface PreSettlementTransactionModel extends mongoose.Model<PreSettlementTransactionDoc> {
@@ -2,19 +2,21 @@
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) {
9
8
  return mongoose.model("PreSettlementTransaction");
10
9
  }
11
10
  const PreSettlementTransactionSchema = new mongoose.Schema({
11
+ createdAt: {
12
+ type: Date,
13
+ },
12
14
  userId: {
13
15
  type: String,
14
16
  },
15
17
  type: {
16
18
  type: String,
17
- enum: Object.values(common_2.PreSettlementTransactionType),
19
+ enum: Object.values(common_1.PreSettlementTransactionType),
18
20
  },
19
21
  amount: {
20
22
  type: Number,
@@ -22,10 +24,6 @@ const buildPreSettlementTransaction = (mongoose) => {
22
24
  currency: {
23
25
  type: String,
24
26
  },
25
- country: {
26
- type: String,
27
- enum: Object.values(common_1.Country),
28
- },
29
27
  orderId: {
30
28
  type: String,
31
29
  },
@@ -1,4 +1,4 @@
1
- import { OnboardingStatus, PlatformFeeRange, UserAttribute, UserType, CountryOfOrigin, RiskTier, ImmigrationStatus, Country, Fiat, Crypto } 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;
@@ -125,9 +125,7 @@ interface UserAttrs {
125
125
  };
126
126
  attioRecordId?: string;
127
127
  preSettlementAmount?: {
128
- [country in Country]?: {
129
- [currency in Fiat | Crypto]?: number;
130
- };
128
+ [currency in CurrencyWithCountry]?: number;
131
129
  };
132
130
  }
133
131
  interface UserModel extends Model<UserDoc> {
@@ -259,9 +257,7 @@ interface UserDoc extends Document {
259
257
  };
260
258
  };
261
259
  preSettlementAmount?: {
262
- [country in Country]?: {
263
- [currency in Fiat | Crypto]?: number;
264
- };
260
+ [currency in CurrencyWithCountry]?: number;
265
261
  };
266
262
  }
267
263
  declare const buildUser: (mongoose: Mongoose) => UserModel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2076",
3
+ "version": "1.0.2078",
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.1820",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",