rez_core 1.0.86 → 1.0.89
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 +2 -0
- package/dist/constant/global.constant.js +3 -1
- package/dist/constant/global.constant.js.map +1 -1
- package/dist/core.module.js +3 -0
- package/dist/core.module.js.map +1 -1
- package/dist/module/filter/controller/filter.controller.d.ts +26 -0
- package/dist/module/filter/controller/filter.controller.js +50 -0
- package/dist/module/filter/controller/filter.controller.js.map +1 -0
- package/dist/module/filter/dto/filter-request.dto.d.ts +24 -0
- package/dist/module/filter/dto/filter-request.dto.js +3 -0
- package/dist/module/filter/dto/filter-request.dto.js.map +1 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.d.ts +8 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.js +43 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.js.map +1 -0
- package/dist/module/filter/entity/saved-filter-master.entity.d.ts +8 -0
- package/dist/module/filter/entity/saved-filter-master.entity.js +43 -0
- package/dist/module/filter/entity/saved-filter-master.entity.js.map +1 -0
- package/dist/module/filter/filter.module.d.ts +2 -0
- package/dist/module/filter/filter.module.js +34 -0
- package/dist/module/filter/filter.module.js.map +1 -0
- package/dist/module/filter/repository/saved-filter.repository.d.ts +21 -0
- package/dist/module/filter/repository/saved-filter.repository.js +86 -0
- package/dist/module/filter/repository/saved-filter.repository.js.map +1 -0
- package/dist/module/filter/service/filter.service.d.ts +47 -0
- package/dist/module/filter/service/filter.service.js +251 -0
- package/dist/module/filter/service/filter.service.js.map +1 -0
- package/dist/module/filter/service/saved-filter.service.d.ts +12 -0
- package/dist/module/filter/service/saved-filter.service.js +73 -0
- package/dist/module/filter/service/saved-filter.service.js.map +1 -0
- package/dist/module/listmaster/listmaster.module.js +3 -2
- package/dist/module/listmaster/listmaster.module.js.map +1 -1
- package/dist/module/listmaster/service/list-master.service.d.ts +4 -3
- package/dist/module/listmaster/service/list-master.service.js +5 -4
- package/dist/module/listmaster/service/list-master.service.js.map +1 -1
- package/dist/module/meta/controller/meta.controller.d.ts +3 -1
- package/dist/module/meta/controller/meta.controller.js +6 -3
- package/dist/module/meta/controller/meta.controller.js.map +1 -1
- package/dist/module/meta/dto/entity-table.dto.d.ts +6 -0
- package/dist/module/meta/dto/entity-table.dto.js.map +1 -1
- package/dist/module/meta/entity.module.js +14 -3
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/entity-table-column.repository.d.ts +1 -1
- package/dist/module/meta/repository/entity-table-column.repository.js +5 -5
- package/dist/module/meta/repository/entity-table-column.repository.js.map +1 -1
- package/dist/module/meta/service/attribute-master.service.d.ts +1 -1
- package/dist/module/meta/service/attribute-master.service.js.map +1 -1
- package/dist/module/meta/service/entity-table-column.service.d.ts +1 -1
- package/dist/module/meta/service/entity-table-column.service.js +2 -2
- package/dist/module/meta/service/entity-table-column.service.js.map +1 -1
- package/dist/module/meta/service/entity-table.service.d.ts +7 -3
- package/dist/module/meta/service/entity-table.service.js +22 -5
- package/dist/module/meta/service/entity-table.service.js.map +1 -1
- package/dist/module/meta/service/media-data.service.d.ts +1 -1
- package/dist/module/meta/service/media-data.service.js +1 -1
- package/dist/module/meta/service/media-data.service.js.map +1 -1
- package/dist/module/module/entity/module.entity.d.ts +1 -0
- package/dist/module/module/entity/module.entity.js +4 -0
- package/dist/module/module/entity/module.entity.js.map +1 -1
- package/dist/resources/properties.yaml.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/constant/global.constant.ts +2 -0
- package/src/core.module.ts +4 -2
- package/src/module/filter/controller/filter.controller.ts +34 -0
- package/src/module/filter/dto/filter-request.dto.ts +26 -0
- package/src/module/filter/entity/saved-filter-detail.entity.ts +23 -0
- package/src/module/filter/entity/saved-filter-master.entity.ts +23 -0
- package/src/module/filter/filter.module.ts +21 -0
- package/src/module/filter/repository/saved-filter.repository.ts +87 -0
- package/src/module/filter/service/filter.service.ts +326 -0
- package/src/module/filter/service/saved-filter.service.ts +103 -0
- package/src/module/listmaster/listmaster.module.ts +4 -3
- package/src/module/listmaster/service/list-master.service.ts +3 -2
- package/src/module/meta/controller/meta.controller.ts +6 -3
- package/src/module/meta/dto/entity-table.dto.ts +4 -0
- package/src/module/meta/entity.module.ts +15 -5
- package/src/module/meta/repository/entity-table-column.repository.ts +9 -5
- package/src/module/meta/service/attribute-master.service.ts +9 -9
- package/src/module/meta/service/entity-table-column.service.ts +6 -1
- package/src/module/meta/service/entity-table.service.ts +24 -4
- package/src/module/meta/service/media-data.service.ts +1 -1
- package/src/module/module/entity/module.entity.ts +3 -1
- package/src/resources/dev.properties.yaml +2 -2
- package/src/resources/properties.yaml.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Module } from '@nestjs/common';
|
|
1
|
+
import { forwardRef, Module } from '@nestjs/common';
|
|
2
2
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
3
3
|
import { ListMasterData } from './entity/list-master.entity';
|
|
4
4
|
import { ListMasterItems } from './entity/list-master-items.entity';
|
|
@@ -11,8 +11,9 @@ import { ThirdPartyModule } from '../third-party-module/third-party.module';
|
|
|
11
11
|
import { HttpModule } from '@nestjs/axios';
|
|
12
12
|
|
|
13
13
|
@Module({
|
|
14
|
-
imports: [TypeOrmModule.forFeature([ListMasterData, ListMasterItems]),EntityModule, ThirdPartyModule, HttpModule],
|
|
14
|
+
imports: [TypeOrmModule.forFeature([ListMasterData, ListMasterItems]),forwardRef(() => EntityModule), ThirdPartyModule, HttpModule],
|
|
15
15
|
providers: [ListMasterRepository, ListMasterItemsRepository, ListMasterService],
|
|
16
|
-
controllers: [ListMasterController]
|
|
16
|
+
controllers: [ListMasterController],
|
|
17
|
+
exports:[ListMasterService]
|
|
17
18
|
})
|
|
18
19
|
export class ListMasterModule {}
|
|
@@ -10,17 +10,18 @@ import { ApiRegistryService } from '../../third-party-module/service/api-registr
|
|
|
10
10
|
import { firstValueFrom } from 'rxjs';
|
|
11
11
|
import { HttpService } from '@nestjs/axios';
|
|
12
12
|
import { EntityManager } from 'typeorm';
|
|
13
|
+
import { EntityMasterService } from 'src/module/meta/service/entity-master.service';
|
|
13
14
|
|
|
14
15
|
@Injectable()
|
|
15
|
-
export class ListMasterService
|
|
16
|
+
export class ListMasterService {
|
|
16
17
|
constructor(
|
|
17
18
|
private readonly entityManager: EntityManager,
|
|
19
|
+
private readonly entityMasterService: EntityMasterService,
|
|
18
20
|
private readonly listMasterRepo: ListMasterRepository,
|
|
19
21
|
private readonly listItemsRepo: ListMasterItemsRepository,
|
|
20
22
|
private readonly apiRegistryService: ApiRegistryService,
|
|
21
23
|
private readonly httpService: HttpService,
|
|
22
24
|
) {
|
|
23
|
-
super();
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
async getDropdownOptions(type: string, params: Record<string, string>) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Controller, HttpStatus, Post, Query, Res, UseGuards } from '@nestjs/common';
|
|
1
|
+
import { Controller, HttpStatus, Post, Query, Req, Res, UseGuards } from '@nestjs/common';
|
|
2
2
|
import { EntityTableService } from '../service/entity-table.service';
|
|
3
3
|
import { Response } from 'express';
|
|
4
4
|
import { JwtAuthGuard } from '../../auth/guards/jwt.guard';
|
|
@@ -11,8 +11,11 @@ export class MetaController {
|
|
|
11
11
|
@Post('get-table-data')
|
|
12
12
|
async getTableMetaData(@Query('entity_type') entityType: string,
|
|
13
13
|
@Query('list_type') listType: string,
|
|
14
|
-
@Res() response: Response
|
|
15
|
-
|
|
14
|
+
@Res() response: Response,
|
|
15
|
+
@Req() req: Request & { user: any }) {
|
|
16
|
+
const userId = req.user.userId;
|
|
17
|
+
console.log(userId)
|
|
18
|
+
let entityTableDto = await this.entityTableService.getTableMetaDataForListing(entityType, listType,userId);
|
|
16
19
|
return response.status(HttpStatus.OK).json({
|
|
17
20
|
success: true,
|
|
18
21
|
data: entityTableDto,
|
|
@@ -3,4 +3,8 @@ import { EntityTableColumn } from '../entity/entity-table-column.entity';
|
|
|
3
3
|
|
|
4
4
|
export class EntityTableDto extends EntityTable{
|
|
5
5
|
column_list: EntityTableColumn[];
|
|
6
|
+
operation_list:{};
|
|
7
|
+
default_filter:{} | null;
|
|
8
|
+
saved_filter:{ label: string; value: number }[]
|
|
9
|
+
| null;
|
|
6
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Module } from '@nestjs/common';
|
|
1
|
+
import { forwardRef, Module } from '@nestjs/common';
|
|
2
2
|
import { EntityMasterService } from './service/entity-master.service';
|
|
3
3
|
import { EntityServiceImpl } from './service/entity-service-impl.service';
|
|
4
4
|
import { EntityController } from './controller/entity.controller';
|
|
@@ -36,6 +36,8 @@ import { ViewMasterController } from './controller/view-master.controller';
|
|
|
36
36
|
import { ViewMaterRespository } from './repository/view-master.repository';
|
|
37
37
|
import { MetaController } from './controller/meta.controller';
|
|
38
38
|
import { EntityValidationService } from './service/entity-validation.service';
|
|
39
|
+
import { ListMasterModule } from '../listmaster/listmaster.module';
|
|
40
|
+
import { FilterModule } from '../filter/filter.module';
|
|
39
41
|
|
|
40
42
|
@Module({
|
|
41
43
|
imports: [
|
|
@@ -52,8 +54,9 @@ import { EntityValidationService } from './service/entity-validation.service';
|
|
|
52
54
|
SectionMaster,
|
|
53
55
|
FieldGroup,
|
|
54
56
|
]),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
forwardRef(() => ListMasterModule),
|
|
58
|
+
forwardRef(() => FilterModule),
|
|
59
|
+
UtilsModule ],
|
|
57
60
|
providers: [
|
|
58
61
|
EntityMasterService,
|
|
59
62
|
EntityServiceImpl,
|
|
@@ -80,14 +83,21 @@ import { EntityValidationService } from './service/entity-validation.service';
|
|
|
80
83
|
EntityServiceImpl,
|
|
81
84
|
PreferenceService,
|
|
82
85
|
EntityListService,
|
|
83
|
-
EntityTableService,
|
|
84
86
|
EntityValidationService,
|
|
87
|
+
EntityTableService,
|
|
85
88
|
EntityTableColumnService,
|
|
86
89
|
MediaDataService,
|
|
87
90
|
SectionMasterService,
|
|
88
91
|
FieldGroupService,
|
|
89
92
|
'ViewMasterService',
|
|
93
|
+
AttributeMasterService,
|
|
94
|
+
],
|
|
95
|
+
controllers: [
|
|
96
|
+
EntityController,
|
|
97
|
+
MasterController,
|
|
98
|
+
MediaController,
|
|
99
|
+
ViewMasterController,
|
|
100
|
+
MetaController,
|
|
90
101
|
],
|
|
91
|
-
controllers: [EntityController, MasterController, MediaController, ViewMasterController, MetaController],
|
|
92
102
|
})
|
|
93
103
|
export class EntityModule {}
|
|
@@ -10,23 +10,27 @@ export class EntityTableColumnRepository {
|
|
|
10
10
|
private entityTableColumnRepository: Repository<EntityTableColumn>,
|
|
11
11
|
) {}
|
|
12
12
|
|
|
13
|
-
async findByParentIdAndParentType(
|
|
14
|
-
|
|
13
|
+
async findByParentIdAndParentType(
|
|
14
|
+
parentId: number,
|
|
15
|
+
parentType: string,
|
|
16
|
+
isVisible?: boolean,
|
|
17
|
+
) {
|
|
18
|
+
if (isVisible) {
|
|
15
19
|
return await this.entityTableColumnRepository.find({
|
|
16
20
|
where: {
|
|
17
21
|
parent_id: parentId,
|
|
18
22
|
parent_type: parentType,
|
|
19
23
|
},
|
|
20
|
-
order: { col_position: 'ASC' }
|
|
24
|
+
order: { col_position: 'ASC' },
|
|
21
25
|
});
|
|
22
26
|
}
|
|
23
27
|
return await this.entityTableColumnRepository.find({
|
|
24
28
|
where: {
|
|
25
29
|
parent_id: parentId,
|
|
26
30
|
parent_type: parentType,
|
|
27
|
-
visible:
|
|
31
|
+
visible: '1',
|
|
28
32
|
},
|
|
29
|
-
order: { col_position: 'ASC' }
|
|
33
|
+
order: { col_position: 'ASC' },
|
|
30
34
|
});
|
|
31
35
|
}
|
|
32
36
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Injectable } from
|
|
2
|
-
import { InjectRepository } from
|
|
3
|
-
import { In } from
|
|
4
|
-
import { AttributeMasterRepository } from
|
|
5
|
-
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
+
import { In } from 'typeorm';
|
|
4
|
+
import { AttributeMasterRepository } from '../repository/attribute-master.repository';
|
|
6
5
|
|
|
7
6
|
@Injectable()
|
|
8
7
|
export class AttributeMasterService {
|
|
@@ -10,8 +9,9 @@ export class AttributeMasterService {
|
|
|
10
9
|
private readonly attributeMasterRepository: AttributeMasterRepository,
|
|
11
10
|
) {}
|
|
12
11
|
|
|
13
|
-
async findAttributesByMappedEntityType(entity_type){
|
|
14
|
-
return await this.attributeMasterRepository.findAttributesByMappedEntityType(
|
|
12
|
+
async findAttributesByMappedEntityType(entity_type) {
|
|
13
|
+
return await this.attributeMasterRepository.findAttributesByMappedEntityType(
|
|
14
|
+
entity_type,
|
|
15
|
+
);
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -21,11 +21,16 @@ export class EntityTableColumnService {
|
|
|
21
21
|
return attributeJson;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
async findByParentIdAndParentType(
|
|
24
|
+
async findByParentIdAndParentType(
|
|
25
|
+
parentId: number,
|
|
26
|
+
parentType: string,
|
|
27
|
+
isVisible?: boolean,
|
|
28
|
+
) {
|
|
25
29
|
let entityTableColumns =
|
|
26
30
|
await this.entityTableColumnRepository.findByParentIdAndParentType(
|
|
27
31
|
parentId,
|
|
28
32
|
parentType,
|
|
33
|
+
isVisible,
|
|
29
34
|
);
|
|
30
35
|
return entityTableColumns;
|
|
31
36
|
}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
1
|
+
import { forwardRef, Inject, Injectable } from '@nestjs/common';
|
|
2
2
|
import { EntityTableRepository } from '../repository/entity-table.repository';
|
|
3
3
|
import { EntityTableColumnRepository } from '../repository/entity-table-column.repository';
|
|
4
4
|
import { EntityTableDto } from '../dto/entity-table.dto';
|
|
5
5
|
import { DISPLAY_LIST } from '../../../constant/global.constant';
|
|
6
|
+
import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
|
|
7
|
+
import { SavedFilterService } from 'src/module/filter/service/saved-filter.service';
|
|
8
|
+
import { SavedFilterRepositoryService } from 'src/module/filter/repository/saved-filter.repository';
|
|
6
9
|
|
|
7
10
|
@Injectable()
|
|
8
11
|
export class EntityTableService {
|
|
9
12
|
constructor(
|
|
10
13
|
private entityTableRepository: EntityTableRepository,
|
|
11
14
|
private readonly entityTableColumnRepository: EntityTableColumnRepository,
|
|
12
|
-
|
|
15
|
+
@Inject(forwardRef(() => ListMasterService))
|
|
16
|
+
private readonly listMasterService: ListMasterService,
|
|
17
|
+
|
|
18
|
+
private readonly savedFilterRepoService: SavedFilterRepositoryService,
|
|
19
|
+
) {
|
|
20
|
+
}
|
|
13
21
|
|
|
14
22
|
async findByEntityTypeAndListType(entityType: string, listType: string) {
|
|
15
23
|
return await this.entityTableRepository.findByEntityTypeAndListType(
|
|
@@ -30,14 +38,15 @@ export class EntityTableService {
|
|
|
30
38
|
);
|
|
31
39
|
}
|
|
32
40
|
|
|
33
|
-
async getTableMetaDataForListing(entityType: string, listType: string) {
|
|
34
|
-
return await this.getTableMetaData(entityType, listType, DISPLAY_LIST);
|
|
41
|
+
async getTableMetaDataForListing(entityType: string, listType: string,userId?: number) {
|
|
42
|
+
return await this.getTableMetaData(entityType, listType, DISPLAY_LIST,userId);
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
async getTableMetaData(
|
|
38
46
|
entityType: string,
|
|
39
47
|
listType: string,
|
|
40
48
|
displayType: string,
|
|
49
|
+
userId?: number
|
|
41
50
|
) {
|
|
42
51
|
let entityTable = await this.findByEntityTypeAndListTypeAndDisplayType(
|
|
43
52
|
entityType,
|
|
@@ -52,7 +61,18 @@ export class EntityTableService {
|
|
|
52
61
|
entityTable.id,
|
|
53
62
|
entityTable.entity_type,
|
|
54
63
|
);
|
|
64
|
+
entityTableDto.operation_list = {
|
|
65
|
+
"text": await this.listMasterService.getDropdownOptions("OPT",{})
|
|
66
|
+
// Add any other operations you want to include
|
|
67
|
+
};
|
|
68
|
+
entityTableDto.default_filter= await this.savedFilterRepoService.getDefaultFilterByEntityType(entityTable.list_type);
|
|
69
|
+
if(userId){
|
|
70
|
+
entityTableDto.saved_filter = await this.savedFilterRepoService.getSavedFiltersByUserIdAndEntityType(userId, entityTable.list_type);
|
|
71
|
+
}
|
|
55
72
|
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
56
76
|
return entityTableDto;
|
|
57
77
|
}
|
|
58
78
|
}
|
|
@@ -124,7 +124,7 @@ export class MediaDataService extends EntityServiceImpl {
|
|
|
124
124
|
Key: mediaData.media_url,
|
|
125
125
|
Expires: 60 * 5, // URL valid for 5 mins
|
|
126
126
|
});
|
|
127
|
-
return {signedUrl,
|
|
127
|
+
return {signedUrl,name: mediaData.file_name,id:mediaData.id};
|
|
128
128
|
} catch (error) {
|
|
129
129
|
console.error('Error generating signed URL for media:', error);
|
|
130
130
|
throw new Error('Failed to generate signed URL');
|
|
@@ -35,7 +35,9 @@ export class ModuleData {
|
|
|
35
35
|
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
36
36
|
title: string;
|
|
37
37
|
|
|
38
|
+
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
39
|
+
component_name: string;
|
|
40
|
+
|
|
38
41
|
@Column({ type: 'json', nullable: true })
|
|
39
42
|
ui_config: JSON;
|
|
40
|
-
|
|
41
43
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# DB_HOST: "13.234.25.234"
|
|
2
|
-
DB_HOST: "
|
|
2
|
+
DB_HOST: "13.234.25.234"
|
|
3
3
|
DB_PORT: "3306"
|
|
4
4
|
DB_USER: "root"
|
|
5
|
-
DB_PASS: "
|
|
5
|
+
DB_PASS: "Rezolut@123"
|
|
6
6
|
DB_NAME: "core"
|
|
7
7
|
MASTER_KEY: "0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh"
|
|
8
8
|
MASTER_IV: "heuUQf5uPVtkotrFAOKUVw=="
|