@riocrypto/common-server 1.0.538 → 1.0.540

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
@@ -19,6 +19,7 @@ export * from "./models/admin-auth";
19
19
  export * from "./models/auth";
20
20
  export * from "./models/business-user";
21
21
  export * from "./models/bank-payout";
22
+ export * from "./models/bank-payment";
22
23
  export * from "./models/order";
23
24
  export * from "./models/partner";
24
25
  export * from "./models/user";
package/build/index.js CHANGED
@@ -35,6 +35,7 @@ __exportStar(require("./models/admin-auth"), exports);
35
35
  __exportStar(require("./models/auth"), exports);
36
36
  __exportStar(require("./models/business-user"), exports);
37
37
  __exportStar(require("./models/bank-payout"), exports);
38
+ __exportStar(require("./models/bank-payment"), exports);
38
39
  __exportStar(require("./models/order"), exports);
39
40
  __exportStar(require("./models/partner"), exports);
40
41
  __exportStar(require("./models/user"), exports);
@@ -0,0 +1,32 @@
1
+ import { Mongoose, Model, Document } from "mongoose";
2
+ interface BankPaymentAttrs {
3
+ orderId: string;
4
+ bankName: string;
5
+ companyName: string;
6
+ bankAddress: string;
7
+ accountNumber: string;
8
+ reference: string;
9
+ clabe?: string;
10
+ ruc?: string;
11
+ rfc?: string;
12
+ swiftCode?: string;
13
+ status: string;
14
+ }
15
+ interface BankPaymentDoc extends Document {
16
+ orderId: string;
17
+ bankName: string;
18
+ companyName: string;
19
+ bankAddress: string;
20
+ accountNumber: string;
21
+ reference: string;
22
+ clabe?: string;
23
+ ruc?: string;
24
+ rfc?: string;
25
+ swiftCode?: string;
26
+ status: string;
27
+ }
28
+ interface BankPaymentModel extends Model<BankPaymentDoc> {
29
+ build(attrs: BankPaymentAttrs): BankPaymentDoc;
30
+ }
31
+ declare const buildBankPayment: (mongoose: Mongoose) => BankPaymentModel;
32
+ export { buildBankPayment, BankPaymentDoc };
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildBankPayment = void 0;
4
+ const buildBankPayment = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.BankPayment) {
7
+ return mongoose.model("BankPayment");
8
+ }
9
+ const BankPaymentSchema = new mongoose.Schema({
10
+ orderId: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ bankName: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ companyName: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ bankAddress: {
23
+ type: String,
24
+ required: true,
25
+ },
26
+ accountNumber: {
27
+ type: String,
28
+ required: true,
29
+ },
30
+ status: {
31
+ type: String,
32
+ required: true,
33
+ },
34
+ reference: {
35
+ type: String,
36
+ required: true,
37
+ },
38
+ clabe: {
39
+ type: String,
40
+ },
41
+ ruc: {
42
+ type: String,
43
+ },
44
+ rfc: {
45
+ type: String,
46
+ },
47
+ swiftCode: {
48
+ type: String,
49
+ },
50
+ }, {
51
+ toJSON: {
52
+ transform(doc, ret) {
53
+ ret.id = ret._id.valueOf();
54
+ delete ret._id;
55
+ delete ret.__v;
56
+ },
57
+ },
58
+ });
59
+ BankPaymentSchema.statics.build = (attrs) => {
60
+ return new BankPayment(attrs);
61
+ };
62
+ const BankPayment = mongoose.model("BankPayment", BankPaymentSchema);
63
+ return BankPayment;
64
+ };
65
+ exports.buildBankPayment = buildBankPayment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.538",
3
+ "version": "1.0.540",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@aws-sdk/client-s3": "^3.297.0",
25
- "@riocrypto/common": "^1.0.539",
25
+ "@riocrypto/common": "^1.0.540",
26
26
  "@types/express": "^4.17.13",
27
27
  "axios": "^0.27.2",
28
28
  "ccxt": "^3.0.30",