rez_core 2.1.113 → 2.1.115

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.1.113",
3
+ "version": "2.1.115",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -1,10 +1,9 @@
1
1
  import { Module } from '@nestjs/common';
2
2
  import { ResolverService } from './service/resolver.service';
3
3
  import { ResolverController } from './controller/resolver.controller';
4
- import { EntityModule } from '../meta/entity.module';
5
4
 
6
5
  @Module({
7
- imports: [EntityModule],
6
+ imports: [],
8
7
  controllers: [ResolverController],
9
8
  providers: [ResolverService],
10
9
  exports: [ResolverService],
@@ -4,10 +4,8 @@ import { UserData } from 'src/module/user/entity/user.entity';
4
4
  import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
5
5
 
6
6
  @Injectable()
7
- export class ResolverService extends EntityServiceImpl {
8
- constructor(private readonly dataSource: DataSource) {
9
- super();
10
- }
7
+ export class ResolverService {
8
+ constructor(private readonly dataSource: DataSource) {}
11
9
 
12
10
  async getResolvedData(
13
11
  loggedInUser: UserData,
@@ -29,24 +27,35 @@ export class ResolverService extends EntityServiceImpl {
29
27
 
30
28
  // -------- ENTITY data_source_type --------
31
29
  if (attr.data_source_type === 'entity') {
30
+ const [entityDef] = await this.dataSource.query(
31
+ `SELECT * FROM cr_entity_master WHERE mapped_entity_type = ? AND organization_id = ?`,
32
+ [attr.datasource_list, loggedInUser.organization_id],
33
+ );
34
+
35
+ if (!entityDef) {
36
+ // fallback or skip if no mapping found
37
+ resolvedEntityData[field] = codeValue;
38
+ continue;
39
+ }
40
+
41
+ const tableName = entityDef.db_table_name;
42
+
32
43
  if (Array.isArray(codeValue)) {
33
44
  const resolvedValues: string[] = [];
34
45
 
35
46
  for (const code of codeValue) {
36
- const item = await super.getEntityData(
37
- attr.datasource_list,
38
- code,
39
- loggedInUser,
47
+ const [item] = await this.dataSource.query(
48
+ `SELECT * FROM ${tableName} WHERE code = ? AND organization_id = ?`,
49
+ [code, loggedInUser.organization_id],
40
50
  );
41
51
  resolvedValues.push(item?.[attr.data_source_attribute] ?? code);
42
52
  }
43
53
 
44
54
  resolvedEntityData[field] = resolvedValues;
45
55
  } else {
46
- const item = await super.getEntityData(
47
- attr.datasource_list,
48
- codeValue,
49
- loggedInUser,
56
+ const [item] = await this.dataSource.query(
57
+ `SELECT * FROM ${tableName} WHERE code = ? AND organization_id = ?`,
58
+ [codeValue, loggedInUser.organization_id],
50
59
  );
51
60
  resolvedEntityData[field] =
52
61
  item?.[attr.data_source_attribute] ?? codeValue;
@@ -0,0 +1,23 @@
1
+ # DB_HOST: "13.234.25.234"
2
+ DB_HOST: 'localhost'
3
+ DB_PORT: '3306'
4
+ DB_USER: 'root'
5
+ DB_PASS: 'root'
6
+ DB_NAME: 'eth_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
+ TOKEN_EXPIRY: 1
18
+ AWS:
19
+ S3:
20
+ AWS_ACCESS_KEY_ID: 'AKIAYYKIBDDSQF3KILGE'
21
+ AWS_SECRET_KEY: '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'
22
+ AWS_REGION: 'ap-south-1'
23
+ BUCKET_NAME: 'testether'