@riocrypto/common 1.0.376 → 1.0.378
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 +7 -1
- package/build/index.js +8 -1
- package/build/middlewares/get-order.d.ts +2 -1
- package/build/middlewares/get-order.js +3 -2
- package/build/middlewares/get-partner.d.ts +2 -1
- package/build/middlewares/get-partner.js +3 -2
- package/build/middlewares/get-user.d.ts +2 -1
- package/build/middlewares/get-user.js +5 -3
- package/build/middlewares/validate-order.d.ts +0 -2
- package/build/middlewares/validate-order.js +19 -26
- package/build/models/admin-auth.d.ts +4 -12
- package/build/models/admin-auth.js +37 -39
- package/build/models/auth.d.ts +5 -5
- package/build/models/auth.js +57 -58
- package/build/models/bank-payout.d.ts +5 -5
- package/build/models/bank-payout.js +36 -37
- package/build/models/business-user.d.ts +5 -5
- package/build/models/business-user.js +97 -98
- package/build/models/order.d.ts +5 -5
- package/build/models/order.js +106 -107
- package/build/models/partner.d.ts +5 -5
- package/build/models/partner.js +55 -56
- package/build/models/user.d.ts +6 -5
- package/build/models/user.js +81 -82
- package/package.json +1 -1
|
@@ -1,105 +1,104 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
8
|
-
const BusinessUserSchema = new
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
kycStatus: {
|
|
64
|
-
type: String,
|
|
65
|
-
required: true,
|
|
66
|
-
},
|
|
67
|
-
COIFile: {
|
|
68
|
-
type: String,
|
|
69
|
-
},
|
|
70
|
-
KYCReportFile: {
|
|
71
|
-
type: String,
|
|
72
|
-
},
|
|
73
|
-
brokerId: {
|
|
74
|
-
type: String,
|
|
75
|
-
},
|
|
76
|
-
platformFeeRanges: [
|
|
77
|
-
{
|
|
78
|
-
min: {
|
|
79
|
-
type: Number,
|
|
80
|
-
required: true,
|
|
3
|
+
exports.buildBusinessUser = void 0;
|
|
4
|
+
const buildBusinessUser = (mongoose) => {
|
|
5
|
+
const BusinessUserSchema = new mongoose.Schema({
|
|
6
|
+
type: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
companyName: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
legalRepresentative: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
phoneNumber: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
email: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
street1: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
street2: {
|
|
31
|
+
type: String,
|
|
32
|
+
},
|
|
33
|
+
city: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
state: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
postalCode: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
country: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
language: {
|
|
50
|
+
type: String,
|
|
51
|
+
},
|
|
52
|
+
cpf: {
|
|
53
|
+
type: String,
|
|
54
|
+
},
|
|
55
|
+
attributes: [
|
|
56
|
+
{
|
|
57
|
+
type: String,
|
|
81
58
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
59
|
+
],
|
|
60
|
+
kycStatus: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
COIFile: {
|
|
65
|
+
type: String,
|
|
66
|
+
},
|
|
67
|
+
KYCReportFile: {
|
|
68
|
+
type: String,
|
|
69
|
+
},
|
|
70
|
+
brokerId: {
|
|
71
|
+
type: String,
|
|
72
|
+
},
|
|
73
|
+
platformFeeRanges: [
|
|
74
|
+
{
|
|
75
|
+
min: {
|
|
76
|
+
type: Number,
|
|
77
|
+
required: true,
|
|
78
|
+
},
|
|
79
|
+
max: {
|
|
80
|
+
type: Number,
|
|
81
|
+
required: true,
|
|
82
|
+
},
|
|
83
|
+
fee: {
|
|
84
|
+
type: Number,
|
|
85
|
+
required: true,
|
|
86
|
+
},
|
|
85
87
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
],
|
|
89
|
+
}, {
|
|
90
|
+
toJSON: {
|
|
91
|
+
transform(doc, ret) {
|
|
92
|
+
ret.id = ret._id;
|
|
93
|
+
delete ret._id;
|
|
94
|
+
delete ret.__v;
|
|
89
95
|
},
|
|
90
96
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
delete ret.__v;
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
BusinessUserSchema.statics.build = (attrs) => {
|
|
102
|
-
return new BusinessUser(attrs);
|
|
97
|
+
});
|
|
98
|
+
BusinessUserSchema.statics.build = (attrs) => {
|
|
99
|
+
return new BusinessUser(attrs);
|
|
100
|
+
};
|
|
101
|
+
const BusinessUser = mongoose.model("BusinessUser", BusinessUserSchema);
|
|
102
|
+
return BusinessUser;
|
|
103
103
|
};
|
|
104
|
-
|
|
105
|
-
exports.BusinessUser = BusinessUser;
|
|
104
|
+
exports.buildBusinessUser = buildBusinessUser;
|
package/build/models/order.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
1
|
import { Country } from "../types/country";
|
|
3
2
|
import { Fees } from "../types/fees";
|
|
4
3
|
import { Fiat } from "../types/fiat";
|
|
@@ -9,6 +8,7 @@ import { PayoutMethod } from "../types/payout-method";
|
|
|
9
8
|
import { Processor } from "../types/processor";
|
|
10
9
|
import { Side } from "../types/side";
|
|
11
10
|
import { USState } from "../types/us-state";
|
|
11
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
12
12
|
interface OrderAttrs {
|
|
13
13
|
userId: string;
|
|
14
14
|
crypto: Crypto;
|
|
@@ -34,7 +34,7 @@ interface OrderAttrs {
|
|
|
34
34
|
addressVerified?: boolean;
|
|
35
35
|
brokerCustomerId?: string;
|
|
36
36
|
}
|
|
37
|
-
interface OrderDoc extends
|
|
37
|
+
interface OrderDoc extends Document {
|
|
38
38
|
userId: string;
|
|
39
39
|
status: OrderStatus;
|
|
40
40
|
crypto: Crypto;
|
|
@@ -59,8 +59,8 @@ interface OrderDoc extends mongoose.Document {
|
|
|
59
59
|
addressVerified?: boolean;
|
|
60
60
|
brokerCustomerId?: string;
|
|
61
61
|
}
|
|
62
|
-
interface OrderModel extends
|
|
62
|
+
interface OrderModel extends Model<OrderDoc> {
|
|
63
63
|
build(attrs: OrderAttrs): OrderDoc;
|
|
64
64
|
}
|
|
65
|
-
declare const
|
|
66
|
-
export {
|
|
65
|
+
declare const buildOrder: (mongoose: Mongoose) => OrderModel;
|
|
66
|
+
export { buildOrder, OrderDoc };
|
package/build/models/order.js
CHANGED
|
@@ -1,120 +1,119 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
8
|
-
const orderSchema = new
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
status: {
|
|
14
|
-
type: String,
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
crypto: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
side: {
|
|
22
|
-
type: String,
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
|
-
fiat: {
|
|
26
|
-
type: String,
|
|
27
|
-
required: true,
|
|
28
|
-
},
|
|
29
|
-
paymentMethod: {
|
|
30
|
-
type: String,
|
|
31
|
-
},
|
|
32
|
-
payoutMethod: {
|
|
33
|
-
type: String,
|
|
34
|
-
},
|
|
35
|
-
createdAt: {
|
|
36
|
-
type: mongoose_1.default.Schema.Types.Date,
|
|
37
|
-
required: true,
|
|
38
|
-
},
|
|
39
|
-
cryptoAddress: {
|
|
40
|
-
type: String,
|
|
41
|
-
required: true,
|
|
42
|
-
},
|
|
43
|
-
country: {
|
|
44
|
-
type: String,
|
|
45
|
-
required: true,
|
|
46
|
-
},
|
|
47
|
-
state: {
|
|
48
|
-
type: String,
|
|
49
|
-
required: true,
|
|
50
|
-
},
|
|
51
|
-
amountFiat: {
|
|
52
|
-
type: Number,
|
|
53
|
-
},
|
|
54
|
-
amountCrypto: {
|
|
55
|
-
type: Number,
|
|
56
|
-
},
|
|
57
|
-
processor: {
|
|
58
|
-
type: String,
|
|
59
|
-
},
|
|
60
|
-
liquidityProvider: {
|
|
61
|
-
type: String,
|
|
62
|
-
},
|
|
63
|
-
depositTxId: {
|
|
64
|
-
type: String,
|
|
65
|
-
},
|
|
66
|
-
withdrawalTxId: {
|
|
67
|
-
type: String,
|
|
68
|
-
},
|
|
69
|
-
depositAddress: {
|
|
70
|
-
type: String,
|
|
71
|
-
},
|
|
72
|
-
fees: {
|
|
73
|
-
processingFeeCrypto: {
|
|
74
|
-
type: Number,
|
|
3
|
+
exports.buildOrder = void 0;
|
|
4
|
+
const buildOrder = (mongoose) => {
|
|
5
|
+
const orderSchema = new mongoose.Schema({
|
|
6
|
+
userId: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
75
9
|
},
|
|
76
|
-
|
|
77
|
-
type:
|
|
10
|
+
status: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
78
13
|
},
|
|
79
|
-
|
|
80
|
-
type:
|
|
14
|
+
crypto: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
81
17
|
},
|
|
82
|
-
|
|
83
|
-
type:
|
|
18
|
+
side: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
fiat: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
paymentMethod: {
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
|
+
payoutMethod: {
|
|
30
|
+
type: String,
|
|
31
|
+
},
|
|
32
|
+
createdAt: {
|
|
33
|
+
type: mongoose.Schema.Types.Date,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
cryptoAddress: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
country: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
84
43
|
},
|
|
85
|
-
|
|
44
|
+
state: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
amountFiat: {
|
|
86
49
|
type: Number,
|
|
87
50
|
},
|
|
88
|
-
|
|
51
|
+
amountCrypto: {
|
|
89
52
|
type: Number,
|
|
90
53
|
},
|
|
91
|
-
|
|
54
|
+
processor: {
|
|
55
|
+
type: String,
|
|
56
|
+
},
|
|
57
|
+
liquidityProvider: {
|
|
58
|
+
type: String,
|
|
59
|
+
},
|
|
60
|
+
depositTxId: {
|
|
61
|
+
type: String,
|
|
62
|
+
},
|
|
63
|
+
withdrawalTxId: {
|
|
64
|
+
type: String,
|
|
65
|
+
},
|
|
66
|
+
depositAddress: {
|
|
67
|
+
type: String,
|
|
68
|
+
},
|
|
69
|
+
fees: {
|
|
70
|
+
processingFeeCrypto: {
|
|
71
|
+
type: Number,
|
|
72
|
+
},
|
|
73
|
+
transferFeeCrypto: {
|
|
74
|
+
type: Number,
|
|
75
|
+
},
|
|
76
|
+
platformFeeCrypto: {
|
|
77
|
+
type: Number,
|
|
78
|
+
},
|
|
79
|
+
processingFeeFiat: {
|
|
80
|
+
type: Number,
|
|
81
|
+
},
|
|
82
|
+
transferFeeFiat: {
|
|
83
|
+
type: Number,
|
|
84
|
+
},
|
|
85
|
+
platformFeeFiat: {
|
|
86
|
+
type: Number,
|
|
87
|
+
},
|
|
88
|
+
partnerFeeFiat: {
|
|
89
|
+
type: Number,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
price: {
|
|
92
93
|
type: Number,
|
|
93
94
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return new Order(attrs);
|
|
95
|
+
partnerId: {
|
|
96
|
+
type: String,
|
|
97
|
+
},
|
|
98
|
+
addressVerified: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
},
|
|
101
|
+
brokerCustomerId: {
|
|
102
|
+
type: String,
|
|
103
|
+
},
|
|
104
|
+
}, {
|
|
105
|
+
toJSON: {
|
|
106
|
+
transform(doc, ret) {
|
|
107
|
+
ret.id = ret._id;
|
|
108
|
+
delete ret._id;
|
|
109
|
+
delete ret.__v;
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
orderSchema.statics.build = (attrs) => {
|
|
114
|
+
return new Order(attrs);
|
|
115
|
+
};
|
|
116
|
+
const Order = mongoose.model("Order", orderSchema);
|
|
117
|
+
return Order;
|
|
118
118
|
};
|
|
119
|
-
|
|
120
|
-
exports.Order = Order;
|
|
119
|
+
exports.buildOrder = buildOrder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
1
|
import { PartnerStatus } from "../types/partner-status";
|
|
2
|
+
import { Mongoose, Document, Model } from "mongoose";
|
|
3
3
|
interface PartnerAttrs {
|
|
4
4
|
name: string;
|
|
5
5
|
status: PartnerStatus;
|
|
@@ -13,7 +13,7 @@ interface PartnerAttrs {
|
|
|
13
13
|
id: string;
|
|
14
14
|
}[];
|
|
15
15
|
}
|
|
16
|
-
interface PartnerDoc extends
|
|
16
|
+
interface PartnerDoc extends Document {
|
|
17
17
|
name: string;
|
|
18
18
|
status: PartnerStatus;
|
|
19
19
|
partnerFee: number;
|
|
@@ -26,8 +26,8 @@ interface PartnerDoc extends mongoose.Document {
|
|
|
26
26
|
id: string;
|
|
27
27
|
}[];
|
|
28
28
|
}
|
|
29
|
-
interface PartnerModel extends
|
|
29
|
+
interface PartnerModel extends Model<PartnerDoc> {
|
|
30
30
|
build(attrs: PartnerAttrs): PartnerDoc;
|
|
31
31
|
}
|
|
32
|
-
declare const
|
|
33
|
-
export {
|
|
32
|
+
declare const buildPartner: (mongoose: Mongoose) => PartnerModel;
|
|
33
|
+
export { buildPartner, PartnerDoc };
|
package/build/models/partner.js
CHANGED
|
@@ -1,62 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
8
|
-
const PartnerSchema = new
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
3
|
+
exports.buildPartner = void 0;
|
|
4
|
+
const buildPartner = (mongoose) => {
|
|
5
|
+
const PartnerSchema = new mongoose.Schema({
|
|
6
|
+
name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
status: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
partnerFee: {
|
|
15
|
+
type: Number,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
platformFee: {
|
|
19
|
+
type: Number,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
color: {
|
|
23
|
+
type: String,
|
|
24
|
+
},
|
|
25
|
+
logo: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
apiKeys: [
|
|
29
|
+
{
|
|
30
|
+
value: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
id: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
39
41
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
],
|
|
43
|
+
}, {
|
|
44
|
+
toJSON: {
|
|
45
|
+
transform(doc, ret) {
|
|
46
|
+
ret.id = ret._id;
|
|
47
|
+
delete ret._id;
|
|
48
|
+
delete ret.__v;
|
|
49
|
+
ret.apiKeys.forEach((apiKey) => {
|
|
50
|
+
delete apiKey.value;
|
|
51
|
+
});
|
|
43
52
|
},
|
|
44
53
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
delete ret.__v;
|
|
52
|
-
ret.apiKeys.forEach((apiKey) => {
|
|
53
|
-
delete apiKey.value;
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
PartnerSchema.statics.build = (attrs) => {
|
|
59
|
-
return new Partner(attrs);
|
|
54
|
+
});
|
|
55
|
+
PartnerSchema.statics.build = (attrs) => {
|
|
56
|
+
return new Partner(attrs);
|
|
57
|
+
};
|
|
58
|
+
const Partner = mongoose.model("Partner", PartnerSchema);
|
|
59
|
+
return Partner;
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
exports.Partner = Partner;
|
|
61
|
+
exports.buildPartner = buildPartner;
|
package/build/models/user.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
1
|
import { Country } from "../types/country";
|
|
3
2
|
import { KYCStatus } from "../types/kyc-status";
|
|
4
3
|
import { Language } from "../types/language";
|
|
5
4
|
import { USState } from "../types/us-state";
|
|
6
5
|
import { UserAttribute } from "../types/user-attribute";
|
|
7
6
|
import { UserType } from "../types/user-type";
|
|
7
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
8
8
|
interface UserAttrs {
|
|
9
9
|
type: UserType;
|
|
10
10
|
firstName: string;
|
|
@@ -24,10 +24,11 @@ interface UserAttrs {
|
|
|
24
24
|
attributes?: UserAttribute[];
|
|
25
25
|
partnerId?: string;
|
|
26
26
|
}
|
|
27
|
-
interface UserModel extends
|
|
27
|
+
interface UserModel extends Model<UserDoc> {
|
|
28
28
|
build(attrs: UserAttrs): UserDoc;
|
|
29
29
|
}
|
|
30
|
-
interface UserDoc extends
|
|
30
|
+
interface UserDoc extends Document {
|
|
31
|
+
_id: string;
|
|
31
32
|
type: UserType;
|
|
32
33
|
firstName: string;
|
|
33
34
|
lastName: string;
|
|
@@ -46,5 +47,5 @@ interface UserDoc extends mongoose.Document {
|
|
|
46
47
|
attributes?: UserAttribute[];
|
|
47
48
|
partnerId?: string;
|
|
48
49
|
}
|
|
49
|
-
declare const
|
|
50
|
-
export {
|
|
50
|
+
declare const buildUser: (mongoose: Mongoose) => UserModel;
|
|
51
|
+
export { buildUser, UserDoc };
|