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.
Files changed (84) hide show
  1. package/dist/constant/global.constant.d.ts +2 -0
  2. package/dist/constant/global.constant.js +3 -1
  3. package/dist/constant/global.constant.js.map +1 -1
  4. package/dist/core.module.js +3 -0
  5. package/dist/core.module.js.map +1 -1
  6. package/dist/module/filter/controller/filter.controller.d.ts +26 -0
  7. package/dist/module/filter/controller/filter.controller.js +50 -0
  8. package/dist/module/filter/controller/filter.controller.js.map +1 -0
  9. package/dist/module/filter/dto/filter-request.dto.d.ts +24 -0
  10. package/dist/module/filter/dto/filter-request.dto.js +3 -0
  11. package/dist/module/filter/dto/filter-request.dto.js.map +1 -0
  12. package/dist/module/filter/entity/saved-filter-detail.entity.d.ts +8 -0
  13. package/dist/module/filter/entity/saved-filter-detail.entity.js +43 -0
  14. package/dist/module/filter/entity/saved-filter-detail.entity.js.map +1 -0
  15. package/dist/module/filter/entity/saved-filter-master.entity.d.ts +8 -0
  16. package/dist/module/filter/entity/saved-filter-master.entity.js +43 -0
  17. package/dist/module/filter/entity/saved-filter-master.entity.js.map +1 -0
  18. package/dist/module/filter/filter.module.d.ts +2 -0
  19. package/dist/module/filter/filter.module.js +34 -0
  20. package/dist/module/filter/filter.module.js.map +1 -0
  21. package/dist/module/filter/repository/saved-filter.repository.d.ts +21 -0
  22. package/dist/module/filter/repository/saved-filter.repository.js +86 -0
  23. package/dist/module/filter/repository/saved-filter.repository.js.map +1 -0
  24. package/dist/module/filter/service/filter.service.d.ts +47 -0
  25. package/dist/module/filter/service/filter.service.js +251 -0
  26. package/dist/module/filter/service/filter.service.js.map +1 -0
  27. package/dist/module/filter/service/saved-filter.service.d.ts +12 -0
  28. package/dist/module/filter/service/saved-filter.service.js +73 -0
  29. package/dist/module/filter/service/saved-filter.service.js.map +1 -0
  30. package/dist/module/listmaster/listmaster.module.js +3 -2
  31. package/dist/module/listmaster/listmaster.module.js.map +1 -1
  32. package/dist/module/listmaster/service/list-master.service.d.ts +4 -3
  33. package/dist/module/listmaster/service/list-master.service.js +5 -4
  34. package/dist/module/listmaster/service/list-master.service.js.map +1 -1
  35. package/dist/module/meta/controller/meta.controller.d.ts +3 -1
  36. package/dist/module/meta/controller/meta.controller.js +6 -3
  37. package/dist/module/meta/controller/meta.controller.js.map +1 -1
  38. package/dist/module/meta/dto/entity-table.dto.d.ts +6 -0
  39. package/dist/module/meta/dto/entity-table.dto.js.map +1 -1
  40. package/dist/module/meta/entity.module.js +14 -3
  41. package/dist/module/meta/entity.module.js.map +1 -1
  42. package/dist/module/meta/repository/entity-table-column.repository.d.ts +1 -1
  43. package/dist/module/meta/repository/entity-table-column.repository.js +5 -5
  44. package/dist/module/meta/repository/entity-table-column.repository.js.map +1 -1
  45. package/dist/module/meta/service/attribute-master.service.d.ts +1 -1
  46. package/dist/module/meta/service/attribute-master.service.js.map +1 -1
  47. package/dist/module/meta/service/entity-table-column.service.d.ts +1 -1
  48. package/dist/module/meta/service/entity-table-column.service.js +2 -2
  49. package/dist/module/meta/service/entity-table-column.service.js.map +1 -1
  50. package/dist/module/meta/service/entity-table.service.d.ts +7 -3
  51. package/dist/module/meta/service/entity-table.service.js +22 -5
  52. package/dist/module/meta/service/entity-table.service.js.map +1 -1
  53. package/dist/module/meta/service/media-data.service.d.ts +1 -1
  54. package/dist/module/meta/service/media-data.service.js +1 -1
  55. package/dist/module/meta/service/media-data.service.js.map +1 -1
  56. package/dist/module/module/entity/module.entity.d.ts +1 -0
  57. package/dist/module/module/entity/module.entity.js +4 -0
  58. package/dist/module/module/entity/module.entity.js.map +1 -1
  59. package/dist/resources/properties.yaml.js +1 -1
  60. package/dist/tsconfig.build.tsbuildinfo +1 -1
  61. package/package.json +1 -1
  62. package/src/constant/global.constant.ts +2 -0
  63. package/src/core.module.ts +4 -2
  64. package/src/module/filter/controller/filter.controller.ts +34 -0
  65. package/src/module/filter/dto/filter-request.dto.ts +26 -0
  66. package/src/module/filter/entity/saved-filter-detail.entity.ts +23 -0
  67. package/src/module/filter/entity/saved-filter-master.entity.ts +23 -0
  68. package/src/module/filter/filter.module.ts +21 -0
  69. package/src/module/filter/repository/saved-filter.repository.ts +87 -0
  70. package/src/module/filter/service/filter.service.ts +326 -0
  71. package/src/module/filter/service/saved-filter.service.ts +103 -0
  72. package/src/module/listmaster/listmaster.module.ts +4 -3
  73. package/src/module/listmaster/service/list-master.service.ts +3 -2
  74. package/src/module/meta/controller/meta.controller.ts +6 -3
  75. package/src/module/meta/dto/entity-table.dto.ts +4 -0
  76. package/src/module/meta/entity.module.ts +15 -5
  77. package/src/module/meta/repository/entity-table-column.repository.ts +9 -5
  78. package/src/module/meta/service/attribute-master.service.ts +9 -9
  79. package/src/module/meta/service/entity-table-column.service.ts +6 -1
  80. package/src/module/meta/service/entity-table.service.ts +24 -4
  81. package/src/module/meta/service/media-data.service.ts +1 -1
  82. package/src/module/module/entity/module.entity.ts +3 -1
  83. package/src/resources/dev.properties.yaml +2 -2
  84. 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 extends EntityServiceImpl {
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
- let entityTableDto = await this.entityTableService.getTableMetaDataForListing(entityType, listType);
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
- UtilsModule,
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(parentId: number, parentType: string, nonVisible?) {
14
- if (nonVisible) {
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: "1",
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 "@nestjs/common";
2
- import { InjectRepository } from "@nestjs/typeorm";
3
- import { In } from "typeorm";
4
- import { AttributeMasterRepository } from "../repository/attribute-master.repository";
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(entity_type);
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(parentId: number, parentType: string) {
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,fileName: mediaData.file_name,id:mediaData.id};
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: "localhost"
2
+ DB_HOST: "13.234.25.234"
3
3
  DB_PORT: "3306"
4
4
  DB_USER: "root"
5
- DB_PASS: "root"
5
+ DB_PASS: "Rezolut@123"
6
6
  DB_NAME: "core"
7
7
  MASTER_KEY: "0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh"
8
8
  MASTER_IV: "heuUQf5uPVtkotrFAOKUVw=="
@@ -2,7 +2,7 @@ import { readFileSync } from 'fs';
2
2
  import * as yaml from 'js-yaml';
3
3
  import { join } from 'path';
4
4
 
5
- const YAML_CONFIG = `/uat.properties.yaml`;
5
+ const YAML_CONFIG = `/dev.properties.yaml`;
6
6
 
7
7
  export default () => {
8
8
  return yaml.load(