common-tg-service 1.0.30 → 1.0.31
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 +2 -5
- package/dist/components/transactions/schemas/transaction.schema.js +12 -16
- package/dist/components/transactions/schemas/transaction.schema.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,20 @@
|
|
|
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?: string;
|
|
34
33
|
profile: string;
|
|
35
34
|
chatId: string;
|
|
36
35
|
ip: string;
|
|
37
36
|
status: string;
|
|
38
37
|
isDeleted: boolean;
|
|
39
|
-
createdAt?: Date;
|
|
40
|
-
updatedAt?: Date;
|
|
41
38
|
}
|
|
42
|
-
export declare const TransactionSchema:
|
|
39
|
+
export declare const TransactionSchema: MongooseSchema<Transaction, import("mongoose").Model<Transaction, any, any, any, Document<unknown, any, Transaction> & Transaction & {
|
|
43
40
|
_id: import("mongoose").Types.ObjectId;
|
|
44
41
|
} & {
|
|
45
42
|
__v: number;
|
|
@@ -11,51 +11,48 @@ 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
|
-
__metadata("design:type", String)
|
|
36
|
-
], Transaction.prototype, "refundMethod", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, mongoose_1.Prop)({ type: String, default: 'undefined' }),
|
|
35
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: 'undefined' }),
|
|
39
36
|
__metadata("design:type", String)
|
|
40
37
|
], Transaction.prototype, "profile", void 0);
|
|
41
38
|
__decorate([
|
|
42
|
-
(0, mongoose_1.Prop)({ type: String,
|
|
39
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
43
40
|
__metadata("design:type", String)
|
|
44
41
|
], Transaction.prototype, "chatId", void 0);
|
|
45
42
|
__decorate([
|
|
46
|
-
(0, mongoose_1.Prop)({ type: String, default: 'undefined' }),
|
|
43
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: 'undefined' }),
|
|
47
44
|
__metadata("design:type", String)
|
|
48
45
|
], Transaction.prototype, "ip", void 0);
|
|
49
46
|
__decorate([
|
|
50
47
|
(0, mongoose_1.Prop)({
|
|
51
|
-
type: String,
|
|
48
|
+
type: mongoose_2.Schema.Types.String,
|
|
52
49
|
enum: ['pending', 'completed', 'failed', 'cancelled'],
|
|
53
50
|
default: 'pending'
|
|
54
51
|
}),
|
|
55
52
|
__metadata("design:type", String)
|
|
56
53
|
], Transaction.prototype, "status", void 0);
|
|
57
54
|
__decorate([
|
|
58
|
-
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
55
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: false }),
|
|
59
56
|
__metadata("design:type", Boolean)
|
|
60
57
|
], Transaction.prototype, "isDeleted", void 0);
|
|
61
58
|
exports.Transaction = Transaction = __decorate([
|
|
@@ -69,11 +66,10 @@ exports.Transaction = Transaction = __decorate([
|
|
|
69
66
|
return ret;
|
|
70
67
|
},
|
|
71
68
|
},
|
|
72
|
-
strict:
|
|
69
|
+
strict: true
|
|
73
70
|
})
|
|
74
71
|
], Transaction);
|
|
75
72
|
exports.TransactionSchema = mongoose_1.SchemaFactory.createForClass(Transaction);
|
|
73
|
+
exports.TransactionSchema.index({ chatId: 1, status: 1 });
|
|
76
74
|
exports.TransactionSchema.index({ createdAt: 1 });
|
|
77
|
-
exports.TransactionSchema.index({ chatId: 1 });
|
|
78
|
-
exports.TransactionSchema.index({ status: 1 });
|
|
79
75
|
//# 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;AAgBvD,IAAM,WAAW,GAAjB,MAAM,WAAW;CA+BvB,CAAA;AA/BY,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;;gDACxC;AAGpB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,iBAAc,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;;4CAClD;AAGhB;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,OAAO,EAAE,WAAW,EAAE,CAAC;;uCACvD;AAOX;IALC,IAAA,eAAI,EAAC;QACJ,IAAI,EAAE,iBAAc,CAAC,KAAK,CAAC,MAAM;QACjC,IAAI,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC;QACrD,OAAO,EAAE,SAAS;KACnB,CAAC;;2CACa;AAGf;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,iBAAc,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8CAC1C;sBA9BR,WAAW;IAZvB,IAAA,iBAAM,EAAC;QACN,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,cAAc;QAC1B,MAAM,EAAE;YACN,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;gBACvB,OAAO,GAAG,CAAC,GAAG,CAAC;gBACf,OAAO,GAAG,CAAC;YACb,CAAC;SACF;QACD,MAAM,EAAE,IAAI;KACb,CAAC;GACW,WAAW,CA+BvB;AAEY,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"}
|
|
@@ -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,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