@lukiteam/luki-be-general 0.1.0
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/index.d.ts +9 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/models/enum/index.d.ts +221 -0
- package/dist/models/enum/index.js +289 -0
- package/dist/models/enum/index.js.map +1 -0
- package/dist/mongo/index.d.ts +90 -0
- package/dist/mongo/index.js +101 -0
- package/dist/mongo/index.js.map +1 -0
- package/dist/mongo/interfaces/repository.interface.d.ts +11 -0
- package/dist/mongo/interfaces/repository.interface.js +3 -0
- package/dist/mongo/interfaces/repository.interface.js.map +1 -0
- package/dist/mongo/repositories/base.repository.d.ts +50 -0
- package/dist/mongo/repositories/base.repository.js +161 -0
- package/dist/mongo/repositories/base.repository.js.map +1 -0
- package/dist/mongo/repositories/repository.factory.d.ts +5 -0
- package/dist/mongo/repositories/repository.factory.js +25 -0
- package/dist/mongo/repositories/repository.factory.js.map +1 -0
- package/dist/mongo/schema/agency-publishers.entity.d.ts +38 -0
- package/dist/mongo/schema/agency-publishers.entity.js +58 -0
- package/dist/mongo/schema/agency-publishers.entity.js.map +1 -0
- package/dist/mongo/schema/agency.entity.d.ts +34 -0
- package/dist/mongo/schema/agency.entity.js +41 -0
- package/dist/mongo/schema/agency.entity.js.map +1 -0
- package/dist/mongo/schema/contents.entity.d.ts +32 -0
- package/dist/mongo/schema/contents.entity.js +36 -0
- package/dist/mongo/schema/contents.entity.js.map +1 -0
- package/dist/mongo/schema/defined-texts.entity.d.ts +33 -0
- package/dist/mongo/schema/defined-texts.entity.js +37 -0
- package/dist/mongo/schema/defined-texts.entity.js.map +1 -0
- package/dist/mongo/schema/filter.dto.d.ts +6 -0
- package/dist/mongo/schema/filter.dto.js +7 -0
- package/dist/mongo/schema/filter.dto.js.map +1 -0
- package/dist/mongo/schema/highlights.entity.d.ts +35 -0
- package/dist/mongo/schema/highlights.entity.js +48 -0
- package/dist/mongo/schema/highlights.entity.js.map +1 -0
- package/dist/mongo/schema/language.entity.d.ts +31 -0
- package/dist/mongo/schema/language.entity.js +32 -0
- package/dist/mongo/schema/language.entity.js.map +1 -0
- package/dist/mongo/schema/member-config.entity.d.ts +42 -0
- package/dist/mongo/schema/member-config.entity.js +77 -0
- package/dist/mongo/schema/member-config.entity.js.map +1 -0
- package/dist/mongo/schema/member-roles.entity.d.ts +33 -0
- package/dist/mongo/schema/member-roles.entity.js +38 -0
- package/dist/mongo/schema/member-roles.entity.js.map +1 -0
- package/dist/mongo/schema/member.entity.d.ts +64 -0
- package/dist/mongo/schema/member.entity.js +163 -0
- package/dist/mongo/schema/member.entity.js.map +1 -0
- package/dist/mongo/schema/notification.entity.d.ts +44 -0
- package/dist/mongo/schema/notification.entity.js +73 -0
- package/dist/mongo/schema/notification.entity.js.map +1 -0
- package/dist/mongo/schema/post-comments.entity.d.ts +34 -0
- package/dist/mongo/schema/post-comments.entity.js +43 -0
- package/dist/mongo/schema/post-comments.entity.js.map +1 -0
- package/dist/mongo/schema/post-likes.entity.d.ts +32 -0
- package/dist/mongo/schema/post-likes.entity.js +35 -0
- package/dist/mongo/schema/post-likes.entity.js.map +1 -0
- package/dist/mongo/schema/posts.entity.d.ts +39 -0
- package/dist/mongo/schema/posts.entity.js +65 -0
- package/dist/mongo/schema/posts.entity.js.map +1 -0
- package/dist/mongo/schema/rights.entity.d.ts +33 -0
- package/dist/mongo/schema/rights.entity.js +37 -0
- package/dist/mongo/schema/rights.entity.js.map +1 -0
- package/dist/mongo/schema/roles-rights.entity.d.ts +33 -0
- package/dist/mongo/schema/roles-rights.entity.js +38 -0
- package/dist/mongo/schema/roles-rights.entity.js.map +1 -0
- package/dist/mongo/schema/roles.entity.d.ts +32 -0
- package/dist/mongo/schema/roles.entity.js +33 -0
- package/dist/mongo/schema/roles.entity.js.map +1 -0
- package/dist/mongo/schema/spend-log.entity.d.ts +35 -0
- package/dist/mongo/schema/spend-log.entity.js +45 -0
- package/dist/mongo/schema/spend-log.entity.js.map +1 -0
- package/dist/mongo/schema/story-priority-log.entity.d.ts +32 -0
- package/dist/mongo/schema/story-priority-log.entity.js +33 -0
- package/dist/mongo/schema/story-priority-log.entity.js.map +1 -0
- package/dist/mongo/schema/story-seen-by.entity.d.ts +32 -0
- package/dist/mongo/schema/story-seen-by.entity.js +36 -0
- package/dist/mongo/schema/story-seen-by.entity.js.map +1 -0
- package/dist/mongo/schema/story.entity.d.ts +41 -0
- package/dist/mongo/schema/story.entity.js +54 -0
- package/dist/mongo/schema/story.entity.js.map +1 -0
- package/dist/mongo/schema/system-log.entity.d.ts +37 -0
- package/dist/mongo/schema/system-log.entity.js +53 -0
- package/dist/mongo/schema/system-log.entity.js.map +1 -0
- package/dist/mongo/schema/system-logs.entity.d.ts +36 -0
- package/dist/mongo/schema/system-logs.entity.js +46 -0
- package/dist/mongo/schema/system-logs.entity.js.map +1 -0
- package/dist/mongo/unit-of-work/unit-of-work.interface.d.ts +7 -0
- package/dist/mongo/unit-of-work/unit-of-work.interface.js +3 -0
- package/dist/mongo/unit-of-work/unit-of-work.interface.js.map +1 -0
- package/dist/mongo/unit-of-work/unit-of-work.module.d.ts +2 -0
- package/dist/mongo/unit-of-work/unit-of-work.module.js +29 -0
- package/dist/mongo/unit-of-work/unit-of-work.module.js.map +1 -0
- package/dist/mongo/unit-of-work/unit-of-work.service.d.ts +19 -0
- package/dist/mongo/unit-of-work/unit-of-work.service.js +104 -0
- package/dist/mongo/unit-of-work/unit-of-work.service.js.map +1 -0
- package/dist/postgresql/entity/banners.entity.d.ts +18 -0
- package/dist/postgresql/entity/banners.entity.js +86 -0
- package/dist/postgresql/entity/banners.entity.js.map +1 -0
- package/dist/postgresql/entity/blocked-phone.entity.d.ts +9 -0
- package/dist/postgresql/entity/blocked-phone.entity.js +44 -0
- package/dist/postgresql/entity/blocked-phone.entity.js.map +1 -0
- package/dist/postgresql/entity/call-history-detail.entity.d.ts +9 -0
- package/dist/postgresql/entity/call-history-detail.entity.js +44 -0
- package/dist/postgresql/entity/call-history-detail.entity.js.map +1 -0
- package/dist/postgresql/entity/call-history.entity.d.ts +19 -0
- package/dist/postgresql/entity/call-history.entity.js +88 -0
- package/dist/postgresql/entity/call-history.entity.js.map +1 -0
- package/dist/postgresql/entity/coins-definition.entity.d.ts +14 -0
- package/dist/postgresql/entity/coins-definition.entity.js +60 -0
- package/dist/postgresql/entity/coins-definition.entity.js.map +1 -0
- package/dist/postgresql/entity/feedback-and-complaint.entity.d.ts +14 -0
- package/dist/postgresql/entity/feedback-and-complaint.entity.js +64 -0
- package/dist/postgresql/entity/feedback-and-complaint.entity.js.map +1 -0
- package/dist/postgresql/entity/member-bank-account.entity.d.ts +8 -0
- package/dist/postgresql/entity/member-bank-account.entity.js +43 -0
- package/dist/postgresql/entity/member-bank-account.entity.js.map +1 -0
- package/dist/postgresql/entity/member-blocked.entity.d.ts +11 -0
- package/dist/postgresql/entity/member-blocked.entity.js +58 -0
- package/dist/postgresql/entity/member-blocked.entity.js.map +1 -0
- package/dist/postgresql/entity/member-config.entity.d.ts +22 -0
- package/dist/postgresql/entity/member-config.entity.js +119 -0
- package/dist/postgresql/entity/member-config.entity.js.map +1 -0
- package/dist/postgresql/entity/member-connections.entity.d.ts +7 -0
- package/dist/postgresql/entity/member-connections.entity.js +39 -0
- package/dist/postgresql/entity/member-connections.entity.js.map +1 -0
- package/dist/postgresql/entity/member-friends.entity.d.ts +11 -0
- package/dist/postgresql/entity/member-friends.entity.js +58 -0
- package/dist/postgresql/entity/member-friends.entity.js.map +1 -0
- package/dist/postgresql/entity/member-liked.entity.d.ts +9 -0
- package/dist/postgresql/entity/member-liked.entity.js +50 -0
- package/dist/postgresql/entity/member-liked.entity.js.map +1 -0
- package/dist/postgresql/entity/member-mission.entity.d.ts +9 -0
- package/dist/postgresql/entity/member-mission.entity.js +48 -0
- package/dist/postgresql/entity/member-mission.entity.js.map +1 -0
- package/dist/postgresql/entity/member-reminder.entity.d.ts +11 -0
- package/dist/postgresql/entity/member-reminder.entity.js +65 -0
- package/dist/postgresql/entity/member-reminder.entity.js.map +1 -0
- package/dist/postgresql/entity/member-verification.entity.d.ts +8 -0
- package/dist/postgresql/entity/member-verification.entity.js +42 -0
- package/dist/postgresql/entity/member-verification.entity.js.map +1 -0
- package/dist/postgresql/entity/member.entity.d.ts +44 -0
- package/dist/postgresql/entity/member.entity.js +195 -0
- package/dist/postgresql/entity/member.entity.js.map +1 -0
- package/dist/postgresql/entity/message.entity.d.ts +13 -0
- package/dist/postgresql/entity/message.entity.js +73 -0
- package/dist/postgresql/entity/message.entity.js.map +1 -0
- package/dist/postgresql/entity/mission.entity.d.ts +12 -0
- package/dist/postgresql/entity/mission.entity.js +60 -0
- package/dist/postgresql/entity/mission.entity.js.map +1 -0
- package/dist/postgresql/entity/notification.entity.d.ts +8 -0
- package/dist/postgresql/entity/notification.entity.js +42 -0
- package/dist/postgresql/entity/notification.entity.js.map +1 -0
- package/dist/postgresql/entity/payment.entity.d.ts +14 -0
- package/dist/postgresql/entity/payment.entity.js +96 -0
- package/dist/postgresql/entity/payment.entity.js.map +1 -0
- package/dist/postgresql/entity/product-purchase.entity.d.ts +12 -0
- package/dist/postgresql/entity/product-purchase.entity.js +54 -0
- package/dist/postgresql/entity/product-purchase.entity.js.map +1 -0
- package/dist/postgresql/entity/purchase.entity.d.ts +15 -0
- package/dist/postgresql/entity/purchase.entity.js +73 -0
- package/dist/postgresql/entity/purchase.entity.js.map +1 -0
- package/dist/postgresql/entity/swipe-countries.entity.d.ts +8 -0
- package/dist/postgresql/entity/swipe-countries.entity.js +36 -0
- package/dist/postgresql/entity/swipe-countries.entity.js.map +1 -0
- package/dist/postgresql/entity/system-logs.entity.d.ts +12 -0
- package/dist/postgresql/entity/system-logs.entity.js +74 -0
- package/dist/postgresql/entity/system-logs.entity.js.map +1 -0
- package/dist/postgresql/entity/system-settings.entity.d.ts +8 -0
- package/dist/postgresql/entity/system-settings.entity.js +38 -0
- package/dist/postgresql/entity/system-settings.entity.js.map +1 -0
- package/dist/postgresql/entity/wallet-detail.entity.d.ts +10 -0
- package/dist/postgresql/entity/wallet-detail.entity.js +50 -0
- package/dist/postgresql/entity/wallet-detail.entity.js.map +1 -0
- package/dist/postgresql/entity/wallet.entity.d.ts +10 -0
- package/dist/postgresql/entity/wallet.entity.js +52 -0
- package/dist/postgresql/entity/wallet.entity.js.map +1 -0
- package/dist/postgresql/index.d.ts +28 -0
- package/dist/postgresql/index.js +63 -0
- package/dist/postgresql/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +27 -0
|
@@ -0,0 +1,46 @@
|
|
|
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.SystemLogSchema = exports.SystemLog = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const index_1 = require("../../models/enum/index");
|
|
15
|
+
let SystemLog = class SystemLog {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, mongoose_1.Prop)({ type: String, enum: Object.values(index_1.EnumSystemLevel), default: 'INFO', required: true }),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], SystemLog.prototype, "level", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], SystemLog.prototype, "process_name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], SystemLog.prototype, "operation", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], SystemLog.prototype, "message", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, mongoose_1.Prop)({ type: String, required: false, maxlength: 1000 }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], SystemLog.prototype, "context", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], SystemLog.prototype, "error_stack", void 0);
|
|
41
|
+
SystemLog = __decorate([
|
|
42
|
+
(0, mongoose_1.Schema)({ timestamps: true, collection: 'SystemLogs' })
|
|
43
|
+
], SystemLog);
|
|
44
|
+
exports.SystemLog = SystemLog;
|
|
45
|
+
exports.SystemLogSchema = mongoose_1.SchemaFactory.createForClass(SystemLog);
|
|
46
|
+
//# sourceMappingURL=system-logs.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-logs.entity.js","sourceRoot":"","sources":["../../../src/mongo/schema/system-logs.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAE/D,mDAA0D;AAKnD,IAAM,SAAS,GAAf,MAAM,SAAS;CAkBrB,CAAA;AAjBC;IAAC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,uBAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACvE;AAEvB;IAAC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAClB;AAErB;IAAC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACrB;AAElB;IAAC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACvB;AAEjB;IAAC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;0CACxC;AAEjB;IAAC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;8CACnB;AAjBV,SAAS;IADrB,IAAA,iBAAM,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;GAC1C,SAAS,CAkBrB;AAlBY,8BAAS;AAoBT,QAAA,eAAe,GAAG,wBAAa,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-of-work.interface.js","sourceRoot":"","sources":["../../../src/mongo/unit-of-work/unit-of-work.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.UnitOfWorkModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const unit_of_work_service_1 = require("./unit-of-work.service");
|
|
12
|
+
const repository_factory_1 = require("../repositories/repository.factory");
|
|
13
|
+
let UnitOfWorkModule = class UnitOfWorkModule {
|
|
14
|
+
};
|
|
15
|
+
UnitOfWorkModule = __decorate([
|
|
16
|
+
(0, common_1.Global)(),
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
providers: [
|
|
19
|
+
unit_of_work_service_1.UnitOfWorkService,
|
|
20
|
+
repository_factory_1.RepositoryFactory,
|
|
21
|
+
],
|
|
22
|
+
exports: [
|
|
23
|
+
unit_of_work_service_1.UnitOfWorkService,
|
|
24
|
+
repository_factory_1.RepositoryFactory,
|
|
25
|
+
],
|
|
26
|
+
})
|
|
27
|
+
], UnitOfWorkModule);
|
|
28
|
+
exports.UnitOfWorkModule = UnitOfWorkModule;
|
|
29
|
+
//# sourceMappingURL=unit-of-work.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-of-work.module.js","sourceRoot":"","sources":["../../../src/mongo/unit-of-work/unit-of-work.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,iEAA2D;AAC3D,2EAAuE;AAahE,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,gBAAgB;IAX5B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,wCAAiB;YACjB,sCAAiB;SAClB;QACD,OAAO,EAAE;YACP,wCAAiB;YACjB,sCAAiB;SAClB;KACF,CAAC;GACW,gBAAgB,CAAG;AAAnB,4CAAgB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Connection, ClientSession, Document } from 'mongoose';
|
|
2
|
+
import { IUnitOfWork } from './unit-of-work.interface';
|
|
3
|
+
import { BaseRepository } from '../repositories/base.repository';
|
|
4
|
+
import { RepositoryFactory } from '../repositories/repository.factory';
|
|
5
|
+
export declare class UnitOfWorkService implements IUnitOfWork {
|
|
6
|
+
private readonly connection;
|
|
7
|
+
private readonly repositoryFactory;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private session;
|
|
10
|
+
private readonly repositories;
|
|
11
|
+
constructor(connection: Connection, repositoryFactory: RepositoryFactory);
|
|
12
|
+
getRepository<T extends Document = any>(modelName: string): BaseRepository<T>;
|
|
13
|
+
startTransaction(): Promise<void>;
|
|
14
|
+
commitTransaction(): Promise<void>;
|
|
15
|
+
abortTransaction(): Promise<void>;
|
|
16
|
+
getSession(): ClientSession | null;
|
|
17
|
+
private endSession;
|
|
18
|
+
getRawDatabase(): import("mongodb").Db;
|
|
19
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var UnitOfWorkService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.UnitOfWorkService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
19
|
+
const mongoose_2 = require("mongoose");
|
|
20
|
+
const repository_factory_1 = require("../repositories/repository.factory");
|
|
21
|
+
let UnitOfWorkService = UnitOfWorkService_1 = class UnitOfWorkService {
|
|
22
|
+
constructor(connection, repositoryFactory) {
|
|
23
|
+
this.connection = connection;
|
|
24
|
+
this.repositoryFactory = repositoryFactory;
|
|
25
|
+
this.logger = new common_1.Logger(UnitOfWorkService_1.name);
|
|
26
|
+
this.session = null;
|
|
27
|
+
this.repositories = new Map();
|
|
28
|
+
}
|
|
29
|
+
getRepository(modelName) {
|
|
30
|
+
if (!this.repositories.has(modelName)) {
|
|
31
|
+
const model = this.connection.models[modelName];
|
|
32
|
+
if (!model) {
|
|
33
|
+
throw new Error(`Model ${modelName} not found`);
|
|
34
|
+
}
|
|
35
|
+
const repository = this.repositoryFactory.createRepository(model);
|
|
36
|
+
this.repositories.set(modelName, repository);
|
|
37
|
+
}
|
|
38
|
+
return this.repositories.get(modelName);
|
|
39
|
+
}
|
|
40
|
+
async startTransaction() {
|
|
41
|
+
var _a;
|
|
42
|
+
try {
|
|
43
|
+
this.session = await this.connection.startSession();
|
|
44
|
+
this.session.startTransaction();
|
|
45
|
+
this.logger.log('Transaction started');
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
this.logger.log(`Start transaction error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async commitTransaction() {
|
|
53
|
+
var _a;
|
|
54
|
+
try {
|
|
55
|
+
if (this.session) {
|
|
56
|
+
await this.session.commitTransaction();
|
|
57
|
+
this.logger.log('Transaction committed');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
this.logger.log(`Commit transaction error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
await this.endSession();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async abortTransaction() {
|
|
69
|
+
var _a;
|
|
70
|
+
try {
|
|
71
|
+
if (this.session) {
|
|
72
|
+
await this.session.abortTransaction();
|
|
73
|
+
this.logger.log('Transaction aborted');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
this.logger.log(`Abort transaction error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
await this.endSession();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
getSession() {
|
|
85
|
+
return this.session;
|
|
86
|
+
}
|
|
87
|
+
async endSession() {
|
|
88
|
+
if (this.session) {
|
|
89
|
+
await this.session.endSession();
|
|
90
|
+
this.session = null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
getRawDatabase() {
|
|
94
|
+
return this.connection.db;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
UnitOfWorkService = UnitOfWorkService_1 = __decorate([
|
|
98
|
+
(0, common_1.Injectable)(),
|
|
99
|
+
__param(0, (0, mongoose_1.InjectConnection)()),
|
|
100
|
+
__metadata("design:paramtypes", [mongoose_2.Connection,
|
|
101
|
+
repository_factory_1.RepositoryFactory])
|
|
102
|
+
], UnitOfWorkService);
|
|
103
|
+
exports.UnitOfWorkService = UnitOfWorkService;
|
|
104
|
+
//# sourceMappingURL=unit-of-work.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-of-work.service.js","sourceRoot":"","sources":["../../../src/mongo/unit-of-work/unit-of-work.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Model } from "sequelize-typescript";
|
|
2
|
+
import { EnumBannerGender, EnumBannerMemberType, EnumBannerType, EnumStatus } from "../../models/enum";
|
|
3
|
+
export default class Banners extends Model {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
media: string;
|
|
7
|
+
action: string;
|
|
8
|
+
type: EnumBannerType;
|
|
9
|
+
sort: number;
|
|
10
|
+
language: string;
|
|
11
|
+
member_type: EnumBannerMemberType;
|
|
12
|
+
gender: EnumBannerGender;
|
|
13
|
+
level: number;
|
|
14
|
+
platform: string;
|
|
15
|
+
status: EnumStatus;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
13
|
+
const enum_1 = require("../../models/enum");
|
|
14
|
+
let Banners = class Banners extends sequelize_typescript_1.Model {
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
sequelize_typescript_1.PrimaryKey,
|
|
18
|
+
sequelize_typescript_1.AutoIncrement,
|
|
19
|
+
(0, sequelize_typescript_1.Column)({
|
|
20
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
21
|
+
allowNull: false,
|
|
22
|
+
autoIncrement: true,
|
|
23
|
+
}),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], Banners.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING, allowNull: false }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], Banners.prototype, "title", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING, allowNull: false }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], Banners.prototype, "media", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING, allowNull: false }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Banners.prototype, "action", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, sequelize_typescript_1.Column)({ type: enum_1.enums.banner_type, allowNull: false }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], Banners.prototype, "type", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DOUBLE }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], Banners.prototype, "sort", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], Banners.prototype, "language", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, sequelize_typescript_1.Column)({ type: enum_1.enums.banner_member_type }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], Banners.prototype, "member_type", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, sequelize_typescript_1.Column)({ type: enum_1.enums.banner_gender }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], Banners.prototype, "gender", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.INTEGER }),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], Banners.prototype, "level", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING }),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], Banners.prototype, "platform", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, sequelize_typescript_1.Column)({ type: enum_1.enums.status }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], Banners.prototype, "status", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
sequelize_typescript_1.CreatedAt,
|
|
72
|
+
__metadata("design:type", Date)
|
|
73
|
+
], Banners.prototype, "createdAt", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
sequelize_typescript_1.UpdatedAt,
|
|
76
|
+
__metadata("design:type", Date)
|
|
77
|
+
], Banners.prototype, "updatedAt", void 0);
|
|
78
|
+
Banners = __decorate([
|
|
79
|
+
(0, sequelize_typescript_1.Table)({
|
|
80
|
+
timestamps: true,
|
|
81
|
+
freezeTableName: true,
|
|
82
|
+
tableName: 'Banners',
|
|
83
|
+
})
|
|
84
|
+
], Banners);
|
|
85
|
+
exports.default = Banners;
|
|
86
|
+
//# sourceMappingURL=banners.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banners.entity.js","sourceRoot":"","sources":["../../../src/postgresql/entity/banners.entity.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuH;AACvH,4CAA8G;AAO/F,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,4BAAK;CAiDzC,CAAA;AA/CG;IAAC,iCAAU;IACV,oCAAa;IACb,IAAA,6BAAM,EAAC;QACJ,IAAI,EAAE,+BAAQ,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,IAAI;KACtB,CAAC;;mCACS;AAEX;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;sCACtC;AAEd;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;sCACtC;AAEd;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;uCACrC;AAEf;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,YAAK,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;qCACjC;AAErB;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,CAAC;;qCACrB;AAEb;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,CAAC;;yCACjB;AAEjB;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,YAAK,CAAC,kBAAkB,EAAE,CAAC;;4CACT;AAElC;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,YAAK,CAAC,aAAa,EAAE,CAAC;;uCACb;AAEzB;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,EAAE,CAAC;;sCACrB;AAEd;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,EAAE,CAAC;;yCACjB;AAEjB;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,YAAK,CAAC,MAAM,EAAE,CAAC;;uCACZ;AAEnB;IAAC,gCAAS;8BACC,IAAI;0CAAC;AAEhB;IAAC,gCAAS;8BACC,IAAI;0CAAC;AAhDC,OAAO;IAL3B,IAAA,4BAAK,EAAC;QACH,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,SAAS;KACvB,CAAC;GACmB,OAAO,CAiD3B;kBAjDoB,OAAO"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { EnumStatus } from '../../models/enum';
|
|
3
|
+
declare class BlockedPhone extends Model {
|
|
4
|
+
unique_id: string;
|
|
5
|
+
unique_member_id: number;
|
|
6
|
+
device_info: EnumStatus;
|
|
7
|
+
reason: string;
|
|
8
|
+
}
|
|
9
|
+
export default BlockedPhone;
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
13
|
+
const enum_1 = require("../../models/enum");
|
|
14
|
+
let BlockedPhone = class BlockedPhone extends sequelize_typescript_1.Model {
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING),
|
|
18
|
+
__metadata("design:type", String)
|
|
19
|
+
], BlockedPhone.prototype, "unique_id", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], BlockedPhone.prototype, "unique_member_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], BlockedPhone.prototype, "device_info", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.STRING),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], BlockedPhone.prototype, "reason", void 0);
|
|
32
|
+
BlockedPhone = __decorate([
|
|
33
|
+
(0, sequelize_typescript_1.Table)({
|
|
34
|
+
timestamps: true,
|
|
35
|
+
freezeTableName: true,
|
|
36
|
+
tableName: 'BlockedPhone',
|
|
37
|
+
indexes: [
|
|
38
|
+
{ fields: ['id'], unique: true, name: 'indexes_blockedphone_001' },
|
|
39
|
+
{ fields: ['unique_id'], unique: true, name: 'indexes_blockedphone_002' }
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
], BlockedPhone);
|
|
43
|
+
exports.default = BlockedPhone;
|
|
44
|
+
//# sourceMappingURL=blocked-phone.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocked-phone.entity.js","sourceRoot":"","sources":["../../../src/postgresql/entity/blocked-phone.entity.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AACtE,4CAA+C;AAW/C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAK;CAa/B,CAAA;AAXG;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,MAAM,CAAC;;+CACL;AAEnB;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,MAAM,CAAC;;sDACE;AAE1B;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,MAAM,CAAC;;iDACC;AAEzB;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,MAAM,CAAC;;4CACR;AAZd,YAAY;IATjB,IAAA,4BAAK,EAAC;QACH,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE;YACL,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,0BAA0B,EAAE;YAClE,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,0BAA0B,EAAE;SAC5E;KACJ,CAAC;GACI,YAAY,CAajB;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { EnumCoinsCategory } from '../../models/enum';
|
|
3
|
+
declare class CallHistoryDetail extends Model {
|
|
4
|
+
call_id: string;
|
|
5
|
+
coins_id: number;
|
|
6
|
+
coins_type: EnumCoinsCategory;
|
|
7
|
+
coins_spent: number;
|
|
8
|
+
}
|
|
9
|
+
export default CallHistoryDetail;
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
13
|
+
const enum_1 = require("../../models/enum");
|
|
14
|
+
let CallHistoryDetail = class CallHistoryDetail extends sequelize_typescript_1.Model {
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.UUID }),
|
|
18
|
+
__metadata("design:type", String)
|
|
19
|
+
], CallHistoryDetail.prototype, "call_id", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.INTEGER),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], CallHistoryDetail.prototype, "coins_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, sequelize_typescript_1.Column)({ type: enum_1.enums.coins_category }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CallHistoryDetail.prototype, "coins_type", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.INTEGER),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], CallHistoryDetail.prototype, "coins_spent", void 0);
|
|
32
|
+
CallHistoryDetail = __decorate([
|
|
33
|
+
(0, sequelize_typescript_1.Table)({
|
|
34
|
+
timestamps: true,
|
|
35
|
+
freezeTableName: true,
|
|
36
|
+
tableName: 'CallHistoryDetail',
|
|
37
|
+
indexes: [
|
|
38
|
+
{ fields: ['call_id'], unique: true, name: 'indexes_callhistorydetail_001' },
|
|
39
|
+
{ fields: ['id'], unique: true, name: 'indexes_callhistorydetail_002' }
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
], CallHistoryDetail);
|
|
43
|
+
exports.default = CallHistoryDetail;
|
|
44
|
+
//# sourceMappingURL=call-history-detail.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-history-detail.entity.js","sourceRoot":"","sources":["../../../src/postgresql/entity/call-history-detail.entity.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AACtE,4CAA6D;AAW7D,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,4BAAK;CAapC,CAAA;AAXG;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,CAAC;;kDAChB;AAEhB;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,OAAO,CAAC;;mDACR;AAEjB;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,YAAK,CAAC,cAAc,EAAE,CAAC;;qDACT;AAE9B;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,OAAO,CAAC;;sDACL;AAZlB,iBAAiB;IATtB,IAAA,4BAAK,EAAC;QACH,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE;YACL,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,+BAA+B,EAAE;YAC5E,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,+BAA+B,EAAE;SAC1E;KACJ,CAAC;GACI,iBAAiB,CAatB;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import CallHistoryDetail from './call-history-detail.entity';
|
|
3
|
+
import Member from './member.entity';
|
|
4
|
+
import { EnumCallMethod } from '../../models/enum/index';
|
|
5
|
+
declare class CallHistory extends Model {
|
|
6
|
+
call_id: string;
|
|
7
|
+
caller_id: number;
|
|
8
|
+
callee_id: number;
|
|
9
|
+
call_method: EnumCallMethod;
|
|
10
|
+
call_status: number;
|
|
11
|
+
start_call: Date;
|
|
12
|
+
end_call: Date;
|
|
13
|
+
total_call_time: Date;
|
|
14
|
+
total_coins_spent: number;
|
|
15
|
+
call_history_detail: CallHistoryDetail[];
|
|
16
|
+
caller_user: Member;
|
|
17
|
+
callee_user: Member;
|
|
18
|
+
}
|
|
19
|
+
export default CallHistory;
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
16
|
+
const call_history_detail_entity_1 = __importDefault(require("./call-history-detail.entity"));
|
|
17
|
+
const member_entity_1 = __importDefault(require("./member.entity"));
|
|
18
|
+
const index_1 = require("../../models/enum/index");
|
|
19
|
+
let CallHistory = class CallHistory extends sequelize_typescript_1.Model {
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.UUID, allowNull: false, primaryKey: true }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CallHistory.prototype, "call_id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.INTEGER),
|
|
27
|
+
(0, sequelize_typescript_1.ForeignKey)(() => member_entity_1.default),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], CallHistory.prototype, "caller_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.INTEGER),
|
|
32
|
+
(0, sequelize_typescript_1.ForeignKey)(() => member_entity_1.default),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], CallHistory.prototype, "callee_id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, sequelize_typescript_1.Column)({
|
|
37
|
+
type: index_1.enums.call_method,
|
|
38
|
+
defaultValue: "none",
|
|
39
|
+
allowNull: false,
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], CallHistory.prototype, "call_method", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.INTEGER),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], CallHistory.prototype, "call_status", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.DATE),
|
|
49
|
+
__metadata("design:type", Date)
|
|
50
|
+
], CallHistory.prototype, "start_call", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.DATE),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], CallHistory.prototype, "end_call", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.DATE),
|
|
57
|
+
__metadata("design:type", Date)
|
|
58
|
+
], CallHistory.prototype, "total_call_time", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, sequelize_typescript_1.Column)(sequelize_typescript_1.DataType.INTEGER),
|
|
61
|
+
__metadata("design:type", Number)
|
|
62
|
+
], CallHistory.prototype, "total_coins_spent", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, sequelize_typescript_1.HasMany)(() => call_history_detail_entity_1.default, "call_id"),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], CallHistory.prototype, "call_history_detail", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, sequelize_typescript_1.BelongsTo)(() => member_entity_1.default, "caller_id"),
|
|
69
|
+
__metadata("design:type", member_entity_1.default)
|
|
70
|
+
], CallHistory.prototype, "caller_user", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, sequelize_typescript_1.BelongsTo)(() => member_entity_1.default, "callee_id"),
|
|
73
|
+
__metadata("design:type", member_entity_1.default)
|
|
74
|
+
], CallHistory.prototype, "callee_user", void 0);
|
|
75
|
+
CallHistory = __decorate([
|
|
76
|
+
(0, sequelize_typescript_1.Table)({
|
|
77
|
+
timestamps: true,
|
|
78
|
+
freezeTableName: true,
|
|
79
|
+
tableName: 'CallHistory',
|
|
80
|
+
indexes: [
|
|
81
|
+
{ fields: ['call_id'], unique: true, name: 'indexes_callhistory_001' },
|
|
82
|
+
{ fields: ['caller_id'], unique: true, name: 'indexes_callhistory_002' },
|
|
83
|
+
{ fields: ['callee_id'], unique: true, name: 'indexes_callhistory_003' }
|
|
84
|
+
]
|
|
85
|
+
})
|
|
86
|
+
], CallHistory);
|
|
87
|
+
exports.default = CallHistory;
|
|
88
|
+
//# sourceMappingURL=call-history.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-history.entity.js","sourceRoot":"","sources":["../../../src/postgresql/entity/call-history.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAsG;AACtG,8FAA6D;AAC7D,oEAAqC;AACrC,mDAAgE;AAYhE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,4BAAK;CA2C9B,CAAA;AAzCG;IAAC,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;;4CACpD;AAEhB;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,OAAO,CAAC;IACxB,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,uBAAM,CAAC;;8CACP;AAElB;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,OAAO,CAAC;IACxB,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,uBAAM,CAAC;;8CACP;AAElB;IAAC,IAAA,6BAAM,EAAC;QACJ,IAAI,EAAE,aAAK,CAAC,WAAW;QACvB,YAAY,EAAE,MAAM;QACpB,SAAS,EAAE,KAAK;KACnB,CAAC;;gDAC2B;AAE7B;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,OAAO,CAAC;;gDACL;AAEpB;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,IAAI,CAAC;8BACV,IAAI;+CAAC;AAEjB;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,IAAI,CAAC;8BACZ,IAAI;6CAAC;AAEf;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,IAAI,CAAC;8BACL,IAAI;oDAAC;AAEtB;IAAC,IAAA,6BAAM,EAAC,+BAAQ,CAAC,OAAO,CAAC;;sDACC;AAE1B;IAAC,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,oCAAiB,EAAE,SAAS,CAAC;;wDACF;AAE1C;IAAC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,uBAAM,EAAE,WAAW,CAAC;8BACvB,uBAAM;gDAAC;AAErB;IAAC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,uBAAM,EAAE,WAAW,CAAC;8BACvB,uBAAM;gDAAC;AA1CnB,WAAW;IAVhB,IAAA,4BAAK,EAAC;QACH,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,aAAa;QACxB,OAAO,EAAE;YACL,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,yBAAyB,EAAE;YACtE,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,yBAAyB,EAAE;YACxE,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,yBAAyB,EAAE;SAC3E;KACJ,CAAC;GACI,WAAW,CA2ChB;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { EnumCoinsCategory, EnumStatus } from '../../models/enum/index';
|
|
3
|
+
declare class CoinsDefinition extends Model {
|
|
4
|
+
name: string;
|
|
5
|
+
order: number;
|
|
6
|
+
sub_category: string;
|
|
7
|
+
category: EnumCoinsCategory;
|
|
8
|
+
description: string;
|
|
9
|
+
value: string;
|
|
10
|
+
coins_spent: number;
|
|
11
|
+
status: EnumStatus;
|
|
12
|
+
updatedUser: string;
|
|
13
|
+
}
|
|
14
|
+
export default CoinsDefinition;
|