mfance-shark-v1 1.0.67 → 1.0.69
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/common/entities/payment-code.entity.d.ts +12 -0
- package/dist/common/entities/payment-code.entity.js +78 -0
- package/dist/common/entities/payment-code.entity.js.map +1 -0
- package/dist/services/auth/auth.service.js +2 -2
- package/dist/services/auth/auth.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AuditableEntity } from "../../auditable/auditable.entity";
|
|
2
|
+
import { Agent } from "./users/agent.entity";
|
|
3
|
+
import { Distributor } from "./users/distributor.entity";
|
|
4
|
+
export declare class PaymentCode extends AuditableEntity {
|
|
5
|
+
agent: Agent;
|
|
6
|
+
distributor: Distributor;
|
|
7
|
+
code: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
isUsed: boolean;
|
|
10
|
+
isExpired: boolean;
|
|
11
|
+
expiresAt: Date;
|
|
12
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PaymentCode = void 0;
|
|
13
|
+
const auditable_entity_1 = require("../../auditable/auditable.entity");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const agent_entity_1 = require("./users/agent.entity");
|
|
16
|
+
const distributor_entity_1 = require("./users/distributor.entity");
|
|
17
|
+
let PaymentCode = class PaymentCode extends auditable_entity_1.AuditableEntity {
|
|
18
|
+
};
|
|
19
|
+
exports.PaymentCode = PaymentCode;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.ManyToOne)(() => agent_entity_1.Agent, (agent) => agent.id, {
|
|
22
|
+
nullable: false,
|
|
23
|
+
}),
|
|
24
|
+
(0, typeorm_1.JoinColumn)({ name: "agent_id" }),
|
|
25
|
+
__metadata("design:type", agent_entity_1.Agent)
|
|
26
|
+
], PaymentCode.prototype, "agent", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.ManyToOne)(() => distributor_entity_1.Distributor, (distributor) => distributor.id, {
|
|
29
|
+
nullable: false,
|
|
30
|
+
}),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: "distributor_id" }),
|
|
32
|
+
__metadata("design:type", distributor_entity_1.Distributor)
|
|
33
|
+
], PaymentCode.prototype, "distributor", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({
|
|
36
|
+
unique: true,
|
|
37
|
+
nullable: false,
|
|
38
|
+
}),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], PaymentCode.prototype, "code", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({
|
|
43
|
+
type: "decimal",
|
|
44
|
+
precision: 10,
|
|
45
|
+
scale: 2,
|
|
46
|
+
nullable: false,
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], PaymentCode.prototype, "amount", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({
|
|
52
|
+
type: "boolean",
|
|
53
|
+
default: false,
|
|
54
|
+
nullable: false,
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], PaymentCode.prototype, "isUsed", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({
|
|
60
|
+
type: "boolean",
|
|
61
|
+
default: false,
|
|
62
|
+
nullable: false,
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Boolean)
|
|
65
|
+
], PaymentCode.prototype, "isExpired", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({
|
|
68
|
+
type: "timestamp",
|
|
69
|
+
nullable: false,
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], PaymentCode.prototype, "expiresAt", void 0);
|
|
73
|
+
exports.PaymentCode = PaymentCode = __decorate([
|
|
74
|
+
(0, typeorm_1.Entity)({
|
|
75
|
+
name: "payment_codes",
|
|
76
|
+
})
|
|
77
|
+
], PaymentCode);
|
|
78
|
+
//# sourceMappingURL=payment-code.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-code.entity.js","sourceRoot":"","sources":["../../../src/common/entities/payment-code.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAmE;AACnE,qCAAgE;AAChE,uDAA6C;AAC7C,mEAAyD;AAKlD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,kCAAe;CA8C/C,CAAA;AA9CY,kCAAW;AAKtB;IAJC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE;QAC3C,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;8BAC1B,oBAAK;0CAAC;AAMb;IAJC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gCAAW,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;QAC7D,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;8BAC1B,gCAAW;gDAAC;AAMzB;IAJC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,KAAK;KAChB,CAAC;;yCACW;AAQb;IANC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,KAAK;KAChB,CAAC;;2CACa;AAOf;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;KAChB,CAAC;;2CACc;AAOhB;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;KAChB,CAAC;;8CACiB;AAMnB;IAJC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,KAAK;KAChB,CAAC;8BACS,IAAI;8CAAC;sBA7CL,WAAW;IAHvB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,eAAe;KACtB,CAAC;GACW,WAAW,CA8CvB"}
|
|
@@ -26,7 +26,7 @@ let AuthService = class AuthService {
|
|
|
26
26
|
async generateTokens(payload) {
|
|
27
27
|
const [accessToken, refreshToken] = await Promise.all([
|
|
28
28
|
this.jwtService.signAsync(payload, {
|
|
29
|
-
expiresIn: '
|
|
29
|
+
expiresIn: '3d',
|
|
30
30
|
}),
|
|
31
31
|
this.jwtService.signAsync(payload, {
|
|
32
32
|
expiresIn: '7d',
|
|
@@ -36,7 +36,7 @@ let AuthService = class AuthService {
|
|
|
36
36
|
accessToken,
|
|
37
37
|
refreshToken,
|
|
38
38
|
tokenType: 'Bearer',
|
|
39
|
-
expiresIn:
|
|
39
|
+
expiresIn: 259200,
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
async verifyToken(token) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../src/services/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAyC;AACzC,gEAA4D;AAGrD,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAEvD,KAAK,CAAC,YAAY,CAAC,QAAgB;QACjC,OAAO,wBAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,QAAgB,EAAE,cAAsB;QAC5D,OAAO,wBAAU,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAY;QAC/B,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACpD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE;gBACjC,SAAS,EAAE,IAAI;aAChB,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE;gBACjC,SAAS,EAAE,IAAI;aAChB,CAAC;SACH,CAAC,CAAC;QAEH,OAAO;YACL,WAAW;YACX,YAAY;YACZ,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../src/services/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAyC;AACzC,gEAA4D;AAGrD,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAA6B,UAAsB;QAAtB,e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