rez_core 5.0.285 → 5.0.286

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": "5.0.285",
3
+ "version": "5.0.286",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -1,4 +1,4 @@
1
- import { Injectable } from '@nestjs/common';
1
+ import { Inject, Injectable } from '@nestjs/common';
2
2
  import { EntityServiceImpl } from './entity-service-impl.service';
3
3
  import { BaseEntity } from '../entity/base-entity.entity';
4
4
  import { UserData } from '../../user/entity/user.entity';
@@ -12,6 +12,8 @@ import { ViewMaterRespository } from '../repository/view-master.repository';
12
12
  import { get } from 'http';
13
13
  import { ConfigService } from '@nestjs/config';
14
14
  import axios from 'axios';
15
+ import { IMicroserviceClients } from 'src/module/microservice-client/service/microservice-clients';
16
+ import { firstValueFrom } from 'rxjs';
15
17
  @Injectable()
16
18
  export class ViewMasterService extends EntityServiceImpl {
17
19
  constructor(
@@ -20,6 +22,8 @@ export class ViewMasterService extends EntityServiceImpl {
20
22
  private readonly viewMasterRepoService: ViewMaterRespository,
21
23
  private readonly dataSource: DataSource,
22
24
  private readonly configService: ConfigService,
25
+ @Inject('MICROSERVICE_CLIENT_FACTORY')
26
+ private readonly factory: IMicroserviceClients,
23
27
  ) {
24
28
  super();
25
29
  }
@@ -81,39 +85,48 @@ export class ViewMasterService extends EntityServiceImpl {
81
85
  async getEntityData(
82
86
  entityType: string,
83
87
  id: number,
84
- loggedInUserData?: UserData | null,
88
+ loggedInUser?: UserData | null,
85
89
  ) {
86
90
  let getTheme = null as any;
87
91
 
88
- try {
89
- const baseUrl = this.configService.get<string>('REDIRECT_BE_URL');
92
+ const client = this.factory.getClient('ADM');
90
93
 
91
- // Make the GET request with query parameters
92
- const response = await axios.get<any>(
93
- `${baseUrl}/school/public/theme_json/${loggedInUserData?.level_id}`,
94
-
95
- {
96
- headers: {
97
- 'Content-Type': 'application/json',
98
- },
99
- },
100
- );
101
-
102
- getTheme = response.data;
103
- } catch (error) {
104
- console.error('Internal Entity API call failed:', error.message);
94
+ if (!client) {
95
+ return null;
105
96
  }
106
97
 
107
- const viewMaster = await super.getEntityData(
108
- entityType,
109
- id,
110
- loggedInUserData,
98
+ getTheme = await firstValueFrom(
99
+ client.send('FRM.entity.getById', {
100
+ entityType: 'SCH',
101
+ id: loggedInUser?.level_id,
102
+ loggedInUser,
103
+ }),
111
104
  );
112
105
 
106
+ // try {
107
+ // const baseUrl = this.configService.get<string>('REDIRECT_BE_URL');
108
+
109
+ // // Make the GET request with query parameters
110
+ // const response = await axios.get<any>(
111
+ // `${baseUrl}/school/public/theme_json/${loggedInUserData?.level_id}`,
112
+
113
+ // {
114
+ // headers: {
115
+ // 'Content-Type': 'application/json',
116
+ // },
117
+ // },
118
+ // );
119
+
120
+ // getTheme = response.data;
121
+ // } catch (error) {
122
+ // console.error('Internal Entity API call failed:', error.message);
123
+ // }
124
+
125
+ const viewMaster = await super.getEntityData(entityType, id, loggedInUser);
126
+
113
127
  return {
114
128
  ...viewMaster,
115
- theme_json:
116
- getTheme && getTheme[0]?.theme_json ? getTheme[0].theme_json : null,
129
+ theme_json: getTheme && getTheme?.theme_json ? getTheme.theme_json : null,
117
130
  };
118
131
  }
119
132
 
@@ -78,7 +78,9 @@ export class WorkflowAutomationService extends EntityServiceImpl {
78
78
  workflow_automation_id: number,
79
79
  ): Promise<WorkflowAutomationActionEntity[]> {
80
80
  return this.actionRepo.find({
81
- where: { workflow_automation_id },
81
+ where: { workflow_automation_id,
82
+ status: 'ACTIVE',
83
+ },
82
84
  });
83
85
  }
84
86