rez_core 2.2.231 → 2.2.234

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 (21) hide show
  1. package/dist/module/enterprise/enterprise.module.js +1 -1
  2. package/dist/module/user/service/login.service.js +1 -0
  3. package/dist/module/user/service/login.service.js.map +1 -1
  4. package/dist/module/workflow-automation/entity/workflow-automation-action.entity.d.ts +1 -1
  5. package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js +2 -2
  6. package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js.map +1 -1
  7. package/dist/module/workflow-automation/service/workflow-automation-engine.service.js +4 -0
  8. package/dist/module/workflow-automation/service/workflow-automation-engine.service.js.map +1 -1
  9. package/dist/module/workflow-automation/service/workflow-automation.service.d.ts +3 -2
  10. package/dist/module/workflow-automation/service/workflow-automation.service.js +4 -2
  11. package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
  12. package/dist/module/workflow-automation/workflow-automation.module.js +2 -0
  13. package/dist/module/workflow-automation/workflow-automation.module.js.map +1 -1
  14. package/dist/tsconfig.build.tsbuildinfo +1 -1
  15. package/package.json +1 -1
  16. package/src/module/enterprise/enterprise.module.ts +1 -1
  17. package/src/module/user/service/login.service.ts +1 -0
  18. package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +2 -2
  19. package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +4 -0
  20. package/src/module/workflow-automation/service/workflow-automation.service.ts +6 -3
  21. package/src/module/workflow-automation/workflow-automation.module.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.2.231",
3
+ "version": "2.2.234",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -16,7 +16,7 @@ import { SchoolRepository } from './repository/school.repository';
16
16
  TypeOrmModule.forFeature([OrganizationData, OrganizationAppMapping]),
17
17
  forwardRef(() => UserModule),
18
18
  UtilsModule,
19
- EntityModule
19
+ EntityModule,
20
20
  ],
21
21
  controllers: [OrganizationController],
22
22
  providers: [
@@ -280,6 +280,7 @@ export class LoginService {
280
280
  // Create session (Same as JWT login flow)
281
281
  return await this.login({
282
282
  email,
283
+ is_otp: true,
283
284
  });
284
285
  }
285
286
 
@@ -15,8 +15,8 @@ export class WorkflowAutomationActionEntity extends BaseEntity {
15
15
  @Column({ type: 'int', nullable: true })
16
16
  action_category_id: number;
17
17
 
18
- @Column({ type: 'varchar', nullable: true })
19
- payload: string;
18
+ @Column({ type: 'json', nullable: true })
19
+ payload: JSON;
20
20
 
21
21
  @Column({ type: 'varchar', nullable: true })
22
22
  action_decorator: string;
@@ -27,12 +27,14 @@ export class WorkflowAutomationEngineService {
27
27
  eventType,
28
28
  );
29
29
 
30
+ console.log(workflows, 'workflows found');
30
31
  for (const wf of workflows) {
31
32
  const eventMatched = await this.filterEvaluator.evaluateTriggerAttributes(
32
33
  oldEntity,
33
34
  newEntity,
34
35
  wf.condition_filter_code,
35
36
  );
37
+ console.log(eventMatched, 'eventMatched');
36
38
  if (!eventMatched) continue;
37
39
 
38
40
  const criteriaMatched = await this.filterEvaluator.evaluateCriteria(
@@ -41,6 +43,7 @@ export class WorkflowAutomationEngineService {
41
43
  newEntity.id,
42
44
  user,
43
45
  );
46
+ console.log(criteriaMatched, 'criteriaMatched');
44
47
  if (!criteriaMatched) continue;
45
48
 
46
49
  await this.executeActions(wf.id, newEntity, user);
@@ -56,6 +59,7 @@ export class WorkflowAutomationEngineService {
56
59
  const actions = await this.wfService.getActionsForRule(
57
60
  workflow_automation_id,
58
61
  );
62
+ console.log(actions, 'actions found');
59
63
  // (this should fetch from cr_workflow_automation_action)
60
64
 
61
65
  for (const action of actions) {
@@ -3,17 +3,20 @@ import { InjectRepository } from '@nestjs/typeorm';
3
3
  import { Repository } from 'typeorm';
4
4
  import { WorkflowAutomation } from '../entity/workflow-automation.entity';
5
5
  import { WorkflowAutomationActionEntity } from '../entity/workflow-automation-action.entity';
6
+ import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
6
7
 
7
8
  @Injectable()
8
- export class WorkflowAutomationService {
9
+ export class WorkflowAutomationService extends EntityServiceImpl {
9
10
  constructor(
10
11
  @InjectRepository(WorkflowAutomation)
11
12
  private readonly wfRepo: Repository<WorkflowAutomation>,
12
13
  @InjectRepository(WorkflowAutomationActionEntity)
13
14
  private readonly actionRepo: Repository<WorkflowAutomationActionEntity>,
14
- ) {}
15
+ ) {
16
+ super();
17
+ }
15
18
 
16
- async createRule(
19
+ asyncreateRule(
17
20
  data: Partial<WorkflowAutomation>,
18
21
  ): Promise<WorkflowAutomation> {
19
22
  const rule = this.wfRepo.create(data);
@@ -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 { DiscoveryModule } from '@nestjs/core';
4
4
  import { WorkflowAutomation } from './entity/workflow-automation.entity';
@@ -7,6 +7,7 @@ import { WorkflowAutomationEngineService } from './service/workflow-automation-e
7
7
  import { FilterModule } from '../filter/filter.module';
8
8
  import { WorkflowAutomationService } from './service/workflow-automation.service';
9
9
  import { WorkflowAutomationActionEntity } from './entity/workflow-automation-action.entity';
10
+ import { EntityModule } from '../meta/entity.module';
10
11
  import { ActionRegistryService } from './service/action-registery.service';
11
12
 
12
13
  @Module({
@@ -16,6 +17,7 @@ import { ActionRegistryService } from './service/action-registery.service';
16
17
  WorkflowAutomationActionEntity,
17
18
  ]),
18
19
  FilterModule,
20
+ forwardRef(() => EntityModule),
19
21
  DiscoveryModule, // 👈 enables provider scanning
20
22
  ],
21
23
  providers: [