@riocrypto/common-server 1.0.1633 → 1.0.1634

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
@@ -56,6 +56,7 @@ export * from "./models/bid";
56
56
  export * from "./models/rio-bank-account";
57
57
  export * from "./models/address-verification";
58
58
  export * from "./models/bank-account-verification";
59
+ export * from "./models/coincover-transaction";
59
60
  export * from "./clients/bitstamp-client";
60
61
  export * from "./clients/ccxt-client";
61
62
  export * from "./clients/slack-client";
package/build/index.js CHANGED
@@ -72,6 +72,7 @@ __exportStar(require("./models/bid"), exports);
72
72
  __exportStar(require("./models/rio-bank-account"), exports);
73
73
  __exportStar(require("./models/address-verification"), exports);
74
74
  __exportStar(require("./models/bank-account-verification"), exports);
75
+ __exportStar(require("./models/coincover-transaction"), exports);
75
76
  __exportStar(require("./clients/bitstamp-client"), exports);
76
77
  __exportStar(require("./clients/ccxt-client"), exports);
77
78
  __exportStar(require("./clients/slack-client"), exports);
@@ -0,0 +1,19 @@
1
+ import { Mongoose, Model, Document } from "mongoose";
2
+ interface CoincoverTransactionAttrs {
3
+ coincoverTransactionId: string;
4
+ status: "GREEN" | "RED";
5
+ rejectionCode?: string;
6
+ orderId?: string;
7
+ }
8
+ interface CoincoverTransactionModel extends Model<CoincoverTransactionDoc> {
9
+ build(attrs: CoincoverTransactionAttrs): CoincoverTransactionDoc;
10
+ }
11
+ interface CoincoverTransactionDoc extends Document {
12
+ _id: string;
13
+ coincoverTransactionId: string;
14
+ status: "GREEN" | "RED";
15
+ rejectionCode?: string;
16
+ orderId?: string;
17
+ }
18
+ declare const buildCoincoverTransaction: (mongoose: Mongoose) => CoincoverTransactionModel;
19
+ export { buildCoincoverTransaction, CoincoverTransactionDoc, CoincoverTransactionAttrs, };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildCoincoverTransaction = void 0;
4
+ const buildCoincoverTransaction = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.CoincoverTransaction) {
7
+ return mongoose.model("CoincoverTransaction");
8
+ }
9
+ const CoincoverTransactionSchema = new mongoose.Schema({
10
+ coincoverTransactionId: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ status: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ rejectionCode: {
19
+ type: String,
20
+ },
21
+ orderId: {
22
+ type: String,
23
+ },
24
+ }, {
25
+ toJSON: {
26
+ transform(doc, ret) {
27
+ ret.id = ret._id.valueOf();
28
+ delete ret._id;
29
+ delete ret.__v;
30
+ },
31
+ },
32
+ });
33
+ CoincoverTransactionSchema.statics.build = (attrs) => {
34
+ return new CoincoverTransaction(attrs);
35
+ };
36
+ const CoincoverTransaction = mongoose.model("CoincoverTransaction", CoincoverTransactionSchema);
37
+ return CoincoverTransaction;
38
+ };
39
+ exports.buildCoincoverTransaction = buildCoincoverTransaction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1633",
3
+ "version": "1.0.1634",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",