@riocrypto/common-server 1.0.1021 → 1.0.1022
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 +1 -0
- package/build/index.js +1 -0
- package/build/models/invoice.d.ts +27 -0
- package/build/models/invoice.js +55 -0
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./models/bridge-external-account";
|
|
|
36
36
|
export * from "./models/bridge-liquidation-address";
|
|
37
37
|
export * from "./models/admin-task";
|
|
38
38
|
export * from "./models/master-order-record";
|
|
39
|
+
export * from "./models/invoice";
|
|
39
40
|
export * from "./clients/bitstamp-client";
|
|
40
41
|
export * from "./clients/ccxt-client";
|
|
41
42
|
export * from "./clients/kushki-client";
|
package/build/index.js
CHANGED
|
@@ -52,6 +52,7 @@ __exportStar(require("./models/bridge-external-account"), exports);
|
|
|
52
52
|
__exportStar(require("./models/bridge-liquidation-address"), exports);
|
|
53
53
|
__exportStar(require("./models/admin-task"), exports);
|
|
54
54
|
__exportStar(require("./models/master-order-record"), exports);
|
|
55
|
+
__exportStar(require("./models/invoice"), exports);
|
|
55
56
|
__exportStar(require("./clients/bitstamp-client"), exports);
|
|
56
57
|
__exportStar(require("./clients/ccxt-client"), exports);
|
|
57
58
|
__exportStar(require("./clients/kushki-client"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Country } from "@riocrypto/common";
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
interface InvoiceAttrs {
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
userId: string;
|
|
6
|
+
orderId: string;
|
|
7
|
+
country: Country;
|
|
8
|
+
provider: string;
|
|
9
|
+
providerId: string;
|
|
10
|
+
pdfUrl?: string;
|
|
11
|
+
xmlUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
interface InvoiceDoc extends mongoose.Document {
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
userId: string;
|
|
16
|
+
orderId: string;
|
|
17
|
+
country: Country;
|
|
18
|
+
provider: string;
|
|
19
|
+
providerId: string;
|
|
20
|
+
pdfUrl?: string;
|
|
21
|
+
xmlUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
interface InvoiceModel extends mongoose.Model<InvoiceDoc> {
|
|
24
|
+
build(attrs: InvoiceAttrs): InvoiceDoc;
|
|
25
|
+
}
|
|
26
|
+
declare const buildInvoice: (mongoose: typeof mongoose) => InvoiceModel;
|
|
27
|
+
export { buildInvoice, InvoiceDoc };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildInvoice = void 0;
|
|
4
|
+
const buildInvoice = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.Invoice) {
|
|
7
|
+
return mongoose.model("Invoice");
|
|
8
|
+
}
|
|
9
|
+
const InvoiceSchema = new mongoose.Schema({
|
|
10
|
+
createdAt: {
|
|
11
|
+
type: mongoose.Schema.Types.Date,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
userId: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
orderId: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
country: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
provider: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
providerId: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
pdfUrl: {
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
xmlUrl: {
|
|
38
|
+
type: String,
|
|
39
|
+
},
|
|
40
|
+
}, {
|
|
41
|
+
toJSON: {
|
|
42
|
+
transform(doc, ret) {
|
|
43
|
+
ret.id = ret._id;
|
|
44
|
+
delete ret._id;
|
|
45
|
+
delete ret.__v;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
InvoiceSchema.statics.build = (attrs) => {
|
|
50
|
+
return new Invoice(attrs);
|
|
51
|
+
};
|
|
52
|
+
const Invoice = mongoose.model("Invoice", InvoiceSchema);
|
|
53
|
+
return Invoice;
|
|
54
|
+
};
|
|
55
|
+
exports.buildInvoice = buildInvoice;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1022",
|
|
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.
|
|
27
|
+
"@riocrypto/common": "^1.0.882",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|