rez_core 2.1.95 → 2.1.97

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 (29) hide show
  1. package/dist/module/enterprise/repository/school.repository.js +30 -3
  2. package/dist/module/enterprise/repository/school.repository.js.map +1 -1
  3. package/dist/module/filter/service/saved-filter.service.d.ts +1 -1
  4. package/dist/module/filter/service/saved-filter.service.js.map +1 -1
  5. package/dist/module/listmaster/repository/list-master-items.repository.d.ts +4 -0
  6. package/dist/module/listmaster/repository/list-master-items.repository.js +11 -0
  7. package/dist/module/listmaster/repository/list-master-items.repository.js.map +1 -1
  8. package/dist/module/listmaster/service/list-master.service.js +3 -0
  9. package/dist/module/listmaster/service/list-master.service.js.map +1 -1
  10. package/dist/module/meta/repository/entity-table.repository.js +1 -0
  11. package/dist/module/meta/repository/entity-table.repository.js.map +1 -1
  12. package/dist/module/meta/service/entity-service-impl.service.d.ts +1 -1
  13. package/dist/module/meta/service/entity-service-impl.service.js +3 -0
  14. package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
  15. package/dist/module/meta/service/entity-table.service.js +2 -0
  16. package/dist/module/meta/service/entity-table.service.js.map +1 -1
  17. package/dist/module/user/service/role.service.d.ts +1 -1
  18. package/dist/module/user/service/role.service.js.map +1 -1
  19. package/dist/tsconfig.build.tsbuildinfo +1 -1
  20. package/package.json +1 -1
  21. package/src/module/enterprise/repository/school.repository.ts +33 -3
  22. package/src/module/filter/service/saved-filter.service.ts +1 -1
  23. package/src/module/listmaster/repository/list-master-items.repository.ts +12 -0
  24. package/src/module/listmaster/service/list-master.service.ts +6 -0
  25. package/src/module/meta/repository/entity-table.repository.ts +2 -0
  26. package/src/module/meta/service/entity-service-impl.service.ts +20 -4
  27. package/src/module/meta/service/entity-table.service.ts +2 -1
  28. package/src/module/user/service/role.service.ts +1 -1
  29. package/src/resources/dev.properties.yaml +15 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.1.95",
3
+ "version": "2.1.97",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -78,32 +78,62 @@ export class SchoolRepository {
78
78
  school_status,
79
79
  } = row;
80
80
 
81
+ const orgStatus = await this.dataSource
82
+ .createQueryBuilder()
83
+ .select('*')
84
+ .from('cr_list_master_items', 'cli')
85
+ .where('cli.id = :id AND cli.organization_id = :orgId', {
86
+ id: org_status,
87
+ orgId: org_id,
88
+ })
89
+ .getRawOne();
90
+
81
91
  if (!result[org_id]) {
82
92
  result[org_id] = {
83
93
  org_id,
84
94
  org_name,
85
95
  org_address,
86
- status: org_status,
96
+ status: orgStatus ? orgStatus.name : org_status,
87
97
  type: 'Organization',
88
98
  brands: {},
89
99
  };
90
100
  }
91
101
 
102
+ const brandStatus = await this.dataSource
103
+ .createQueryBuilder()
104
+ .select('*')
105
+ .from('cr_list_master_items', 'cli')
106
+ .where('cli.id = :id AND cli.organization_id = :orgId', {
107
+ id: brand_status,
108
+ orgId: org_id,
109
+ })
110
+ .getRawOne();
111
+
92
112
  if (!result[org_id].brands[brand_id]) {
93
113
  result[org_id].brands[brand_id] = {
94
114
  brand_id,
95
115
  brand_name,
96
- status: brand_status,
116
+ status: brandStatus ? brandStatus.name : brand_status,
97
117
  type: 'Brand',
98
118
  schools: [],
99
119
  };
100
120
  }
101
121
 
122
+ const schoolStatus = await this.dataSource
123
+ .createQueryBuilder()
124
+ .select('*')
125
+ .from('cr_list_master_items', 'cli')
126
+ .where('cli.id = :id AND cli.organization_id = :orgId', {
127
+ id: school_status,
128
+ orgId: org_id,
129
+ })
130
+ .getRawOne();
131
+
102
132
  result[org_id].brands[brand_id].schools.push({
103
133
  school_id,
104
134
  school_name,
105
135
  school_location,
106
- status: school_status,
136
+ status: schoolStatus ? schoolStatus.name : school_status,
107
137
  type: 'School',
108
138
  });
109
139
  }
@@ -71,7 +71,7 @@ export class SavedFilterService extends EntityServiceImpl {
71
71
 
72
72
  async updateEntity(
73
73
  entityData: BaseEntity,
74
- loggedInUser: UserData | null,
74
+ loggedInUser: UserData,
75
75
  ): Promise<BaseEntity> {
76
76
  const master = entityData as SavedFilterMaster;
77
77
 
@@ -32,6 +32,18 @@ export class ListMasterItemsRepository {
32
32
  return items.map((i) => ({ label: i.name, value: i.id }));
33
33
  }
34
34
 
35
+ async findOperatorsByType(type: string, organizationId?: number) {
36
+ const items = await this.repo.find({
37
+ where: {
38
+ listtype: type,
39
+ organization_id: organizationId,
40
+ status: 'ACTIVE',
41
+ },
42
+ order: { sortindex: 'ASC' },
43
+ });
44
+ return items.map((i) => ({ label: i.name, value: i.value }));
45
+ }
46
+
35
47
  async findItemByCode(
36
48
  code: string,
37
49
  organizationId?: number,
@@ -58,6 +58,7 @@ export class ListMasterService {
58
58
  loggedInUser?.organization_id,
59
59
  );
60
60
 
61
+ console.log(config, 'config');
61
62
  if (!config) throw new NotFoundException(`Type ${type} not found`);
62
63
 
63
64
  switch (config.source) {
@@ -75,6 +76,11 @@ export class ListMasterService {
75
76
  loggedInUser?.organization_id,
76
77
  );
77
78
 
79
+ case 'operator':
80
+ return this.listItemsRepo.findOperatorsByType(
81
+ type,
82
+ loggedInUser?.organization_id,
83
+ );
78
84
  case 'custom':
79
85
  return this.fetchFromExternalSource(config.custom_source_id, params);
80
86
 
@@ -36,6 +36,8 @@ export class EntityTableRepository {
36
36
  displayType: string,
37
37
  organization_id: number,
38
38
  ) {
39
+ console.log(entityType, listType, displayType, organization_id);
40
+
39
41
  const whereCondition: any = {
40
42
  mapped_entity_type: entityType,
41
43
  list_type: listType,
@@ -7,7 +7,7 @@ import { BaseEntity } from '../entity/base-entity.entity';
7
7
  import { LoggingService } from '../../../utils/service/loggingUtil.service';
8
8
  import { EntityListData } from '../dto/entity-list-data.dto';
9
9
  import { EntityListService } from './entity-list.service';
10
- import { EntityManager } from 'typeorm';
10
+ import { DataSource, EntityManager } from 'typeorm';
11
11
  import { ExcelData } from '../../../utils/dto/excel-data.dto';
12
12
  import * as fs from 'fs';
13
13
  import * as path from 'path';
@@ -15,8 +15,12 @@ import { ExcelHelper } from '../../../utils/service/excel-helper.service';
15
15
  import { ExcelsheetData } from '../../../utils/dto/excelsheet-data.dto';
16
16
  import { EntityTableService } from './entity-table.service';
17
17
  import { EntityTableColumnService } from './entity-table-column.service';
18
- import { ENTITYTYPE_ENTITYMASTER } from '../../../constant/global.constant';
18
+ import {
19
+ ENTITYTYPE_ENTITYMASTER,
20
+ STATUS_ACTIVE,
21
+ } from '../../../constant/global.constant';
19
22
  import { EntityValidationService } from './entity-validation.service';
23
+ import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
20
24
 
21
25
  @Injectable()
22
26
  export class EntityServiceImpl implements EntityService<BaseEntity> {
@@ -29,6 +33,8 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
29
33
  @Inject() protected readonly loggingService: LoggingService;
30
34
  @Inject()
31
35
  protected readonly entityValidationService: EntityValidationService;
36
+ // @Inject('ListMasterService')
37
+ // private readonly listMasterService: ListMasterService;
32
38
 
33
39
  async createEntity(
34
40
  entityData: BaseEntity,
@@ -80,6 +86,16 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
80
86
  entityData.code = entityData.entity_type + maxSeqNo;
81
87
  }
82
88
 
89
+ // const resolveStatus = await this.listMasterService.getResolvedListCode(
90
+ // STATUS_ACTIVE,
91
+ // loggedInUser?.organization_id || 0,
92
+ // );
93
+
94
+ const statusList = await repo.query(
95
+ `SELECT id FROM cr_list_master_items WHERE code = ? AND organization_id = ?`,
96
+ [STATUS_ACTIVE, loggedInUser?.organization_id || 0],
97
+ );
98
+
83
99
  entityData.created_date = new Date();
84
100
  if (loggedInUser) {
85
101
  entityData.created_by = loggedInUser.id;
@@ -89,8 +105,8 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
89
105
  entityData.enterprise_id = loggedInUser.enterprise_id;
90
106
  if (!entityData.level_type)
91
107
  entityData.level_type = loggedInUser.level_type;
92
-
93
108
  if (!entityData.level_id) entityData.level_id = loggedInUser.level_id;
109
+ if (!entityData.status) entityData.status = statusList.id;
94
110
  }
95
111
 
96
112
  return repo.save(entityData);
@@ -221,7 +237,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
221
237
 
222
238
  async updateEntity(
223
239
  entityData: BaseEntity,
224
- loggedInUser: UserData | null,
240
+ loggedInUser: UserData,
225
241
  appcode?: string,
226
242
  ) {
227
243
  const entityMaster = await this.entityMasterService.getEntityData(
@@ -81,13 +81,14 @@ export class EntityTableService {
81
81
  displayType: string,
82
82
  loggedInUser: any,
83
83
  ) {
84
+ console.log(entityType, listType, displayType, loggedInUser);
84
85
  let entityTable = await this.findByEntityTypeAndListTypeAndDisplayType(
85
86
  entityType,
86
87
  listType,
87
88
  displayType,
88
89
  loggedInUser?.organization_id,
89
90
  );
90
-
91
+ console.log(entityTable, 'entityTable');
91
92
  let entityTableDto = entityTable as EntityTableDto;
92
93
  if (entityTable) {
93
94
  entityTableDto.column_list =
@@ -83,7 +83,7 @@ export class RoleService extends EntityServiceImpl {
83
83
 
84
84
  async updateEntity(
85
85
  entityData: BaseEntity,
86
- loggedInUser: UserData | null,
86
+ loggedInUser: UserData,
87
87
  ): Promise<ServiceResult<BaseEntity>> {
88
88
  if (!entityData.name) {
89
89
  return { success: false, error: 'Role name is required' };
@@ -1,19 +1,19 @@
1
1
  # DB_HOST: "13.234.25.234"
2
- DB_HOST: "13.234.25.234"
3
- DB_PORT: "3306"
4
- DB_USER: "root"
5
- DB_PASS: "Rezolut@123"
6
- DB_NAME: "core"
7
- MASTER_KEY: "0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh"
8
- MASTER_IV: "heuUQf5uPVtkotrFAOKUVw=="
9
- SECRET_KEY: "1hard_to_guess_secret7890a"
10
- CLIENT_ID: "324529881356-596sc8ksrb9lg01i7sktofqqqf0fv2ug.apps.googleusercontent.com"
11
- CLIENT_SECRET: "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"
12
- CALLBACK_URL: "http://localhost:3000/auth/google/callback"
13
- OTP_EXPIRY: "10"
14
- OTP_LENGTH: "6"
15
- VERIFY_OTP: "false"
16
- DEFAULT_OTP: "123456"
2
+ DB_HOST: '13.234.25.234'
3
+ DB_PORT: '3306'
4
+ DB_USER: 'root'
5
+ DB_PASS: 'Rezolut@123'
6
+ DB_NAME: 'core'
7
+ MASTER_KEY: '0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh'
8
+ MASTER_IV: 'heuUQf5uPVtkotrFAOKUVw=='
9
+ SECRET_KEY: '1hard_to_guess_secret7890a'
10
+ CLIENT_ID: '324529881356-596sc8ksrb9lg01i7sktofqqqf0fv2ug.apps.googleusercontent.com'
11
+ CLIENT_SECRET: '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'
12
+ CALLBACK_URL: 'http://localhost:3000/auth/google/callback'
13
+ OTP_EXPIRY: '10'
14
+ OTP_LENGTH: '6'
15
+ VERIFY_OTP: 'false'
16
+ DEFAULT_OTP: '123456'
17
17
  TOKEN_EXPIRY: 1
18
18
  # AWS:
19
19
  # S3: