@riocrypto/common-server 1.0.854 → 1.0.855

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.
@@ -0,0 +1,27 @@
1
+ import { Mongoose, Model, Document } from "mongoose";
2
+ interface BridgeCustomerAttrs {
3
+ bridgeId: string;
4
+ type: "individual" | "business";
5
+ first_name: string;
6
+ last_name: string;
7
+ email: string;
8
+ phone: string;
9
+ requirements_due?: string[];
10
+ future_requirements_due?: string[];
11
+ }
12
+ interface BridgeCustomerModel extends Model<BridgeCustomerDoc> {
13
+ build(attrs: BridgeCustomerAttrs): BridgeCustomerDoc;
14
+ }
15
+ interface BridgeCustomerDoc extends Document {
16
+ _id: string;
17
+ bridgeId: string;
18
+ type: "individual" | "business";
19
+ first_name: string;
20
+ last_name: string;
21
+ email: string;
22
+ phone: string;
23
+ requirements_due?: string[];
24
+ future_requirements_due?: string[];
25
+ }
26
+ declare const buildBridgeCustomer: (mongoose: Mongoose) => BridgeCustomerModel;
27
+ export { buildBridgeCustomer, BridgeCustomerDoc };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildBridgeCustomer = void 0;
4
+ const buildBridgeCustomer = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.BridgeCustomer) {
7
+ return mongoose.model("BridgeCustomer");
8
+ }
9
+ const bridgeCustomerSchema = new mongoose.Schema({
10
+ bridgeId: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ type: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ first_name: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ last_name: {
23
+ type: String,
24
+ required: true,
25
+ },
26
+ phone: {
27
+ type: String,
28
+ required: true,
29
+ },
30
+ }, {
31
+ toJSON: {
32
+ transform(doc, ret) {
33
+ ret.id = ret._id.valueOf();
34
+ delete ret._id;
35
+ delete ret.__v;
36
+ },
37
+ },
38
+ });
39
+ bridgeCustomerSchema.statics.build = (attrs) => {
40
+ return new BridgeCustomer(attrs);
41
+ };
42
+ const BridgeCustomer = mongoose.model("BridgeCustomer", bridgeCustomerSchema);
43
+ return BridgeCustomer;
44
+ };
45
+ exports.buildBridgeCustomer = buildBridgeCustomer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.854",
3
+ "version": "1.0.855",
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.739",
27
+ "@riocrypto/common": "^1.0.740",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",