@riocrypto/common-server 1.0.1596 → 1.0.1597

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.
package/build/index.d.ts CHANGED
@@ -53,6 +53,7 @@ export * from "./models/telegram-session";
53
53
  export * from "./models/UBO";
54
54
  export * from "./models/temporary-verification";
55
55
  export * from "./models/bid";
56
+ export * from "./models/rio-bank-account";
56
57
  export * from "./clients/bitstamp-client";
57
58
  export * from "./clients/ccxt-client";
58
59
  export * from "./clients/slack-client";
package/build/index.js CHANGED
@@ -69,6 +69,7 @@ __exportStar(require("./models/telegram-session"), exports);
69
69
  __exportStar(require("./models/UBO"), exports);
70
70
  __exportStar(require("./models/temporary-verification"), exports);
71
71
  __exportStar(require("./models/bid"), exports);
72
+ __exportStar(require("./models/rio-bank-account"), exports);
72
73
  __exportStar(require("./clients/bitstamp-client"), exports);
73
74
  __exportStar(require("./clients/ccxt-client"), exports);
74
75
  __exportStar(require("./clients/slack-client"), exports);
@@ -0,0 +1,35 @@
1
+ import { Country, Fiat } from "@riocrypto/common";
2
+ import { Mongoose, Model, Document } from "mongoose";
3
+ interface RioBankAccountAttrs {
4
+ country: Country;
5
+ fiat: Fiat;
6
+ bankName?: string;
7
+ companyName?: string;
8
+ companyAddress?: string;
9
+ bankAddress?: string;
10
+ accountNumber?: string;
11
+ routingNumber?: string;
12
+ CLABE?: string;
13
+ RUC?: string;
14
+ RFC?: string;
15
+ CCI?: string;
16
+ }
17
+ interface RioBankAccountDoc extends Document {
18
+ country: Country;
19
+ fiat: Fiat;
20
+ bankName?: string;
21
+ companyName?: string;
22
+ companyAddress?: string;
23
+ bankAddress?: string;
24
+ accountNumber?: string;
25
+ routingNumber?: string;
26
+ CLABE?: string;
27
+ RUC?: string;
28
+ RFC?: string;
29
+ CCI?: string;
30
+ }
31
+ interface RioBankAccountModel extends Model<RioBankAccountDoc> {
32
+ build(attrs: RioBankAccountAttrs): RioBankAccountDoc;
33
+ }
34
+ declare const buildRioBankAccount: (mongoose: Mongoose) => RioBankAccountModel;
35
+ export { buildRioBankAccount, RioBankAccountDoc, RioBankAccountAttrs };
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildRioBankAccount = void 0;
4
+ const buildRioBankAccount = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.RioBankAccount) {
7
+ return mongoose.model("RioBankAccount");
8
+ }
9
+ const RioBankAccountSchema = new mongoose.Schema({
10
+ country: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ fiat: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ bankName: {
19
+ type: String,
20
+ },
21
+ companyName: {
22
+ type: String,
23
+ },
24
+ companyAddress: {
25
+ type: String,
26
+ },
27
+ bankAddress: {
28
+ type: String,
29
+ },
30
+ accountNumber: {
31
+ type: String,
32
+ },
33
+ routingNumber: {
34
+ type: String,
35
+ },
36
+ CLABE: {
37
+ type: String,
38
+ },
39
+ RUC: {
40
+ type: String,
41
+ },
42
+ RFC: {
43
+ type: String,
44
+ },
45
+ CCI: {
46
+ type: String,
47
+ },
48
+ }, {
49
+ toJSON: {
50
+ transform(doc, ret) {
51
+ ret.id = ret._id.valueOf();
52
+ delete ret._id;
53
+ delete ret.__v;
54
+ },
55
+ },
56
+ });
57
+ RioBankAccountSchema.statics.build = (attrs) => {
58
+ return new RioBankAccount(attrs);
59
+ };
60
+ const RioBankAccount = mongoose.model("RioBankAccount", RioBankAccountSchema);
61
+ return RioBankAccount;
62
+ };
63
+ exports.buildRioBankAccount = buildRioBankAccount;
@@ -1,4 +1,4 @@
1
- import { OnboardingStatus, PlatformFeeRange, UserAttribute, UserType, CountryOfOrigin, RiskTier, ImmigrationStatus } from "@riocrypto/common";
1
+ import { OnboardingStatus, PlatformFeeRange, UserAttribute, UserType, CountryOfOrigin, RiskTier, ImmigrationStatus, Country } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface UserAttrs {
4
4
  createdAt: Date;
@@ -96,6 +96,11 @@ interface UserAttrs {
96
96
  };
97
97
  quotationTime?: number;
98
98
  referrerId?: string;
99
+ rioBankAccount?: {
100
+ [country in Country]?: {
101
+ id: string;
102
+ };
103
+ };
99
104
  }
100
105
  interface UserModel extends Model<UserDoc> {
101
106
  build(attrs: UserAttrs): UserDoc;
@@ -197,6 +202,11 @@ interface UserDoc extends Document {
197
202
  };
198
203
  quotationTime?: number;
199
204
  referrerId?: string;
205
+ rioBankAccount?: {
206
+ [country in Country]?: {
207
+ id: string;
208
+ };
209
+ };
200
210
  }
201
211
  declare const buildUser: (mongoose: Mongoose) => UserModel;
202
212
  export { buildUser, UserDoc, UserAttrs };
@@ -227,6 +227,33 @@ const buildUser = (mongoose) => {
227
227
  type: String,
228
228
  },
229
229
  ],
230
+ rioBankAccount: {
231
+ MX: {
232
+ id: {
233
+ type: String,
234
+ },
235
+ },
236
+ US: {
237
+ id: {
238
+ type: String,
239
+ },
240
+ },
241
+ PE: {
242
+ id: {
243
+ type: String,
244
+ },
245
+ },
246
+ CO: {
247
+ id: {
248
+ type: String,
249
+ },
250
+ },
251
+ BR: {
252
+ id: {
253
+ type: String,
254
+ },
255
+ },
256
+ },
230
257
  referrerId: {
231
258
  type: String,
232
259
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1596",
3
+ "version": "1.0.1597",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/storage": "^6.9.5",
29
29
  "@google-cloud/vision": "^4.0.2",
30
30
  "@hyperdx/node-opentelemetry": "^0.4.2",
31
- "@riocrypto/common": "^1.0.1433",
31
+ "@riocrypto/common": "^1.0.1436",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.6.0",
34
34
  "ccxt": "^3.0.30",