rez_core 1.0.63 → 1.0.65
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/constant/global.constant.d.ts +3 -0
- package/dist/constant/global.constant.js +4 -1
- package/dist/constant/global.constant.js.map +1 -1
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/master/controller/master.controller.d.ts +11 -1
- package/dist/module/master/controller/master.controller.js +42 -4
- package/dist/module/master/controller/master.controller.js.map +1 -1
- package/dist/module/master/service/master.service.d.ts +13 -4
- package/dist/module/master/service/master.service.js +97 -23
- package/dist/module/master/service/master.service.js.map +1 -1
- package/dist/module/meta/controller/meta.controller.d.ts +7 -0
- package/dist/module/meta/controller/meta.controller.js +47 -0
- package/dist/module/meta/controller/meta.controller.js.map +1 -0
- package/dist/module/meta/dto/entity-table.dto.d.ts +5 -0
- package/dist/module/meta/dto/entity-table.dto.js +8 -0
- package/dist/module/meta/dto/entity-table.dto.js.map +1 -0
- package/dist/module/meta/entity.module.js +2 -1
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/entity-table-column.repository.js +1 -0
- package/dist/module/meta/repository/entity-table-column.repository.js.map +1 -1
- package/dist/module/meta/service/entity-table.service.d.ts +6 -1
- package/dist/module/meta/service/entity-table.service.js +18 -2
- package/dist/module/meta/service/entity-table.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/app.controller.ts +12 -12
- package/src/app.service.ts +8 -8
- package/src/constant/global.constant.ts +5 -0
- package/src/module/auth/guards/jwt.guard.ts +22 -22
- package/src/module/auth/guards/role.guard.ts +68 -68
- package/src/module/auth/services/jwt.service.ts +11 -11
- package/src/module/auth/strategies/local.strategy.ts +13 -13
- package/src/module/dev/dev.module.ts +12 -12
- package/src/module/dev/service/dev.service.ts +7 -7
- package/src/module/enterprise/entity/organization.entity.ts +80 -80
- package/src/module/master/controller/master.controller.ts +35 -11
- package/src/module/master/service/master.service.ts +144 -47
- package/src/module/meta/controller/meta.controller.ts +22 -0
- package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
- package/src/module/meta/dto/entity-table.dto.ts +6 -0
- package/src/module/meta/entity/preference.entity.ts +65 -65
- package/src/module/meta/entity.module.ts +2 -1
- package/src/module/meta/repository/entity-table-column.repository.ts +1 -0
- package/src/module/meta/repository/preference.repository.ts +20 -20
- package/src/module/meta/service/entity-table.service.ts +43 -3
- package/src/module/module/controller/menu.controller.ts +15 -15
- package/src/module/module/entity/module-access.entity.ts +22 -22
- package/src/module/user/controller/user.controller.ts +28 -28
- package/src/module/user/dto/update-user.dto.ts +4 -4
- package/src/module/user/entity/user-session.entity.ts +61 -61
- package/src/module/user/repository/userSession.repository.ts +33 -33
- package/src/utils/service/encryptUtil.service.ts +97 -97
- package/src/utils/service/excelUtil.service.ts +15 -15
- package/src/utils/service/reflection-helper.service.ts +53 -53
- package/.idea/250218_nodejs_core.iml +0 -12
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/dataSources.xml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
|
@@ -19,3 +19,6 @@ export declare const STATUS_INACTIVE = "INACTIVE";
|
|
|
19
19
|
export declare const STATUS_PENDING = "PENDING";
|
|
20
20
|
export declare const ENTITYSTATUS_TO_BE_PUBLISHED = "to_be_published";
|
|
21
21
|
export declare const ENTITYSTATUS_PUBLISHED = "published";
|
|
22
|
+
export declare const DISPLAY_LIST = "LIST";
|
|
23
|
+
export declare const DISPLAY_EXPORT = "EXPORT";
|
|
24
|
+
export declare const DISPLAY_REPORT = "REPORT";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ENTITYSTATUS_PUBLISHED = exports.ENTITYSTATUS_TO_BE_PUBLISHED = exports.STATUS_PENDING = exports.STATUS_INACTIVE = exports.STATUS_ACTIVE = exports.secretKey = exports.STORAGETYPE_COLUMN = exports.STORAGETYPE_SINGLEJSON = exports.ENTITYTYPE_USRROLMAP = exports.ENTITYTYPE_FIELDMASTER = exports.ENTITYTYPE_SECTIONMASTER = exports.ENTITYTYPE_LISTMASTERITEMS = exports.ENTITYTYPE_LISTMASTER = exports.ENTITYTYPE_MEDIA = exports.ENTITYTYPE_VIEWMASTER = exports.ENTITYTYPE_PREFERENCEMASTER = exports.ENTITYTYPE_ENTITYTABLECOLUMN = exports.ENTITYTYPE_ENTITYTABLE = exports.ENTITYTYPE_ROLE = exports.ENTITYTYPE_ENTITYMASTER = exports.ENTITYTYPE_USER = void 0;
|
|
3
|
+
exports.DISPLAY_REPORT = exports.DISPLAY_EXPORT = exports.DISPLAY_LIST = exports.ENTITYSTATUS_PUBLISHED = exports.ENTITYSTATUS_TO_BE_PUBLISHED = exports.STATUS_PENDING = exports.STATUS_INACTIVE = exports.STATUS_ACTIVE = exports.secretKey = exports.STORAGETYPE_COLUMN = exports.STORAGETYPE_SINGLEJSON = exports.ENTITYTYPE_USRROLMAP = exports.ENTITYTYPE_FIELDMASTER = exports.ENTITYTYPE_SECTIONMASTER = exports.ENTITYTYPE_LISTMASTERITEMS = exports.ENTITYTYPE_LISTMASTER = exports.ENTITYTYPE_MEDIA = exports.ENTITYTYPE_VIEWMASTER = exports.ENTITYTYPE_PREFERENCEMASTER = exports.ENTITYTYPE_ENTITYTABLECOLUMN = exports.ENTITYTYPE_ENTITYTABLE = exports.ENTITYTYPE_ROLE = exports.ENTITYTYPE_ENTITYMASTER = exports.ENTITYTYPE_USER = void 0;
|
|
4
4
|
exports.ENTITYTYPE_USER = 'USR';
|
|
5
5
|
exports.ENTITYTYPE_ENTITYMASTER = 'EMS';
|
|
6
6
|
exports.ENTITYTYPE_ROLE = 'ROL';
|
|
@@ -22,4 +22,7 @@ exports.STATUS_INACTIVE = 'INACTIVE';
|
|
|
22
22
|
exports.STATUS_PENDING = 'PENDING';
|
|
23
23
|
exports.ENTITYSTATUS_TO_BE_PUBLISHED = 'to_be_published';
|
|
24
24
|
exports.ENTITYSTATUS_PUBLISHED = 'published';
|
|
25
|
+
exports.DISPLAY_LIST = 'LIST';
|
|
26
|
+
exports.DISPLAY_EXPORT = 'EXPORT';
|
|
27
|
+
exports.DISPLAY_REPORT = 'REPORT';
|
|
25
28
|
//# sourceMappingURL=global.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.constant.js","sourceRoot":"","sources":["../../src/constant/global.constant.ts"],"names":[],"mappings":";;;AACa,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,uBAAuB,GAAG,KAAK,CAAC;AAChC,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,2BAA2B,GAAG,KAAK,CAAC;AACpC,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAC9B,QAAA,gBAAgB,GAAG,KAAK,CAAC;AACzB,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAC9B,QAAA,0BAA0B,GAAG,KAAK,CAAC;AACnC,QAAA,wBAAwB,GAAG,KAAK,CAAC;AACjC,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,oBAAoB,GAAG,KAAK,CAAC;AAG7B,QAAA,sBAAsB,GAAG,YAAY,CAAC;AACtC,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAG9B,QAAA,SAAS,GAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;AAGjD,QAAA,aAAa,GAAG,QAAQ,CAAC;AACzB,QAAA,eAAe,GAAG,UAAU,CAAC;AAC7B,QAAA,cAAc,GAAG,SAAS,CAAC;AAG3B,QAAA,4BAA4B,GAAG,iBAAiB,CAAC;AACjD,QAAA,sBAAsB,GAAG,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"global.constant.js","sourceRoot":"","sources":["../../src/constant/global.constant.ts"],"names":[],"mappings":";;;AACa,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,uBAAuB,GAAG,KAAK,CAAC;AAChC,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,2BAA2B,GAAG,KAAK,CAAC;AACpC,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAC9B,QAAA,gBAAgB,GAAG,KAAK,CAAC;AACzB,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAC9B,QAAA,0BAA0B,GAAG,KAAK,CAAC;AACnC,QAAA,wBAAwB,GAAG,KAAK,CAAC;AACjC,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,oBAAoB,GAAG,KAAK,CAAC;AAG7B,QAAA,sBAAsB,GAAG,YAAY,CAAC;AACtC,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAG9B,QAAA,SAAS,GAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;AAGjD,QAAA,aAAa,GAAG,QAAQ,CAAC;AACzB,QAAA,eAAe,GAAG,UAAU,CAAC;AAC7B,QAAA,cAAc,GAAG,SAAS,CAAC;AAG3B,QAAA,4BAA4B,GAAG,iBAAiB,CAAC;AACjD,QAAA,sBAAsB,GAAG,WAAW,CAAC;AAGrC,QAAA,YAAY,GAAG,MAAM,CAAC;AACtB,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,cAAc,GAAG,QAAQ,CAAC"}
|
|
@@ -34,9 +34,9 @@ let RolesGuard = class RolesGuard {
|
|
|
34
34
|
}
|
|
35
35
|
const requiredModule = this.reflector.get('moduleCode', context.getHandler());
|
|
36
36
|
const requiredActions = this.reflector.get('actions', context.getHandler());
|
|
37
|
-
const roleAccess = await this.entityManager.query(`SELECT *
|
|
38
|
-
FROM cr_module_access
|
|
39
|
-
WHERE role_id = ${user['role_id']}
|
|
37
|
+
const roleAccess = await this.entityManager.query(`SELECT *
|
|
38
|
+
FROM cr_module_access
|
|
39
|
+
WHERE role_id = ${user['role_id']}
|
|
40
40
|
AND module_code = '${requiredModule}'`);
|
|
41
41
|
if (!roleAccess || roleAccess.length === 0) {
|
|
42
42
|
throw new common_1.ForbiddenException('Access denied: No permissions found for this module');
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { MasterService } from '../service/master.service';
|
|
2
|
+
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
2
3
|
export declare class MasterController {
|
|
3
4
|
private readonly masterService;
|
|
4
|
-
|
|
5
|
+
private readonly entityService;
|
|
6
|
+
constructor(masterService: MasterService, entityService: EntityServiceImpl);
|
|
7
|
+
uploadMasterMetaXls(file: Express.Multer.File): Promise<{
|
|
8
|
+
message: string;
|
|
9
|
+
}>;
|
|
5
10
|
uploadMasterDataXls(file: Express.Multer.File): Promise<{
|
|
6
11
|
message: string;
|
|
7
12
|
}>;
|
|
13
|
+
uploadEntityDataXls(entityType: string, file: Express.Multer.File, req: Request & {
|
|
14
|
+
user: any;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
message: string;
|
|
17
|
+
}>;
|
|
8
18
|
}
|
|
@@ -16,28 +16,66 @@ exports.MasterController = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const platform_express_1 = require("@nestjs/platform-express");
|
|
18
18
|
const master_service_1 = require("../service/master.service");
|
|
19
|
+
const global_constant_1 = require("../../../constant/global.constant");
|
|
20
|
+
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
21
|
+
const jwt_guard_1 = require("../../auth/guards/jwt.guard");
|
|
19
22
|
let MasterController = class MasterController {
|
|
20
|
-
constructor(masterService) {
|
|
23
|
+
constructor(masterService, entityService) {
|
|
21
24
|
this.masterService = masterService;
|
|
25
|
+
this.entityService = entityService;
|
|
26
|
+
}
|
|
27
|
+
async uploadMasterMetaXls(file) {
|
|
28
|
+
if (!file) {
|
|
29
|
+
throw new common_1.BadRequestException('File is required');
|
|
30
|
+
}
|
|
31
|
+
return await this.masterService.uploadMeta(file.buffer);
|
|
22
32
|
}
|
|
23
33
|
async uploadMasterDataXls(file) {
|
|
24
34
|
if (!file) {
|
|
25
35
|
throw new common_1.BadRequestException('File is required');
|
|
26
36
|
}
|
|
27
|
-
return await this.masterService.
|
|
37
|
+
return await this.masterService.uploadData(file.buffer);
|
|
38
|
+
}
|
|
39
|
+
async uploadEntityDataXls(entityType, file, req) {
|
|
40
|
+
let requestedUser = req.user;
|
|
41
|
+
let loggedInUser = await this.entityService.getEntityData(global_constant_1.ENTITYTYPE_USER, requestedUser.id);
|
|
42
|
+
if (!file) {
|
|
43
|
+
throw new common_1.BadRequestException('File is required');
|
|
44
|
+
}
|
|
45
|
+
return await this.masterService.uploadEntityData(file.buffer, entityType, loggedInUser);
|
|
28
46
|
}
|
|
29
47
|
};
|
|
30
48
|
exports.MasterController = MasterController;
|
|
31
49
|
__decorate([
|
|
32
|
-
(0, common_1.Post)('
|
|
50
|
+
(0, common_1.Post)('uploadMeta'),
|
|
51
|
+
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
52
|
+
__param(0, (0, common_1.UploadedFile)()),
|
|
53
|
+
__metadata("design:type", Function),
|
|
54
|
+
__metadata("design:paramtypes", [Object]),
|
|
55
|
+
__metadata("design:returntype", Promise)
|
|
56
|
+
], MasterController.prototype, "uploadMasterMetaXls", null);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, common_1.Post)('uploadData'),
|
|
33
59
|
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
34
60
|
__param(0, (0, common_1.UploadedFile)()),
|
|
35
61
|
__metadata("design:type", Function),
|
|
36
62
|
__metadata("design:paramtypes", [Object]),
|
|
37
63
|
__metadata("design:returntype", Promise)
|
|
38
64
|
], MasterController.prototype, "uploadMasterDataXls", null);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, common_1.Post)('uploadEntity/:entityType'),
|
|
67
|
+
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
68
|
+
__param(0, (0, common_1.Param)('entityType')),
|
|
69
|
+
__param(1, (0, common_1.UploadedFile)()),
|
|
70
|
+
__param(2, (0, common_1.Req)()),
|
|
71
|
+
__metadata("design:type", Function),
|
|
72
|
+
__metadata("design:paramtypes", [String, Object, Object]),
|
|
73
|
+
__metadata("design:returntype", Promise)
|
|
74
|
+
], MasterController.prototype, "uploadEntityDataXls", null);
|
|
39
75
|
exports.MasterController = MasterController = __decorate([
|
|
40
76
|
(0, common_1.Controller)('master'),
|
|
41
|
-
|
|
77
|
+
(0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
|
|
78
|
+
__metadata("design:paramtypes", [master_service_1.MasterService,
|
|
79
|
+
entity_service_impl_service_1.EntityServiceImpl])
|
|
42
80
|
], MasterController);
|
|
43
81
|
//# sourceMappingURL=master.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"master.controller.js","sourceRoot":"","sources":["../../../../src/module/master/controller/master.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"master.controller.js","sourceRoot":"","sources":["../../../../src/module/master/controller/master.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,+DAA2D;AAC3D,8DAA0D;AAG1D,uEAA+D;AAC/D,gGAAwF;AACxF,2DAAgE;AAIzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAA6B,aAA4B,EACvC,aAAgC;QADrB,kBAAa,GAAb,aAAa,CAAe;QACvC,kBAAa,GAAb,aAAa,CAAmB;IAC/C,CAAC;IAKE,AAAN,KAAK,CAAC,mBAAmB,CAAiB,IAAyB;QACjE,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IAHL,IAAA,aAAI,EAAC,0BAA0B,CAAC;IAChC,IAAA,wBAAe,EAAC,IAAA,kCAAe,EAAC,MAAM,CAAC,CAAC;IAEd,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;IAAsB,WAAA,IAAA,qBAAY,GAAE,CAAA;IAA4B,WAAA,IAAA,YAAG,GAAE,CAAA;;;;2DAOlH;2BAnCU,gBAAgB;IAF5B,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACpB,IAAA,kBAAS,EAAC,wBAAY,CAAC;qCAEsB,8BAAa;QACxB,+CAAiB;GAFvC,gBAAgB,CAoC5B"}
|
|
@@ -3,20 +3,29 @@ import { ExcelUtil } from 'src/utils/service/excelUtil.service';
|
|
|
3
3
|
import { EntityMasterService } from '../../meta/service/entity-master.service';
|
|
4
4
|
import { AttributeMasterService } from 'src/module/meta/service/attribute-master.service';
|
|
5
5
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
6
|
+
import { ReflectionHelper } from 'src/utils/service/reflection-helper.service';
|
|
6
7
|
export declare class MasterService {
|
|
7
8
|
private readonly entityManager;
|
|
8
9
|
private readonly entityMasterService;
|
|
9
10
|
private readonly attributeMasterService;
|
|
10
11
|
private readonly excelUtil;
|
|
12
|
+
private reflectionHelper;
|
|
11
13
|
private readonly entityServiceImpl;
|
|
12
|
-
constructor(entityManager: EntityManager, entityMasterService: EntityMasterService, attributeMasterService: AttributeMasterService, excelUtil: ExcelUtil, entityServiceImpl: EntityServiceImpl);
|
|
14
|
+
constructor(entityManager: EntityManager, entityMasterService: EntityMasterService, attributeMasterService: AttributeMasterService, excelUtil: ExcelUtil, reflectionHelper: ReflectionHelper, entityServiceImpl: EntityServiceImpl);
|
|
13
15
|
private readonly metaSheets;
|
|
14
16
|
private readonly sequence;
|
|
15
17
|
private readonly dataSequence;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
uploadMeta(file: any): Promise<{
|
|
19
|
+
message: string;
|
|
20
|
+
}>;
|
|
21
|
+
uploadData(file: any): Promise<{
|
|
19
22
|
message: string;
|
|
20
23
|
}>;
|
|
24
|
+
uploadEntityData(file: any, entityType: any, loggedInUser: any): Promise<{
|
|
25
|
+
message: string;
|
|
26
|
+
}>;
|
|
27
|
+
private isMetaSheet;
|
|
28
|
+
private resolveParent;
|
|
21
29
|
upsertData(tableName: string, uniqueFields: string[], data: any[]): Promise<void>;
|
|
30
|
+
upsertViaService(entityType: string, data: any[], attributes: any[], uniqueFields: string[], loggedInUser: any): Promise<void>;
|
|
22
31
|
}
|
|
@@ -16,12 +16,14 @@ const excelUtil_service_1 = require("../../../utils/service/excelUtil.service");
|
|
|
16
16
|
const entity_master_service_1 = require("../../meta/service/entity-master.service");
|
|
17
17
|
const attribute_master_service_1 = require("../../meta/service/attribute-master.service");
|
|
18
18
|
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
19
|
+
const reflection_helper_service_1 = require("../../../utils/service/reflection-helper.service");
|
|
19
20
|
let MasterService = class MasterService {
|
|
20
|
-
constructor(entityManager, entityMasterService, attributeMasterService, excelUtil, entityServiceImpl) {
|
|
21
|
+
constructor(entityManager, entityMasterService, attributeMasterService, excelUtil, reflectionHelper, entityServiceImpl) {
|
|
21
22
|
this.entityManager = entityManager;
|
|
22
23
|
this.entityMasterService = entityMasterService;
|
|
23
24
|
this.attributeMasterService = attributeMasterService;
|
|
24
25
|
this.excelUtil = excelUtil;
|
|
26
|
+
this.reflectionHelper = reflectionHelper;
|
|
25
27
|
this.entityServiceImpl = entityServiceImpl;
|
|
26
28
|
this.metaSheets = [
|
|
27
29
|
'cr_entity_master',
|
|
@@ -70,27 +72,7 @@ let MasterService = class MasterService {
|
|
|
70
72
|
},
|
|
71
73
|
];
|
|
72
74
|
}
|
|
73
|
-
|
|
74
|
-
return this.metaSheets.includes(sheetName.toLowerCase());
|
|
75
|
-
}
|
|
76
|
-
async resolveParent(row) {
|
|
77
|
-
const parentType = row.parent_type;
|
|
78
|
-
const code = row.parent_id;
|
|
79
|
-
if (!code) {
|
|
80
|
-
throw new Error('Parent code is missing in the row');
|
|
81
|
-
}
|
|
82
|
-
const parentEntity = await this.entityMasterService.findByMappedEntityType(parentType);
|
|
83
|
-
const tableName = parentEntity?.db_table_name;
|
|
84
|
-
if (!tableName) {
|
|
85
|
-
throw new Error(`Table name not found for parent type ${parentType}`);
|
|
86
|
-
}
|
|
87
|
-
const entityData = await this.entityManager.query(`SELECT * FROM ${tableName} WHERE code = ? LIMIT 1`, [code]);
|
|
88
|
-
if (!entityData || entityData.length === 0) {
|
|
89
|
-
throw new Error(`Parent entity with code ${code} not found in table ${tableName}`);
|
|
90
|
-
}
|
|
91
|
-
row.parent_id = entityData[0].id;
|
|
92
|
-
}
|
|
93
|
-
async uploadMasterData(file) {
|
|
75
|
+
async uploadMeta(file) {
|
|
94
76
|
const data = excelUtil_service_1.ExcelUtil.readExcel(file.buffer);
|
|
95
77
|
for (let i = 0; i < this.sequence.length; i++) {
|
|
96
78
|
const { table, unique_fields } = this.sequence[i];
|
|
@@ -104,6 +86,12 @@ let MasterService = class MasterService {
|
|
|
104
86
|
await this.upsertData(table, unique_fields, sheetData);
|
|
105
87
|
}
|
|
106
88
|
}
|
|
89
|
+
return {
|
|
90
|
+
message: 'Data uploaded successfully',
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
async uploadData(file) {
|
|
94
|
+
const data = excelUtil_service_1.ExcelUtil.readExcel(file.buffer);
|
|
107
95
|
for (let i = 0; i < this.dataSequence.length; i++) {
|
|
108
96
|
const { table, unique_fields } = this.dataSequence[i];
|
|
109
97
|
const sheetData = data[table];
|
|
@@ -113,7 +101,6 @@ let MasterService = class MasterService {
|
|
|
113
101
|
}
|
|
114
102
|
const entityMasterData = await this.entityMasterService.getEntityByTableName(table);
|
|
115
103
|
const attributes = await this.attributeMasterService.findAttributesByMappedEntityType(entityMasterData?.mapped_entity_type);
|
|
116
|
-
console.log(attributes, "((((((((((((((((((((((((((");
|
|
117
104
|
for (const row of sheetData) {
|
|
118
105
|
if (row.parent_type !== undefined && row.parent_id !== undefined) {
|
|
119
106
|
this.resolveParent(row);
|
|
@@ -134,6 +121,62 @@ let MasterService = class MasterService {
|
|
|
134
121
|
message: 'Data uploaded successfully',
|
|
135
122
|
};
|
|
136
123
|
}
|
|
124
|
+
async uploadEntityData(file, entityType, loggedInUser) {
|
|
125
|
+
const data = excelUtil_service_1.ExcelUtil.readExcel(file.buffer);
|
|
126
|
+
const entityMaster = await this.entityMasterService.findByMappedEntityType(entityType);
|
|
127
|
+
if (!entityMaster) {
|
|
128
|
+
throw new Error(`Entity master not found for entityType: ${entityType}`);
|
|
129
|
+
}
|
|
130
|
+
const tableName = entityMaster.db_table_name;
|
|
131
|
+
const sheetData = data[tableName];
|
|
132
|
+
if (!sheetData) {
|
|
133
|
+
throw new Error(`Sheet for ${tableName} not found in uploaded file`);
|
|
134
|
+
}
|
|
135
|
+
const attributes = await this.attributeMasterService.findAttributesByMappedEntityType(entityType);
|
|
136
|
+
const uniqueFields = attributes
|
|
137
|
+
.filter(attr => attr.is_unique)
|
|
138
|
+
.map(attr => attr.attribute_key);
|
|
139
|
+
if (uniqueFields.length === 0) {
|
|
140
|
+
throw new Error(`No unique fields found for entityType: ${entityType}`);
|
|
141
|
+
}
|
|
142
|
+
for (const row of sheetData) {
|
|
143
|
+
if (row.parent_type && row.parent_id) {
|
|
144
|
+
await this.resolveParent(row);
|
|
145
|
+
}
|
|
146
|
+
for (const attr of attributes) {
|
|
147
|
+
if (attr.data_source_type === 'entity' && row[attr.attribute_key]) {
|
|
148
|
+
const refEntity = await this.entityMasterService.getEntityData(attr.datasource_list);
|
|
149
|
+
const refData = await this.entityManager.query(`SELECT * FROM ${refEntity.db_table_name} WHERE code = ? LIMIT 1`, [row[attr.attribute_key]]);
|
|
150
|
+
if (!refData.length) {
|
|
151
|
+
throw new Error(`Reference entity not found for code: ${row[attr.attribute_key]}`);
|
|
152
|
+
}
|
|
153
|
+
row[attr.attribute_key] = refData[0].id;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
await this.upsertViaService(entityType, sheetData, attributes, uniqueFields, loggedInUser);
|
|
158
|
+
return { message: 'Entity data uploaded successfully' };
|
|
159
|
+
}
|
|
160
|
+
isMetaSheet(sheetName) {
|
|
161
|
+
return this.metaSheets.includes(sheetName.toLowerCase());
|
|
162
|
+
}
|
|
163
|
+
async resolveParent(row) {
|
|
164
|
+
const parentType = row.parent_type;
|
|
165
|
+
const code = row.parent_id;
|
|
166
|
+
if (!code) {
|
|
167
|
+
throw new Error('Parent code is missing in the row');
|
|
168
|
+
}
|
|
169
|
+
const parentEntity = await this.entityMasterService.findByMappedEntityType(parentType);
|
|
170
|
+
const tableName = parentEntity?.db_table_name;
|
|
171
|
+
if (!tableName) {
|
|
172
|
+
throw new Error(`Table name not found for parent type ${parentType}`);
|
|
173
|
+
}
|
|
174
|
+
const entityData = await this.entityManager.query(`SELECT * FROM ${tableName} WHERE code = ? LIMIT 1`, [code]);
|
|
175
|
+
if (!entityData || entityData.length === 0) {
|
|
176
|
+
throw new Error(`Parent entity with code ${code} not found in table ${tableName}`);
|
|
177
|
+
}
|
|
178
|
+
row.parent_id = entityData[0].id;
|
|
179
|
+
}
|
|
137
180
|
async upsertData(tableName, uniqueFields, data) {
|
|
138
181
|
for (const row of data) {
|
|
139
182
|
const whereClause = uniqueFields
|
|
@@ -168,6 +211,36 @@ let MasterService = class MasterService {
|
|
|
168
211
|
}
|
|
169
212
|
}
|
|
170
213
|
}
|
|
214
|
+
async upsertViaService(entityType, data, attributes, uniqueFields, loggedInUser) {
|
|
215
|
+
const entityMaster = await this.entityMasterService.findByMappedEntityType(entityType);
|
|
216
|
+
if (!entityMaster)
|
|
217
|
+
throw new Error(`Entity master not found for ${entityType}`);
|
|
218
|
+
const serviceName = entityMaster.entity_service;
|
|
219
|
+
const entityService = await this.reflectionHelper.getBean(serviceName);
|
|
220
|
+
if (!entityService)
|
|
221
|
+
throw new Error(`Entity service not found for ${entityType}`);
|
|
222
|
+
for (const row of data) {
|
|
223
|
+
const whereClause = uniqueFields.reduce((acc, field) => {
|
|
224
|
+
acc[field] = row[field];
|
|
225
|
+
return acc;
|
|
226
|
+
}, {});
|
|
227
|
+
const existing = await this.entityManager
|
|
228
|
+
.createQueryBuilder()
|
|
229
|
+
.select('*')
|
|
230
|
+
.from(entityMaster.db_table_name, entityMaster.db_table_name)
|
|
231
|
+
.where(whereClause)
|
|
232
|
+
.limit(1)
|
|
233
|
+
.getRawOne();
|
|
234
|
+
row.entity_type = entityType;
|
|
235
|
+
if (existing) {
|
|
236
|
+
row.id = existing.id;
|
|
237
|
+
await entityService.updateEntity(row, loggedInUser);
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
await entityService.createEntity(row, loggedInUser);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
171
244
|
};
|
|
172
245
|
exports.MasterService = MasterService;
|
|
173
246
|
exports.MasterService = MasterService = __decorate([
|
|
@@ -176,6 +249,7 @@ exports.MasterService = MasterService = __decorate([
|
|
|
176
249
|
entity_master_service_1.EntityMasterService,
|
|
177
250
|
attribute_master_service_1.AttributeMasterService,
|
|
178
251
|
excelUtil_service_1.ExcelUtil,
|
|
252
|
+
reflection_helper_service_1.ReflectionHelper,
|
|
179
253
|
entity_service_impl_service_1.EntityServiceImpl])
|
|
180
254
|
], MasterService);
|
|
181
255
|
//# sourceMappingURL=master.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"master.service.js","sourceRoot":"","sources":["../../../../src/module/master/service/master.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"master.service.js","sourceRoot":"","sources":["../../../../src/module/master/service/master.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAwC;AACxC,gFAAgE;AAChE,oFAA+E;AA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,EAAE,CAAC,CAAC;YAEP,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa;iBACtC,kBAAkB,EAAE;iBACpB,MAAM,CAAC,GAAG,CAAC;iBACX,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,YAAY,CAAC,aAAa,CAAC;iBAC5D,KAAK,CAAC,WAAW,CAAC;iBAClB,KAAK,CAAC,CAAC,CAAC;iBACR,SAAS,EAAE,CAAC;YAEf,GAAG,CAAC,WAAW,GAAG,UAAU,CAAC;YAC7B,IAAI,QAAQ,EAAE,CAAC;gBACb,GAAG,CAAC,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC;gBACrB,MAAM,aAAa,CAAC,YAAY,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACN,MAAM,aAAa,CAAC,YAAY,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;IACH,CAAC;CAGF,CAAA;AA3SY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAGuB,uBAAa;QACP,2CAAmB;QAChB,iDAAsB;QACnC,6BAAS;QACP,4CAAgB;QAEV,+CAAiB;GAR5C,aAAa,CA2SzB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityTableService } from '../service/entity-table.service';
|
|
2
|
+
import { Response } from 'express';
|
|
3
|
+
export declare class MetaController {
|
|
4
|
+
private readonly entityTableService;
|
|
5
|
+
constructor(entityTableService: EntityTableService);
|
|
6
|
+
getTableMetaData(entityType: string, listType: string, response: Response): Promise<Response<any, Record<string, any>>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.MetaController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const entity_table_service_1 = require("../service/entity-table.service");
|
|
18
|
+
const jwt_guard_1 = require("../../auth/guards/jwt.guard");
|
|
19
|
+
let MetaController = class MetaController {
|
|
20
|
+
constructor(entityTableService) {
|
|
21
|
+
this.entityTableService = entityTableService;
|
|
22
|
+
}
|
|
23
|
+
async getTableMetaData(entityType, listType, response) {
|
|
24
|
+
let entityTableDto = await this.entityTableService.getTableMetaDataForListing(entityType, listType);
|
|
25
|
+
return response.status(common_1.HttpStatus.OK).json({
|
|
26
|
+
success: true,
|
|
27
|
+
data: entityTableDto,
|
|
28
|
+
message: 'Data fetch successfully!'
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.MetaController = MetaController;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, common_1.Post)('get-table-data'),
|
|
35
|
+
__param(0, (0, common_1.Query)('entity_type')),
|
|
36
|
+
__param(1, (0, common_1.Query)('list_type')),
|
|
37
|
+
__param(2, (0, common_1.Res)()),
|
|
38
|
+
__metadata("design:type", Function),
|
|
39
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
40
|
+
__metadata("design:returntype", Promise)
|
|
41
|
+
], MetaController.prototype, "getTableMetaData", null);
|
|
42
|
+
exports.MetaController = MetaController = __decorate([
|
|
43
|
+
(0, common_1.Controller)('meta'),
|
|
44
|
+
(0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
|
|
45
|
+
__metadata("design:paramtypes", [entity_table_service_1.EntityTableService])
|
|
46
|
+
], MetaController);
|
|
47
|
+
//# sourceMappingURL=meta.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.controller.js","sourceRoot":"","sources":["../../../../src/module/meta/controller/meta.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAqF;AACrF,0EAAqE;AAErE,2DAA2D;AAIpD,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IAGjE,AAAN,KAAK,CAAC,gBAAgB,CAAuB,UAAkB,EACpB,QAAgB,EAC7B,QAAkB;QAC9C,IAAI,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACpG,OAAO,QAAQ,CAAC,MAAM,CAAC,mBAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC;YACzC,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,0BAA0B;SACpC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAdY,wCAAc;AAInB;IADL,IAAA,aAAI,EAAC,gBAAgB,CAAC;IACC,WAAA,IAAA,cAAK,EAAC,aAAa,CAAC,CAAA;IACpB,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;sDAO5B;yBAbU,cAAc;IAF1B,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,kBAAS,EAAC,wBAAY,CAAC;qCAE2B,yCAAkB;GADxD,cAAc,CAc1B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityTableDto = void 0;
|
|
4
|
+
const entity_table_entity_1 = require("../entity/entity-table.entity");
|
|
5
|
+
class EntityTableDto extends entity_table_entity_1.EntityTable {
|
|
6
|
+
}
|
|
7
|
+
exports.EntityTableDto = EntityTableDto;
|
|
8
|
+
//# sourceMappingURL=entity-table.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-table.dto.js","sourceRoot":"","sources":["../../../../src/module/meta/dto/entity-table.dto.ts"],"names":[],"mappings":";;;AAAA,uEAA4D;AAG5D,MAAa,cAAe,SAAQ,iCAAW;CAE9C;AAFD,wCAEC"}
|
|
@@ -43,6 +43,7 @@ const field_group_service_1 = require("./service/field-group.service");
|
|
|
43
43
|
const view_master_service_1 = require("./service/view-master.service");
|
|
44
44
|
const view_master_controller_1 = require("./controller/view-master.controller");
|
|
45
45
|
const view_master_repository_1 = require("./repository/view-master.repository");
|
|
46
|
+
const meta_controller_1 = require("./controller/meta.controller");
|
|
46
47
|
let EntityModule = class EntityModule {
|
|
47
48
|
};
|
|
48
49
|
exports.EntityModule = EntityModule;
|
|
@@ -96,7 +97,7 @@ exports.EntityModule = EntityModule = __decorate([
|
|
|
96
97
|
field_group_service_1.FieldGroupService,
|
|
97
98
|
'ViewMasterService',
|
|
98
99
|
],
|
|
99
|
-
controllers: [entity_controller_1.EntityController, master_controller_1.MasterController, media_controller_1.MediaController, view_master_controller_1.ViewMasterController],
|
|
100
|
+
controllers: [entity_controller_1.EntityController, master_controller_1.MasterController, media_controller_1.MediaController, view_master_controller_1.ViewMasterController, meta_controller_1.MetaController],
|
|
100
101
|
})
|
|
101
102
|
], EntityModule);
|
|
102
103
|
//# sourceMappingURL=entity.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.module.js","sourceRoot":"","sources":["../../../src/module/meta/entity.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2EAAsE;AACtE,uFAA0E;AAC1E,sEAAkE;AAClE,6CAAgD;AAChD,2DAAuD;AACvD,wEAA6D;AAC7D,8EAAmE;AACnE,0FAAqF;AACrF,qEAAiE;AACjE,8EAA0E;AAC1E,kEAA8D;AAC9D,8EAA0E;AAC1E,qEAAiE;AACjE,sEAA2D;AAC3D,oFAAwE;AACxE,kFAA6E;AAC7E,yEAAoE;AACpE,gGAA0F;AAC1F,uFAAiF;AACjF,uEAAkE;AAClE,kEAAuD;AACvD,qEAAgE;AAChE,8EAAyE;AACzE,oEAAgE;AAChE,oEAAyD;AACzD,0DAAsD;AACtD,wEAAoE;AACpE,iFAA4E;AAC5E,6EAAwE;AACxE,0EAA+D;AAC/D,oEAAyD;AACzD,uEAAkE;AAClE,uEAAkE;AAClE,gFAA2E;AAC3E,gFAA2E;
|
|
1
|
+
{"version":3,"file":"entity.module.js","sourceRoot":"","sources":["../../../src/module/meta/entity.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2EAAsE;AACtE,uFAA0E;AAC1E,sEAAkE;AAClE,6CAAgD;AAChD,2DAAuD;AACvD,wEAA6D;AAC7D,8EAAmE;AACnE,0FAAqF;AACrF,qEAAiE;AACjE,8EAA0E;AAC1E,kEAA8D;AAC9D,8EAA0E;AAC1E,qEAAiE;AACjE,sEAA2D;AAC3D,oFAAwE;AACxE,kFAA6E;AAC7E,yEAAoE;AACpE,gGAA0F;AAC1F,uFAAiF;AACjF,uEAAkE;AAClE,kEAAuD;AACvD,qEAAgE;AAChE,8EAAyE;AACzE,oEAAgE;AAChE,oEAAyD;AACzD,0DAAsD;AACtD,wEAAoE;AACpE,iFAA4E;AAC5E,6EAAwE;AACxE,0EAA+D;AAC/D,oEAAyD;AACzD,uEAAkE;AAClE,uEAAkE;AAClE,gFAA2E;AAC3E,gFAA2E;AAC3E,kEAA8D;AAqDvD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAnDxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,mCAAY;gBACZ,yCAAe;gBACf,oCAAgB;gBAChB,iCAAW;gBACX,8CAAiB;gBACjB,6BAAS;gBACT,+BAAU;gBACV,4BAAY;gBACZ,0CAAmB;gBACnB,qCAAa;gBACb,+BAAU;aACX,CAAC;YACF,0BAAW;SACZ;QACD,SAAS,EAAE;YACT,2CAAmB;YACnB,+CAAiB;YACjB,uDAAyB;YACzB,sCAAiB;YACjB,4CAAoB;YACpB,8BAAa;YACb,+CAAqB;YACrB,yCAAkB;YAClB,4DAA2B;YAC3B,sDAAwB;YACxB,uCAAiB;YACjB,2CAAmB;YACnB,qCAAgB;YAChB,iDAAsB;YACtB,6CAAoB;YACpB,uCAAiB;YACjB,6CAAoB;YACpB,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,uCAAiB,EAAE;SAC9D;QACD,OAAO,EAAE;YACP,2CAAmB;YACnB,+CAAiB;YACjB,sCAAiB;YACjB,uCAAiB;YACjB,yCAAkB;YAClB,sDAAwB;YACxB,qCAAgB;YAChB,6CAAoB;YACpB,uCAAiB;YACjB,mBAAmB;SACpB;QACD,WAAW,EAAE,CAAC,oCAAgB,EAAE,oCAAgB,EAAE,kCAAe,EAAE,6CAAoB,EAAE,gCAAc,CAAC;KACzG,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-table-column.repository.js","sourceRoot":"","sources":["../../../../src/module/meta/repository/entity-table-column.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qFAAyE;AACzE,qCAAqC;AAG9B,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,YAEU,2BAA0D;QAA1D,gCAA2B,GAA3B,2BAA2B,CAA+B;IACjE,CAAC;IAEJ,KAAK,CAAC,2BAA2B,CAAC,QAAgB,EAAE,UAAkB;QACpE,OAAO,MAAM,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC;YACjD,KAAK,EAAE;gBACL,SAAS,EAAE,QAAQ;gBACnB,WAAW,EAAE,UAAU;aACxB;
|
|
1
|
+
{"version":3,"file":"entity-table-column.repository.js","sourceRoot":"","sources":["../../../../src/module/meta/repository/entity-table-column.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qFAAyE;AACzE,qCAAqC;AAG9B,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,YAEU,2BAA0D;QAA1D,gCAA2B,GAA3B,2BAA2B,CAA+B;IACjE,CAAC;IAEJ,KAAK,CAAC,2BAA2B,CAAC,QAAgB,EAAE,UAAkB;QACpE,OAAO,MAAM,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC;YACjD,KAAK,EAAE;gBACL,SAAS,EAAE,QAAQ;gBACnB,WAAW,EAAE,UAAU;aACxB;YACD,KAAK,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAfY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,8CAAiB,CAAC,CAAA;qCACC,oBAAU;GAHtC,2BAA2B,CAevC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { EntityTableRepository } from '../repository/entity-table.repository';
|
|
2
|
+
import { EntityTableColumnRepository } from '../repository/entity-table-column.repository';
|
|
3
|
+
import { EntityTableDto } from '../dto/entity-table.dto';
|
|
2
4
|
export declare class EntityTableService {
|
|
3
5
|
private entityTableRepository;
|
|
4
|
-
|
|
6
|
+
private readonly entityTableColumnRepository;
|
|
7
|
+
constructor(entityTableRepository: EntityTableRepository, entityTableColumnRepository: EntityTableColumnRepository);
|
|
5
8
|
findByEntityTypeAndListType(entityType: string, listType: string): Promise<import("../entity/entity-table.entity").EntityTable | null>;
|
|
6
9
|
findByEntityTypeAndListTypeAndDisplayType(entityType: string, listType: string, displayType: string): Promise<import("../entity/entity-table.entity").EntityTable | null>;
|
|
10
|
+
getTableMetaDataForListing(entityType: string, listType: string): Promise<EntityTableDto>;
|
|
11
|
+
getTableMetaData(entityType: string, listType: string, displayType: string): Promise<EntityTableDto>;
|
|
7
12
|
}
|
|
@@ -12,9 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.EntityTableService = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const entity_table_repository_1 = require("../repository/entity-table.repository");
|
|
15
|
+
const entity_table_column_repository_1 = require("../repository/entity-table-column.repository");
|
|
16
|
+
const global_constant_1 = require("../../../constant/global.constant");
|
|
15
17
|
let EntityTableService = class EntityTableService {
|
|
16
|
-
constructor(entityTableRepository) {
|
|
18
|
+
constructor(entityTableRepository, entityTableColumnRepository) {
|
|
17
19
|
this.entityTableRepository = entityTableRepository;
|
|
20
|
+
this.entityTableColumnRepository = entityTableColumnRepository;
|
|
18
21
|
}
|
|
19
22
|
async findByEntityTypeAndListType(entityType, listType) {
|
|
20
23
|
return await this.entityTableRepository.findByEntityTypeAndListType(entityType, listType);
|
|
@@ -22,10 +25,23 @@ let EntityTableService = class EntityTableService {
|
|
|
22
25
|
async findByEntityTypeAndListTypeAndDisplayType(entityType, listType, displayType) {
|
|
23
26
|
return await this.entityTableRepository.findByEntityTypeAndListTypeAndDisplayType(entityType, listType, displayType);
|
|
24
27
|
}
|
|
28
|
+
async getTableMetaDataForListing(entityType, listType) {
|
|
29
|
+
return await this.getTableMetaData(entityType, listType, global_constant_1.DISPLAY_LIST);
|
|
30
|
+
}
|
|
31
|
+
async getTableMetaData(entityType, listType, displayType) {
|
|
32
|
+
let entityTable = await this.findByEntityTypeAndListTypeAndDisplayType(entityType, listType, displayType);
|
|
33
|
+
let entityTableDto = entityTable;
|
|
34
|
+
if (entityTable) {
|
|
35
|
+
entityTableDto.column_list =
|
|
36
|
+
await this.entityTableColumnRepository.findByParentIdAndParentType(entityTable.id, entityTable.entity_type);
|
|
37
|
+
}
|
|
38
|
+
return entityTableDto;
|
|
39
|
+
}
|
|
25
40
|
};
|
|
26
41
|
exports.EntityTableService = EntityTableService;
|
|
27
42
|
exports.EntityTableService = EntityTableService = __decorate([
|
|
28
43
|
(0, common_1.Injectable)(),
|
|
29
|
-
__metadata("design:paramtypes", [entity_table_repository_1.EntityTableRepository
|
|
44
|
+
__metadata("design:paramtypes", [entity_table_repository_1.EntityTableRepository,
|
|
45
|
+
entity_table_column_repository_1.EntityTableColumnRepository])
|
|
30
46
|
], EntityTableService);
|
|
31
47
|
//# sourceMappingURL=entity-table.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-table.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-table.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mFAA8E;
|
|
1
|
+
{"version":3,"file":"entity-table.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-table.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mFAA8E;AAC9E,iGAA2F;AAE3F,uEAAiE;AAG1D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACU,qBAA4C,EACnC,2BAAwD;QADjE,0BAAqB,GAArB,qBAAqB,CAAuB;QACnC,gCAA2B,GAA3B,2BAA2B,CAA6B;IACxE,CAAC;IAEJ,KAAK,CAAC,2BAA2B,CAAC,UAAkB,EAAE,QAAgB;QACpE,OAAO,MAAM,IAAI,CAAC,qBAAqB,CAAC,2BAA2B,CACjE,UAAU,EACV,QAAQ,CACT,CAAC;IACJ,CAAC;IAED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