rez_core 3.1.202 → 3.1.204

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 (36) hide show
  1. package/dist/config/database.config.js +1 -1
  2. package/dist/config/database.config.js.map +1 -1
  3. package/dist/module/enterprise/repository/school.repository.js +5 -5
  4. package/dist/module/enterprise/repository/school.repository.js.map +1 -1
  5. package/dist/module/lead/repository/lead.repository.js +1 -1
  6. package/dist/module/lead/repository/lead.repository.js.map +1 -1
  7. package/dist/module/module/repository/menu.repository.js +1 -1
  8. package/dist/module/module/service/module-access.service.js +1 -1
  9. package/dist/module/module/service/module-access.service.js.map +1 -1
  10. package/dist/module/user/service/login.service.js +1 -1
  11. package/dist/module/user/service/login.service.js.map +1 -1
  12. package/dist/module/user/service/user-session.service.js +1 -1
  13. package/dist/module/user/service/user-session.service.js.map +1 -1
  14. package/dist/module/workflow/controller/action.controller.d.ts +9 -0
  15. package/dist/module/workflow/controller/action.controller.js +14 -0
  16. package/dist/module/workflow/controller/action.controller.js.map +1 -1
  17. package/dist/module/workflow/repository/action.repository.d.ts +4 -0
  18. package/dist/module/workflow/repository/action.repository.js +24 -0
  19. package/dist/module/workflow/repository/action.repository.js.map +1 -1
  20. package/dist/module/workflow/service/action.service.d.ts +4 -0
  21. package/dist/module/workflow/service/action.service.js +3 -0
  22. package/dist/module/workflow/service/action.service.js.map +1 -1
  23. package/dist/tsconfig.build.tsbuildinfo +1 -1
  24. package/package.json +1 -1
  25. package/src/config/database.config.ts +1 -1
  26. package/src/module/enterprise/repository/school.repository.ts +5 -5
  27. package/src/module/lead/repository/lead.repository.ts +1 -1
  28. package/src/module/module/repository/menu.repository.ts +1 -1
  29. package/src/module/module/service/module-access.service.ts +1 -1
  30. package/src/module/user/service/login.service.ts +1 -1
  31. package/src/module/user/service/user-session.service.ts +1 -1
  32. package/src/module/workflow/controller/action.controller.ts +16 -0
  33. package/src/module/workflow/repository/action.repository.ts +40 -0
  34. package/src/module/workflow/service/action.service.ts +12 -0
  35. package/src/resources/dev.properties.yaml +1 -1
  36. package/src/resources/uat.properties.yaml +31 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "3.1.202",
3
+ "version": "3.1.204",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -15,7 +15,7 @@ export class MySqlConfiguration implements TypeOrmOptionsFactory {
15
15
  password: this.configService.get('DB_PASS') || 'Rezolut@123',
16
16
  database: this.configService.get('DB_NAME') || 'core',
17
17
  entities: [__dirname + '/../module/**/*.entity.{ts,js}'],
18
- synchronize: true,
18
+ synchronize: false,
19
19
  autoLoadEntities: true,
20
20
  poolSize: 5,
21
21
  };
@@ -13,7 +13,7 @@ export class SchoolRepository {
13
13
  return await this.dataSource
14
14
  .createQueryBuilder()
15
15
  .select(['*'])
16
- .from('eth_school_profile', 'sch')
16
+ .from('sso_school', 'sch')
17
17
  .where('sch.organization_id = :orgId', { orgId })
18
18
  .getRawMany();
19
19
  }
@@ -22,7 +22,7 @@ export class SchoolRepository {
22
22
  return await this.dataSource
23
23
  .createQueryBuilder()
24
24
  .select(['*'])
25
- .from('eth_school_profile', 'sch')
25
+ .from('sso_school', 'sch')
26
26
  .where('sch.brand_id = :brdId', { brdId })
27
27
  .getRawMany();
28
28
  }
@@ -77,7 +77,7 @@ export class SchoolRepository {
77
77
  'brand_profile',
78
78
  'brand_profile.parent_id = brn.id AND brand_profile.organization_id = org.id',
79
79
  )
80
- .innerJoin('eth_school_profile', 'school', 'school.brand_id = brn.id')
80
+ .innerJoin('sso_school', 'school', 'school.brand_id = brn.id')
81
81
  .leftJoin('eth_address', 'address', 'address.parent_id = school.id')
82
82
  .where('org.id = :orgId', { orgId: currentORGLevel_id })
83
83
  .distinct(true)
@@ -203,7 +203,7 @@ export class SchoolRepository {
203
203
  ])
204
204
  .from('sso_user_role_mapping', 'urm')
205
205
  .innerJoin('sso_organization', 'brand', 'brand.id = urm.level_id')
206
- .innerJoin('eth_school_profile', 'school', 'school.brand_id = brand.id')
206
+ .innerJoin('sso_school', 'school', 'school.brand_id = brand.id')
207
207
  .innerJoin('eth_address', 'address', 'address.parent_id = school.id')
208
208
  .where('urm.user_id = :userId', { userId })
209
209
  .andWhere('urm.appcode = :appCode', { appCode })
@@ -223,7 +223,7 @@ export class SchoolRepository {
223
223
  'school.status AS school_status',
224
224
  ])
225
225
  .from('sso_user_role_mapping', 'urm')
226
- .innerJoin('eth_school_profile', 'school', 'school.id = urm.level_id')
226
+ .innerJoin('sso_school', 'school', 'school.id = urm.level_id')
227
227
  .innerJoin('sso_organization', 'brand', 'brand.id = school.brand_id')
228
228
  .innerJoin('eth_address', 'address', 'address.parent_id = school.id')
229
229
  .where('urm.user_id = :userId', { userId })
@@ -33,7 +33,7 @@ export class LeadRepository {
33
33
  return await this.dataSource
34
34
  .createQueryBuilder()
35
35
  .select(['*'])
36
- .from('eth_school_profile', 'sch')
36
+ .from('sso_school', 'sch')
37
37
  .where('sch.brand_id = :brdId', { brdId: brand_id })
38
38
  .andWhere('sch.organization_id = :orgId', { orgId: organization_id })
39
39
  .getRawMany();
@@ -141,7 +141,7 @@ export class MenuRepository extends Repository<MenuData> {
141
141
  const [sch] = await this.dataSource.query(
142
142
  `
143
143
  SELECT s.brand_id, s.organization_id
144
- FROM eth_school_profile s
144
+ FROM sso_school s
145
145
  WHERE s.id = ?
146
146
  `,
147
147
  [levelId],
@@ -185,7 +185,7 @@ export class ModuleAccessService {
185
185
  // Step 3: If level_type is SCH, check school status using raw query
186
186
  if (level_type === 'SCH') {
187
187
  const result = await this.dataSource.query(
188
- `SELECT * FROM eth_school_profile WHERE id = ${level_id}`,
188
+ `SELECT * FROM sso_school WHERE id = ${level_id}`,
189
189
  [level_id],
190
190
  );
191
191
 
@@ -215,7 +215,7 @@ export class LoginService {
215
215
  const brandId = brnAccesses[0].level_id;
216
216
 
217
217
  const rows = await this.dataSource.query(
218
- `SELECT id FROM eth_school_profile WHERE brand_id = ? ORDER BY id ASC LIMIT 1`,
218
+ `SELECT id FROM sso_school WHERE brand_id = ? ORDER BY id ASC LIMIT 1`,
219
219
  [brandId],
220
220
  );
221
221
 
@@ -150,7 +150,7 @@ export class UserSessionService {
150
150
  //DONE
151
151
  // If BRN, resolve first SCH under this brand
152
152
  const schools = await this.dataSource.query(
153
- `SELECT id FROM eth_school_profile WHERE brand_id = ? ORDER BY id ASC LIMIT 1`,
153
+ `SELECT id FROM sso_school WHERE brand_id = ? ORDER BY id ASC LIMIT 1`,
154
154
  [mapping.level_id],
155
155
  );
156
156
 
@@ -55,6 +55,22 @@ export class ActionController {
55
55
  return result;
56
56
  }
57
57
 
58
+ @Post('/get_dependent_action')
59
+ @HttpCode(HttpStatus.OK)
60
+ async getDependentActions(
61
+ @Req() req: Request & { user: any },
62
+ @Body() body: { stage_id: number; action_id?: number },
63
+ ) {
64
+ const loggedInUser = req.user.userData;
65
+
66
+ const result = this.actionService.getDependentActions(
67
+ loggedInUser,
68
+ body.stage_id,
69
+ body.action_id,
70
+ );
71
+ return result;
72
+ }
73
+
58
74
  @Post('/getaction')
59
75
  @HttpCode(HttpStatus.OK)
60
76
  async getAction(
@@ -167,6 +167,46 @@ export class ActionRepository {
167
167
  return enrichedResult;
168
168
  }
169
169
 
170
+ async getDependentActions(
171
+ loggedInUser: UserData,
172
+ stage_id: number,
173
+ action_id?: number,
174
+ ) {
175
+ // Step 1: Get all action_ids for the provided stage_id
176
+ const stageActions = await this.dataSource.query(
177
+ `
178
+ SELECT action_id
179
+ FROM cr_wf_stage_action_mapping
180
+ WHERE stage_id = ?
181
+ `,
182
+ [stage_id],
183
+ );
184
+
185
+ if (!stageActions?.length) return [];
186
+
187
+ const actionIds = stageActions.map((sa) => sa.action_id);
188
+
189
+ // Step 2: Fetch action details except the provided action_id incase it is provided
190
+ const filteredActionIds = action_id
191
+ ? actionIds.filter((id) => id !== action_id)
192
+ : actionIds;
193
+
194
+ const actionResults = await this.dataSource
195
+ .createQueryBuilder()
196
+ .select(['a.id AS action_id', 'a.name AS action_name'])
197
+ .from('cr_wf_action', 'a')
198
+ .andWhere('a.id IN(:...actionIds)', { actionIds: filteredActionIds })
199
+ .getRawMany();
200
+
201
+ // Step 3: Format result
202
+ const enrichedResult = actionResults.map((row) => ({
203
+ value: row.action_id,
204
+ label: row.action_name,
205
+ }));
206
+
207
+ return enrichedResult;
208
+ }
209
+
170
210
  async getAction(
171
211
  organization_id: number,
172
212
  stage_id: number,
@@ -246,6 +246,18 @@ export class ActionService extends EntityServiceImpl {
246
246
  return this.actionRepository.getActions(loggedInUser, stage_id);
247
247
  }
248
248
 
249
+ async getDependentActions(
250
+ loggedInUser: UserData,
251
+ stage_id: number,
252
+ action_id: number | undefined,
253
+ ) {
254
+ return this.actionRepository.getDependentActions(
255
+ loggedInUser,
256
+ stage_id,
257
+ action_id,
258
+ );
259
+ }
260
+
249
261
  async getAction(
250
262
  loggedInUser: UserData,
251
263
  stage_id: number,
@@ -4,7 +4,7 @@ DB_HOST: '13.234.25.234'
4
4
  DB_PORT: '3306'
5
5
  DB_USER: 'root'
6
6
  DB_PASS: 'Rezolut@123'
7
- DB_NAME: 'package_core'
7
+ DB_NAME: 'ether_dev'
8
8
  MASTER_KEY: '0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh'
9
9
  MASTER_IV: 'heuUQf5uPVtkotrFAOKUVw=='
10
10
  SECRET_KEY: '1hard_to_guess_secret7890a'
@@ -1,16 +1,31 @@
1
- DB_HOST: "13.200.182.92"
2
- DB_PORT: "3306"
3
- DB_USER: "root"
4
- DB_PASS: "ether"
5
- DB_NAME: "ether_core"
6
- MASTER_KEY: "0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh"
7
- MASTER_IV: "heuUQf5uPVtkotrFAOKUVw=="
8
- SECRET_KEY: "1hard_to_guess_secret7890a"
9
- CLIENT_ID: "324529881356-596sc8ksrb9lg01i7sktofqqqf0fv2ug.apps.googleusercontent.com"
10
- CLIENT_SECRET: "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"
11
- CALLBACK_URL: "http://localhost:3000/auth/google/callback"
12
- OTP_EXPIRY: "10"
13
- OTP_LENGTH: "6"
14
- VERIFY_OTP: "false"
15
- DEFAULT_OTP: "123456"
16
- TOKEN_EXPIRY: 1
1
+ DB_HOST: '13.235.102.26'
2
+ DB_PORT: '3306'
3
+ DB_USER: 'root'
4
+ DB_PASS: 'Ether@123'
5
+ DB_NAME: 'ether_uat'
6
+ MASTER_KEY: '0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh'
7
+ MASTER_IV: 'heuUQf5uPVtkotrFAOKUVw=='
8
+ SECRET_KEY: '1hard_to_guess_secret7890a'
9
+ CLIENT_ID: '324529881356-596sc8ksrb9lg01i7sktofqqqf0fv2ug.apps.googleusercontent.com'
10
+ CLIENT_SECRET: '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'
11
+ CALLBACK_URL: 'http://ether.rezolut.in/api/admin/auth/google/callback'
12
+ DOMAIN_URL: 'rezolut.in'
13
+ OTP_EXPIRY: '10'
14
+ OTP_LENGTH: '6'
15
+ VERIFY_OTP: 'true'
16
+ DEFAULT_OTP: '123456'
17
+ PROFILE: 'UAT'
18
+ DEFAULT_ADMIN: 'ADMIN'
19
+ TOKEN_EXPIRY: 1
20
+ AWS:
21
+ S3:
22
+ AWS_ACCESS_KEY_ID: 'AKIAYYKIBDDSQF3KILGE'
23
+ AWS_SECRET_KEY: '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'
24
+ AWS_REGION: 'ap-south-1'
25
+ BUCKET_NAME: 'testether'
26
+ EMAIL_USER: 'poornima.rezolut@gmail.com'
27
+ EMAIL_PASSWORD: 'dakd fyau uvbv zwsb'
28
+
29
+ FIREBASE_PROJECT_ID: 'sample-d7855'
30
+ FIREBASE_CLIENT_EMAIL: 'firebase-adminsdk-fbsvc@sample-d7855.iam.gserviceaccount.com'
31
+ FIREBASE_PRIVATE_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