common-tg-service 1.0.30 → 1.0.32
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/dist/components/transactions/schemas/transaction.schema.d.ts +3 -5
- package/dist/components/transactions/schemas/transaction.schema.js +17 -16
- package/dist/components/transactions/schemas/transaction.schema.js.map +1 -1
- package/dist/components/transactions/transaction.module.js +2 -0
- package/dist/components/transactions/transaction.module.js.map +1 -1
- package/dist/components/transactions/transaction.service.js +4 -6
- package/dist/components/transactions/transaction.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -23,23 +23,21 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
|
-
import { Document } from 'mongoose';
|
|
26
|
+
import { Document, Schema as MongooseSchema } from 'mongoose';
|
|
27
27
|
export type TransactionDocument = Transaction & Document;
|
|
28
28
|
export declare class Transaction {
|
|
29
29
|
transactionId: string;
|
|
30
30
|
amount: number;
|
|
31
31
|
issue: string;
|
|
32
32
|
description: string;
|
|
33
|
-
refundMethod
|
|
33
|
+
refundMethod: string;
|
|
34
34
|
profile: string;
|
|
35
35
|
chatId: string;
|
|
36
36
|
ip: string;
|
|
37
37
|
status: string;
|
|
38
38
|
isDeleted: boolean;
|
|
39
|
-
createdAt?: Date;
|
|
40
|
-
updatedAt?: Date;
|
|
41
39
|
}
|
|
42
|
-
export declare const TransactionSchema:
|
|
40
|
+
export declare const TransactionSchema: MongooseSchema<Transaction, import("mongoose").Model<Transaction, any, any, any, Document<unknown, any, Transaction> & Transaction & {
|
|
43
41
|
_id: import("mongoose").Types.ObjectId;
|
|
44
42
|
} & {
|
|
45
43
|
__v: number;
|
|
@@ -11,69 +11,70 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TransactionSchema = exports.Transaction = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
14
15
|
let Transaction = class Transaction {
|
|
15
16
|
};
|
|
16
17
|
exports.Transaction = Transaction;
|
|
17
18
|
__decorate([
|
|
18
|
-
(0, mongoose_1.Prop)({ type: String, required: true, unique: true
|
|
19
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true }),
|
|
19
20
|
__metadata("design:type", String)
|
|
20
21
|
], Transaction.prototype, "transactionId", void 0);
|
|
21
22
|
__decorate([
|
|
22
|
-
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
23
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, required: true }),
|
|
23
24
|
__metadata("design:type", Number)
|
|
24
25
|
], Transaction.prototype, "amount", void 0);
|
|
25
26
|
__decorate([
|
|
26
|
-
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
27
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
27
28
|
__metadata("design:type", String)
|
|
28
29
|
], Transaction.prototype, "issue", void 0);
|
|
29
30
|
__decorate([
|
|
30
|
-
(0, mongoose_1.Prop)({ type: String,
|
|
31
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
31
32
|
__metadata("design:type", String)
|
|
32
33
|
], Transaction.prototype, "description", void 0);
|
|
33
34
|
__decorate([
|
|
34
|
-
(0, mongoose_1.Prop)({ type: String }),
|
|
35
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: false, default: 'undefined' }),
|
|
35
36
|
__metadata("design:type", String)
|
|
36
37
|
], Transaction.prototype, "refundMethod", void 0);
|
|
37
38
|
__decorate([
|
|
38
|
-
(0, mongoose_1.Prop)({ type: String, default: 'undefined' }),
|
|
39
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: false, default: 'undefined' }),
|
|
39
40
|
__metadata("design:type", String)
|
|
40
41
|
], Transaction.prototype, "profile", void 0);
|
|
41
42
|
__decorate([
|
|
42
|
-
(0, mongoose_1.Prop)({ type: String,
|
|
43
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
43
44
|
__metadata("design:type", String)
|
|
44
45
|
], Transaction.prototype, "chatId", void 0);
|
|
45
46
|
__decorate([
|
|
46
|
-
(0, mongoose_1.Prop)({ type: String, default: 'undefined' }),
|
|
47
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: false, default: 'undefined' }),
|
|
47
48
|
__metadata("design:type", String)
|
|
48
49
|
], Transaction.prototype, "ip", void 0);
|
|
49
50
|
__decorate([
|
|
50
51
|
(0, mongoose_1.Prop)({
|
|
51
|
-
type: String,
|
|
52
|
+
type: mongoose_2.Schema.Types.String,
|
|
52
53
|
enum: ['pending', 'completed', 'failed', 'cancelled'],
|
|
53
54
|
default: 'pending'
|
|
54
55
|
}),
|
|
55
56
|
__metadata("design:type", String)
|
|
56
57
|
], Transaction.prototype, "status", void 0);
|
|
57
58
|
__decorate([
|
|
58
|
-
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
59
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: false }),
|
|
59
60
|
__metadata("design:type", Boolean)
|
|
60
61
|
], Transaction.prototype, "isDeleted", void 0);
|
|
61
62
|
exports.Transaction = Transaction = __decorate([
|
|
62
63
|
(0, mongoose_1.Schema)({
|
|
63
|
-
timestamps: true,
|
|
64
64
|
collection: 'transactions',
|
|
65
|
+
versionKey: false,
|
|
66
|
+
autoIndex: true,
|
|
67
|
+
timestamps: true,
|
|
65
68
|
toJSON: {
|
|
66
69
|
virtuals: true,
|
|
67
|
-
transform: (
|
|
68
|
-
delete ret.__v;
|
|
70
|
+
transform: (doc, ret) => {
|
|
69
71
|
return ret;
|
|
70
72
|
},
|
|
71
73
|
},
|
|
72
|
-
strict:
|
|
74
|
+
strict: true
|
|
73
75
|
})
|
|
74
76
|
], Transaction);
|
|
75
77
|
exports.TransactionSchema = mongoose_1.SchemaFactory.createForClass(Transaction);
|
|
78
|
+
exports.TransactionSchema.index({ chatId: 1, status: 1 });
|
|
76
79
|
exports.TransactionSchema.index({ createdAt: 1 });
|
|
77
|
-
exports.TransactionSchema.index({ chatId: 1 });
|
|
78
|
-
exports.TransactionSchema.index({ status: 1 });
|
|
79
80
|
//# sourceMappingURL=transaction.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.schema.js","sourceRoot":"","sources":["../../../../src/components/transactions/schemas/transaction.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;
|
|
1
|
+
{"version":3,"file":"transaction.schema.js","sourceRoot":"","sources":["../../../../src/components/transactions/schemas/transaction.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAC/D,uCAA8D;AAiBvD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAkCvB,CAAA;AAlCY,kCAAW;AAEtB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,iBAAc,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;kDACpD;AAGtB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,iBAAc,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC7C;AAGf;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,iBAAc,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC9C;AAGd;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,iBAAc,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC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,QAAA,iBAAiB,GAAG,wBAAa,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAC3E,yBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAClD,yBAAiB,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -12,12 +12,14 @@ const mongoose_1 = require("@nestjs/mongoose");
|
|
|
12
12
|
const transaction_service_1 = require("./transaction.service");
|
|
13
13
|
const transaction_controller_1 = require("./transaction.controller");
|
|
14
14
|
const transaction_schema_1 = require("./schemas/transaction.schema");
|
|
15
|
+
const init_module_1 = require("../ConfigurationInit/init.module");
|
|
15
16
|
let TransactionModule = class TransactionModule {
|
|
16
17
|
};
|
|
17
18
|
exports.TransactionModule = TransactionModule;
|
|
18
19
|
exports.TransactionModule = TransactionModule = __decorate([
|
|
19
20
|
(0, common_1.Module)({
|
|
20
21
|
imports: [
|
|
22
|
+
init_module_1.initModule,
|
|
21
23
|
mongoose_1.MongooseModule.forFeature([
|
|
22
24
|
{ name: transaction_schema_1.Transaction.name, schema: transaction_schema_1.TransactionSchema },
|
|
23
25
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.module.js","sourceRoot":"","sources":["../../../src/components/transactions/transaction.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,+DAA2D;AAC3D,qEAAiE;AACjE,qEAA8E;
|
|
1
|
+
{"version":3,"file":"transaction.module.js","sourceRoot":"","sources":["../../../src/components/transactions/transaction.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,+DAA2D;AAC3D,qEAAiE;AACjE,qEAA8E;AAC9E,kEAA8D;AAavD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAX7B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,wBAAU;YACV,yBAAc,CAAC,UAAU,CAAC;gBACxB,EAAE,IAAI,EAAE,gCAAW,CAAC,IAAI,EAAE,MAAM,EAAE,sCAAiB,EAAE;aACtD,CAAC;SACH;QACD,WAAW,EAAE,CAAC,8CAAqB,CAAC;QACpC,SAAS,EAAE,CAAC,wCAAkB,CAAC;QAC/B,OAAO,EAAC,CAAC,wCAAkB,CAAC;KAC7B,CAAC;GACW,iBAAiB,CAAG"}
|
|
@@ -24,20 +24,18 @@ let TransactionService = class TransactionService {
|
|
|
24
24
|
async create(createTransactionDto) {
|
|
25
25
|
console.log('Creating new transaction with data:', createTransactionDto);
|
|
26
26
|
try {
|
|
27
|
-
const
|
|
27
|
+
const newTransaction = new this.transactionModel({
|
|
28
28
|
transactionId: createTransactionDto.transactionId,
|
|
29
29
|
amount: createTransactionDto.amount,
|
|
30
30
|
issue: createTransactionDto.issue,
|
|
31
|
-
description: createTransactionDto.description
|
|
31
|
+
description: createTransactionDto.description,
|
|
32
32
|
refundMethod: createTransactionDto.refundMethod,
|
|
33
33
|
profile: createTransactionDto.profile || 'undefined',
|
|
34
|
-
chatId: createTransactionDto.chatId
|
|
34
|
+
chatId: createTransactionDto.chatId,
|
|
35
35
|
ip: createTransactionDto.ip || 'undefined',
|
|
36
36
|
status: createTransactionDto.status || 'pending',
|
|
37
37
|
isDeleted: false
|
|
38
|
-
};
|
|
39
|
-
console.log('Prepared transaction data:', transactionData);
|
|
40
|
-
const newTransaction = new this.transactionModel(transactionData);
|
|
38
|
+
});
|
|
41
39
|
console.log('Transaction model created:', newTransaction.toObject());
|
|
42
40
|
const savedTransaction = await newTransaction.save();
|
|
43
41
|
console.log('Transaction saved successfully:', savedTransaction.toObject());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.service.js","sourceRoot":"","sources":["../../../src/components/transactions/transaction.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,+CAA+C;AAC/C,uCAAiC;AAGjC,qEAAgF;AAGzE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACkD,gBAA4C;QAA5C,qBAAgB,GAAhB,gBAAgB,CAA4B;IAC3F,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,oBAA0C;QACrD,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,oBAAoB,CAAC,CAAC;QAEzE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"transaction.service.js","sourceRoot":"","sources":["../../../src/components/transactions/transaction.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,+CAA+C;AAC/C,uCAAiC;AAGjC,qEAAgF;AAGzE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACkD,gBAA4C;QAA5C,qBAAgB,GAAhB,gBAAgB,CAA4B;IAC3F,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,oBAA0C;QACrD,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,oBAAoB,CAAC,CAAC;QAEzE,IAAI,CAAC;YAEH,MAAM,cAAc,GAAG,IAAI,IAAI,CAAC,gBAAgB,CAAC;gBAC/C,aAAa,EAAE,oBAAoB,CAAC,aAAa;gBACjD,MAAM,EAAE,oBAAoB,CAAC,MAAM;gBACnC,KAAK,EAAE,oBAAoB,CAAC,KAAK;gBACjC,WAAW,EAAE,oBAAoB,CAAC,WAAW;gBAC7C,YAAY,EAAE,oBAAoB,CAAC,YAAY;gBAC/C,OAAO,EAAE,oBAAoB,CAAC,OAAO,IAAI,WAAW;gBACpD,MAAM,EAAE,oBAAoB,CAAC,MAAM;gBACnC,EAAE,EAAE,oBAAoB,CAAC,EAAE,IAAI,WAAW;gBAC1C,MAAM,EAAE,oBAAoB,CAAC,MAAM,IAAI,SAAS;gBAChD,SAAS,EAAE,KAAK;aACjB,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,4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