rez_core 5.0.86 → 5.0.88
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/.vscode/extensions.json +5 -0
- package/dist/module/enterprise/repository/school.repository.d.ts +3 -3
- package/dist/module/enterprise/repository/school.repository.js +56 -70
- package/dist/module/enterprise/repository/school.repository.js.map +1 -1
- package/dist/module/mapper/service/field-mapper.service.d.ts +1 -3
- package/dist/module/mapper/service/field-mapper.service.js +10 -10
- package/dist/module/mapper/service/field-mapper.service.js.map +1 -1
- package/dist/module/meta/controller/meta.controller.d.ts +4 -1
- package/dist/module/meta/repository/entity-attribute-update.repository.d.ts +5 -3
- package/dist/module/meta/repository/entity-attribute-update.repository.js +19 -13
- package/dist/module/meta/repository/entity-attribute-update.repository.js.map +1 -1
- package/dist/module/meta/repository/entity-master.repository.d.ts +8 -4
- package/dist/module/meta/repository/entity-master.repository.js +15 -12
- package/dist/module/meta/repository/entity-master.repository.js.map +1 -1
- package/dist/module/meta/service/entity-dynamic.service.js +5 -2
- package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
- package/dist/module/meta/service/entity-master.service.d.ts +4 -1
- package/dist/module/meta/service/resolver.service.d.ts +5 -3
- package/dist/module/meta/service/resolver.service.js +25 -34
- package/dist/module/meta/service/resolver.service.js.map +1 -1
- package/dist/module/module/repository/menu.repository.js +1 -1
- package/dist/module/module/repository/menu.repository.js.map +1 -1
- package/dist/module/user/service/login.service.d.ts +4 -7
- package/dist/module/user/service/login.service.js +24 -20
- package/dist/module/user/service/login.service.js.map +1 -1
- package/dist/module/user/service/user-session.service.d.ts +8 -5
- package/dist/module/user/service/user-session.service.js +45 -24
- package/dist/module/user/service/user-session.service.js.map +1 -1
- package/dist/module/workflow/controller/action-template-mapping.controller.d.ts +1 -1
- package/dist/module/workflow/repository/stage.repository.js.map +1 -1
- package/dist/module/workflow/service/action-template-mapping.service.d.ts +3 -4
- package/dist/module/workflow/service/action-template-mapping.service.js +43 -33
- package/dist/module/workflow/service/action-template-mapping.service.js.map +1 -1
- package/dist/module/workflow/service/populate-workflow.service.js.map +1 -1
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/repository/school.repository.ts +68 -74
- package/src/module/mapper/service/field-mapper.service.ts +11 -13
- package/src/module/meta/repository/entity-attribute-update.repository.ts +31 -27
- package/src/module/meta/repository/entity-master.repository.ts +12 -14
- package/src/module/meta/service/entity-dynamic.service.ts +5 -38
- package/src/module/meta/service/resolver.service.ts +23 -47
- package/src/module/module/repository/menu.repository.ts +1 -1
- package/src/module/user/service/login.service.ts +26 -26
- package/src/module/user/service/user-session.service.ts +41 -32
- package/src/module/workflow/repository/stage.repository.ts +0 -12
- package/src/module/workflow/service/action-template-mapping.service.ts +47 -47
- package/src/module/workflow/service/populate-workflow.service.ts +0 -13
- package/src/module/workflow/service/workflow-meta.service.ts +0 -18
- package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +0 -5
- package/.idea/250218_nodejs_core.iml +0 -12
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { BadRequestException, Inject, Injectable } from '@nestjs/common';
|
|
2
2
|
import { ConfigService } from '@nestjs/config';
|
|
3
3
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
4
|
-
import {
|
|
5
|
-
INVITATION_STATUS_ACCEPTED,
|
|
6
|
-
STATUS_ACTIVE,
|
|
7
|
-
} from 'src/constant/global.constant';
|
|
4
|
+
import { INVITATION_STATUS_ACCEPTED, STATUS_ACTIVE } from 'src/constant/global.constant';
|
|
8
5
|
import { OrganizationRepository } from 'src/module/enterprise/repository/organization.repository';
|
|
9
6
|
import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
|
|
10
|
-
import {
|
|
7
|
+
import { Repository } from 'typeorm';
|
|
11
8
|
import { EncryptUtilService } from '../../../utils/service/encryptUtil.service';
|
|
12
|
-
import { Role } from '../entity/role.entity';
|
|
13
9
|
import { UserRoleMapping } from '../entity/user-role-mapping.entity';
|
|
14
|
-
import { UserData } from '../entity/user.entity';
|
|
15
10
|
import { UserSessionService } from './user-session.service';
|
|
16
11
|
import { UserService } from './user.service';
|
|
17
12
|
import { JwtAuthService } from 'src/module/auth/services/jwt.service';
|
|
13
|
+
import { ReflectionHelper } from '../../../utils/service/reflection-helper.service';
|
|
18
14
|
|
|
19
15
|
@Injectable()
|
|
20
16
|
export class LoginService {
|
|
@@ -24,16 +20,13 @@ export class LoginService {
|
|
|
24
20
|
private configService: ConfigService,
|
|
25
21
|
@InjectRepository(UserRoleMapping)
|
|
26
22
|
private readonly userRoleMappingRepository: Repository<UserRoleMapping>,
|
|
27
|
-
@InjectRepository(Role)
|
|
28
|
-
private readonly roleRepo: Repository<Role>,
|
|
29
|
-
private readonly dataSource: DataSource,
|
|
30
23
|
private readonly organizationRepository: OrganizationRepository,
|
|
31
24
|
@Inject('ListMasterService')
|
|
32
25
|
private readonly listMasterService: ListMasterService,
|
|
33
26
|
private readonly jwtAuthService: JwtAuthService,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
private readonly reflectionHelper: ReflectionHelper,
|
|
28
|
+
) {
|
|
29
|
+
}
|
|
37
30
|
|
|
38
31
|
masterKey: string = this.configService.get('MASTER_KEY') || '';
|
|
39
32
|
masterIv: string = this.configService.get('MASTER_IV') || '';
|
|
@@ -196,16 +189,17 @@ export class LoginService {
|
|
|
196
189
|
if (body) {
|
|
197
190
|
const { entity_type, entity_id } = body;
|
|
198
191
|
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
192
|
+
const leadRepo = this.reflectionHelper.getRepoService('CRMLead');
|
|
193
|
+
const entityData = await leadRepo.findOne({
|
|
194
|
+
where: { id: entity_id },
|
|
195
|
+
});
|
|
202
196
|
|
|
203
|
-
if (entityData
|
|
204
|
-
const level_id = entityData
|
|
205
|
-
const level_type = entityData
|
|
206
|
-
const organization_id = entityData
|
|
197
|
+
if (entityData) {
|
|
198
|
+
const level_id = entityData.level_id;
|
|
199
|
+
const level_type = entityData.level_type;
|
|
200
|
+
const organization_id = entityData.organization_id;
|
|
207
201
|
|
|
208
|
-
const token =
|
|
202
|
+
const token = this.jwtAuthService.generateJwt({
|
|
209
203
|
level_id: level_id,
|
|
210
204
|
level_type: level_type,
|
|
211
205
|
organization_id: organization_id,
|
|
@@ -260,15 +254,21 @@ export class LoginService {
|
|
|
260
254
|
if (brnAccesses.length) {
|
|
261
255
|
const brandId = brnAccesses[0].level_id;
|
|
262
256
|
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
257
|
+
const schoolRepo = this.reflectionHelper.getRepoService('SSOSchool');
|
|
258
|
+
|
|
259
|
+
const rows = await schoolRepo.findOne({
|
|
260
|
+
where: {
|
|
261
|
+
brand_id: brandId,
|
|
262
|
+
},
|
|
263
|
+
order: {
|
|
264
|
+
id: 'ASC',
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
267
|
|
|
268
268
|
if (rows.length) {
|
|
269
269
|
return {
|
|
270
270
|
level_type: 'SCH',
|
|
271
|
-
level_id: rows
|
|
271
|
+
level_id: rows.id,
|
|
272
272
|
appcode: brnAccesses[0].appcode,
|
|
273
273
|
};
|
|
274
274
|
} else {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { get } from 'http';
|
|
2
1
|
import { UserSession } from '../entity/user-session.entity';
|
|
3
2
|
import { ClockIDGenService } from '../../../utils/service/clockIDGenUtil.service';
|
|
4
3
|
import { BadRequestException, Injectable } from '@nestjs/common';
|
|
@@ -6,9 +5,11 @@ import { UserSessionRepository } from '../repository/userSession.repository';
|
|
|
6
5
|
import { JwtAuthService } from 'src/module/auth/services/jwt.service';
|
|
7
6
|
import { ConfigService } from '@nestjs/config';
|
|
8
7
|
import { UserRoleMappingService } from './user-role-mapping.service';
|
|
9
|
-
import { DataSource } from 'typeorm';
|
|
8
|
+
import { DataSource, Repository } from 'typeorm';
|
|
10
9
|
import { UserRoleMapping } from '../entity/user-role-mapping.entity';
|
|
11
10
|
import { UserData } from '../entity/user.entity';
|
|
11
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
12
|
+
import { ReflectionHelper } from '../../../utils/service/reflection-helper.service';
|
|
12
13
|
|
|
13
14
|
@Injectable()
|
|
14
15
|
export class UserSessionService {
|
|
@@ -17,8 +18,11 @@ export class UserSessionService {
|
|
|
17
18
|
private readonly jwtAuthService: JwtAuthService,
|
|
18
19
|
private readonly clockIDGenService: ClockIDGenService,
|
|
19
20
|
private configService: ConfigService,
|
|
20
|
-
|
|
21
|
-
private readonly
|
|
21
|
+
@InjectRepository(UserData)
|
|
22
|
+
private readonly userDataRepository:Repository<UserData>,
|
|
23
|
+
@InjectRepository(UserRoleMapping)
|
|
24
|
+
private readonly userRoleMappingRepository:Repository<UserRoleMapping>,
|
|
25
|
+
private readonly reflectionHelper: ReflectionHelper
|
|
22
26
|
) {}
|
|
23
27
|
async createSession(user, appcode?: string, accessInfo?: any) {
|
|
24
28
|
const sessionToken = this.clockIDGenService.idGenerator('SES');
|
|
@@ -86,26 +90,27 @@ export class UserSessionService {
|
|
|
86
90
|
appcode: data.appcode,
|
|
87
91
|
};
|
|
88
92
|
|
|
89
|
-
let getUserDetails;
|
|
93
|
+
let getUserDetails: UserData | null = null;
|
|
90
94
|
|
|
91
95
|
if (currentUser) {
|
|
92
96
|
// Check if user has any role mappings for the given appcode
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
97
|
+
|
|
98
|
+
getUserDetails = await this.userDataRepository.findOne({
|
|
99
|
+
where: {
|
|
100
|
+
id: currentUser.id,
|
|
101
|
+
}
|
|
102
|
+
})
|
|
99
103
|
}
|
|
100
104
|
|
|
101
|
-
if (getUserDetails
|
|
105
|
+
if (getUserDetails?.organization_id == 1 && payload.level_type == 'ORG') {
|
|
102
106
|
payload.organization_id = payload.level_id;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
|
-
await this.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
await this.userDataRepository.update(currentUser.id, {
|
|
110
|
+
last_app_access: data.appcode,
|
|
111
|
+
last_level_type: data.level_type,
|
|
112
|
+
last_level_id: data.level_id,
|
|
113
|
+
});
|
|
109
114
|
|
|
110
115
|
return {
|
|
111
116
|
success: true,
|
|
@@ -122,21 +127,20 @@ export class UserSessionService {
|
|
|
122
127
|
levelType: string,
|
|
123
128
|
levelId: string,
|
|
124
129
|
): Promise<boolean> {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
.createQueryBuilder(
|
|
128
|
-
.where(
|
|
129
|
-
.andWhere(
|
|
130
|
-
.andWhere(
|
|
131
|
-
.andWhere(
|
|
130
|
+
|
|
131
|
+
const count = await this.userRoleMappingRepository
|
|
132
|
+
.createQueryBuilder("urm")
|
|
133
|
+
.where("urm.user_id = :userId", { userId })
|
|
134
|
+
.andWhere("urm.appcode = :appcode", { appcode })
|
|
135
|
+
.andWhere("urm.level_type = :levelType", { levelType })
|
|
136
|
+
.andWhere("urm.level_id = :levelId", { levelId })
|
|
132
137
|
.getCount();
|
|
133
138
|
|
|
134
139
|
return count > 0;
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
async getUserRoleMappingForApp(userId: number, appcode: string) {
|
|
138
|
-
const mapping = await this.
|
|
139
|
-
.getRepository(UserRoleMapping)
|
|
143
|
+
const mapping = await this.userRoleMappingRepository
|
|
140
144
|
.createQueryBuilder('sso_user_role_mapping')
|
|
141
145
|
.where('sso_user_role_mapping.user_id = :userId', { userId })
|
|
142
146
|
.andWhere('sso_user_role_mapping.appcode = :appcode', { appcode })
|
|
@@ -149,16 +153,21 @@ export class UserSessionService {
|
|
|
149
153
|
|
|
150
154
|
//DONE
|
|
151
155
|
// If BRN, resolve first SCH under this brand
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
const schoolRepo = this.reflectionHelper.getRepoService('SSOSchool');
|
|
157
|
+
const schools = await schoolRepo.findOne({
|
|
158
|
+
where: {
|
|
159
|
+
brand_id: mapping.level_id
|
|
160
|
+
},
|
|
161
|
+
order: {
|
|
162
|
+
id: "ASC"
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
if (schools) {
|
|
158
167
|
return {
|
|
159
168
|
...mapping,
|
|
160
169
|
level_type: 'SCH',
|
|
161
|
-
level_id: schools
|
|
170
|
+
level_id: schools.id,
|
|
162
171
|
};
|
|
163
172
|
}
|
|
164
173
|
|
|
@@ -94,18 +94,6 @@ export class StageRepository {
|
|
|
94
94
|
`,
|
|
95
95
|
[stageGroup.workflow_id, organization_id, stage_group_id],
|
|
96
96
|
);
|
|
97
|
-
// const rows2 = await this.dataSource.query(
|
|
98
|
-
// `
|
|
99
|
-
// SELECT
|
|
100
|
-
// g.id as stage_group_id, g.name as stage_group_name, g.workflow_id,
|
|
101
|
-
// s.*
|
|
102
|
-
// FROM frm_wf_stage_group g
|
|
103
|
-
// INNER JOIN frm_wf_stage s ON s.stage_group_id = g.id
|
|
104
|
-
// WHERE g.workflow_id = ? AND g.organization_id = ?
|
|
105
|
-
// ORDER BY g.id, s.id
|
|
106
|
-
// `,
|
|
107
|
-
// [stageGroup.workflow_id, organization_id],
|
|
108
|
-
// );
|
|
109
97
|
|
|
110
98
|
// console.log(rows2, '-----------INNER JOIN----------');
|
|
111
99
|
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { level } from 'winston';
|
|
2
1
|
import { Injectable } from '@nestjs/common';
|
|
3
2
|
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
4
|
-
import {
|
|
3
|
+
import { Repository } from 'typeorm';
|
|
5
4
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
6
5
|
import { ListMasterItems } from '../../listmaster/entity/list-master-items.entity';
|
|
7
6
|
import { CommTemplate } from '../entity/comm-template.entity';
|
|
8
7
|
|
|
9
8
|
@Injectable()
|
|
10
9
|
export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
11
|
-
constructor(
|
|
12
|
-
@InjectRepository(ListMasterItems)
|
|
10
|
+
constructor(@InjectRepository(ListMasterItems)
|
|
13
11
|
private listMasterItemsRepo: Repository<ListMasterItems>,
|
|
14
12
|
@InjectRepository(CommTemplate)
|
|
15
13
|
private commTemplateRepository: Repository<CommTemplate>,
|
|
16
|
-
|
|
14
|
+
) {
|
|
17
15
|
super();
|
|
18
16
|
}
|
|
17
|
+
|
|
19
18
|
async getTemplateByMode(
|
|
20
19
|
stage_id: number,
|
|
21
20
|
action_id: number,
|
|
@@ -25,26 +24,26 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
25
24
|
let stageAction = [] as any;
|
|
26
25
|
|
|
27
26
|
if (action_id != 0) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
);
|
|
27
|
+
const stageActionMappingRepo = this.reflectionHelper.getRepoService('StageActionMapping');
|
|
28
|
+
|
|
29
|
+
stageAction = await stageActionMappingRepo.find({
|
|
30
|
+
where: {
|
|
31
|
+
action_id: action_id,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
35
34
|
} else {
|
|
36
35
|
// generic action
|
|
37
36
|
// get template by mode
|
|
38
37
|
|
|
39
38
|
let modeId = mode;
|
|
40
39
|
if (!modeId) {
|
|
41
|
-
const rows =
|
|
40
|
+
const rows = await this.listMasterItemsRepo.find({
|
|
42
41
|
where: {
|
|
43
42
|
listtype: 'MOD',
|
|
44
43
|
code: 'email',
|
|
45
44
|
organization_id: loggedInUser.organization_id,
|
|
46
|
-
}
|
|
47
|
-
})
|
|
45
|
+
},
|
|
46
|
+
});
|
|
48
47
|
|
|
49
48
|
modeId = rows?.[0]?.id ?? 0;
|
|
50
49
|
}
|
|
@@ -89,43 +88,44 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
89
88
|
const stgActMappingId = stageAction[0].id;
|
|
90
89
|
|
|
91
90
|
if (!mode) {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
);
|
|
99
|
-
mode = getModeFromAction[0]?.mode;
|
|
100
|
-
}
|
|
91
|
+
const actionRepo = this.reflectionHelper.getRepoService('ActionEntity');
|
|
92
|
+
const getModeFromAction = await actionRepo.findOne({
|
|
93
|
+
where: {
|
|
94
|
+
id: action_id,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
101
97
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
mode = getModeFromAction?.mode;
|
|
99
|
+
}
|
|
100
|
+
const actionResourceMappingRepo = this.reflectionHelper.getRepoService('ActionResourcesMapping');
|
|
101
|
+
const templates = await actionResourceMappingRepo.find({
|
|
102
|
+
where: {
|
|
103
|
+
stg_act_mapping_id: stgActMappingId,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
109
106
|
|
|
110
107
|
const templateCodes = templates.map((t) => t.template_code);
|
|
111
108
|
if (!templateCodes.length) return [];
|
|
112
109
|
|
|
113
|
-
const
|
|
114
|
-
`
|
|
115
|
-
SELECT code as value, name as label , id
|
|
116
|
-
FROM frm_wf_comm_template
|
|
117
|
-
WHERE code IN ($1) AND mode = $2 AND organization_id = $3 AND level_type = $4 AND level_id = $5 AND status IN (SELECT id FROM frm_list_master_items WHERE code = 'STATUS_ACTIVE' AND organization_id = $6)
|
|
118
|
-
`,
|
|
119
|
-
[
|
|
120
|
-
templateCodes,
|
|
121
|
-
mode,
|
|
122
|
-
loggedInUser.organization_id,
|
|
123
|
-
loggedInUser.level_type,
|
|
124
|
-
Number(loggedInUser.level_id),
|
|
125
|
-
Number(loggedInUser.organization_id),
|
|
126
|
-
],
|
|
127
|
-
);
|
|
110
|
+
const commTemplateRepo = this.reflectionHelper.getRepoService('CommTemplate');
|
|
128
111
|
|
|
129
|
-
return
|
|
112
|
+
return await commTemplateRepo
|
|
113
|
+
.createQueryBuilder('ct')
|
|
114
|
+
.select([
|
|
115
|
+
'ct.code AS value',
|
|
116
|
+
'ct.name AS label',
|
|
117
|
+
'ct.id AS id',
|
|
118
|
+
])
|
|
119
|
+
.where('ct.code IN (:...codes)', { codes: templateCodes })
|
|
120
|
+
.andWhere('ct.mode = :mode', { mode })
|
|
121
|
+
.andWhere('ct.organization_id = :orgId', { orgId: loggedInUser.organization_id })
|
|
122
|
+
.andWhere('ct.level_type = :levelType', { levelType: loggedInUser.level_type })
|
|
123
|
+
.andWhere('ct.level_id = :levelId', { levelId: Number(loggedInUser.level_id) })
|
|
124
|
+
.andWhere(`ct.status IN (
|
|
125
|
+
SELECT id FROM frm_list_master_items
|
|
126
|
+
WHERE code = 'STATUS_ACTIVE'
|
|
127
|
+
AND organization_id = :orgId2
|
|
128
|
+
)`, { orgId2: loggedInUser.organization_id })
|
|
129
|
+
.getRawMany();
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -34,11 +34,6 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
34
34
|
|
|
35
35
|
if (!listMasterItemsRepo) return;
|
|
36
36
|
|
|
37
|
-
// let statusRow = await this.dataSource.query(
|
|
38
|
-
// `SELECT * FROM frm_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = $1`,
|
|
39
|
-
// [organization_id],
|
|
40
|
-
// );
|
|
41
|
-
|
|
42
37
|
let statusRow = await listMasterItemsRepo.findOne({
|
|
43
38
|
where: { code: 'STATUS_ACTIVE', organization_id: organization_id },
|
|
44
39
|
});
|
|
@@ -117,14 +112,6 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
117
112
|
const viewMasterRepo = this.reflectionHelper.getRepoService('ViewMaster');
|
|
118
113
|
|
|
119
114
|
// Fetch all base data
|
|
120
|
-
// const getAllFactoryData = async (table: { table: string }) =>
|
|
121
|
-
// this.dataSource.query(
|
|
122
|
-
// `SELECT * FROM ${table.table} WHERE organization_id = -1 AND level_type = 'ORG' AND level_id = -1`,
|
|
123
|
-
// );
|
|
124
|
-
// const factoryData = await Promise.all(
|
|
125
|
-
// workflowTables.map(getAllFactoryData),
|
|
126
|
-
// );
|
|
127
|
-
// const [workflows, stageGroups, stages] = factoryData;
|
|
128
115
|
|
|
129
116
|
// === 1. Workflow mapping
|
|
130
117
|
const workflowIdMap: Record<number, number> = {};
|
|
@@ -351,10 +351,6 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
351
351
|
}
|
|
352
352
|
})
|
|
353
353
|
|
|
354
|
-
// const assignmentType = await this.dataSource.query(
|
|
355
|
-
// `SELECT value FROM frm_list_master_items WHERE id = ${Number(firstAction.assignment_type)}`,
|
|
356
|
-
// );
|
|
357
|
-
|
|
358
354
|
// save in action data
|
|
359
355
|
await this.actionDataService.saveActionData(
|
|
360
356
|
actions,
|
|
@@ -598,20 +594,6 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
598
594
|
const nextUser = userIds[nextIdx];
|
|
599
595
|
|
|
600
596
|
//4) Update lead owner in the lead table no need because we are updating lead owner in updateLeadOwner method
|
|
601
|
-
// await this.dataSource.query(
|
|
602
|
-
// `
|
|
603
|
-
// UPDATE crm_lead
|
|
604
|
-
// SET lead_owner = ?
|
|
605
|
-
// WHERE organization_id = ?
|
|
606
|
-
// AND level_id = ?
|
|
607
|
-
// AND level_type = ?
|
|
608
|
-
// AND lead_owner IS NULL
|
|
609
|
-
// ORDER BY created_date ASC
|
|
610
|
-
// LIMIT 1
|
|
611
|
-
// `,
|
|
612
|
-
// [nextUser, organization_id, Number(level_id), level_type],
|
|
613
|
-
// );
|
|
614
|
-
|
|
615
597
|
console.log(`Assigning lead to user ID: ${nextUser}`);
|
|
616
598
|
|
|
617
599
|
const firstAction = actions[0];
|
|
@@ -168,11 +168,6 @@ export class WorkflowAutomationEngineService {
|
|
|
168
168
|
for (const action of actions) {
|
|
169
169
|
try {
|
|
170
170
|
// 2 Resolve action_decorator using action_category_id
|
|
171
|
-
// const category = await this.dataSource.query(
|
|
172
|
-
// `SELECT action_decorator FROM frm_wf_action_category WHERE id = ?`,
|
|
173
|
-
// [action.action_category_id],
|
|
174
|
-
// );
|
|
175
|
-
|
|
176
171
|
const category = await this.actionCateRepo.findOne({
|
|
177
172
|
where: {
|
|
178
173
|
id: action.action_category_id,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$">
|
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
-
</content>
|
|
9
|
-
<orderEntry type="inheritedJdk" />
|
|
10
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
-
</component>
|
|
12
|
-
</module>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
-
<code_scheme name="Project" version="173">
|
|
3
|
-
<HTMLCodeStyleSettings>
|
|
4
|
-
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
-
</HTMLCodeStyleSettings>
|
|
6
|
-
<JSCodeStyleSettings version="0">
|
|
7
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
-
</JSCodeStyleSettings>
|
|
15
|
-
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
19
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
20
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
21
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
22
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
23
|
-
</TypeScriptCodeStyleSettings>
|
|
24
|
-
<VueCodeStyleSettings>
|
|
25
|
-
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
26
|
-
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
27
|
-
</VueCodeStyleSettings>
|
|
28
|
-
<codeStyleSettings language="HTML">
|
|
29
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
30
|
-
<indentOptions>
|
|
31
|
-
<option name="INDENT_SIZE" value="2" />
|
|
32
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
-
<option name="TAB_SIZE" value="2" />
|
|
34
|
-
</indentOptions>
|
|
35
|
-
</codeStyleSettings>
|
|
36
|
-
<codeStyleSettings language="JavaScript">
|
|
37
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
-
<indentOptions>
|
|
39
|
-
<option name="INDENT_SIZE" value="2" />
|
|
40
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
-
<option name="TAB_SIZE" value="2" />
|
|
42
|
-
</indentOptions>
|
|
43
|
-
</codeStyleSettings>
|
|
44
|
-
<codeStyleSettings language="TypeScript">
|
|
45
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
-
<indentOptions>
|
|
47
|
-
<option name="INDENT_SIZE" value="2" />
|
|
48
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
-
<option name="TAB_SIZE" value="2" />
|
|
50
|
-
</indentOptions>
|
|
51
|
-
</codeStyleSettings>
|
|
52
|
-
<codeStyleSettings language="Vue">
|
|
53
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
-
<indentOptions>
|
|
55
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
56
|
-
</indentOptions>
|
|
57
|
-
</codeStyleSettings>
|
|
58
|
-
</code_scheme>
|
|
59
|
-
</component>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/250218_nodejs_core.iml" filepath="$PROJECT_DIR$/.idea/250218_nodejs_core.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/prettier.xml
DELETED