rez_core 2.2.10 → 2.2.12
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/dist/constant/global.constant.d.ts +1 -0
- package/dist/constant/global.constant.js +2 -1
- package/dist/constant/global.constant.js.map +1 -1
- package/dist/module/notification/controller/otp.controller.d.ts +4 -1
- package/dist/module/notification/controller/otp.controller.js +17 -3
- package/dist/module/notification/controller/otp.controller.js.map +1 -1
- package/dist/module/notification/notification.module.js +33 -4
- package/dist/module/notification/notification.module.js.map +1 -1
- package/dist/module/notification/service/email.service.d.ts +7 -0
- package/dist/module/notification/service/email.service.js +49 -0
- package/dist/module/notification/service/email.service.js.map +1 -0
- package/dist/module/workflow/controller/action-category.controller.d.ts +6 -0
- package/dist/module/workflow/controller/action-category.controller.js +14 -0
- package/dist/module/workflow/controller/action-category.controller.js.map +1 -1
- package/dist/module/workflow/controller/action-resource-mapping.controller.d.ts +5 -0
- package/dist/module/workflow/controller/action-resource-mapping.controller.js +31 -0
- package/dist/module/workflow/controller/action-resource-mapping.controller.js.map +1 -0
- package/dist/module/workflow/controller/action.controller.d.ts +3 -0
- package/dist/module/workflow/entity/action-category.entity.d.ts +3 -0
- package/dist/module/workflow/entity/action-category.entity.js +12 -0
- package/dist/module/workflow/entity/action-category.entity.js.map +1 -1
- package/dist/module/workflow/entity/action-resources-mapping.entity.d.ts +7 -0
- package/dist/module/workflow/entity/action-resources-mapping.entity.js +39 -0
- package/dist/module/workflow/entity/action-resources-mapping.entity.js.map +1 -0
- package/dist/module/workflow/repository/action.repository.d.ts +3 -0
- package/dist/module/workflow/repository/action.repository.js +28 -3
- package/dist/module/workflow/repository/action.repository.js.map +1 -1
- package/dist/module/workflow/repository/task.repository.js +1 -0
- package/dist/module/workflow/repository/task.repository.js.map +1 -1
- package/dist/module/workflow/service/action-category.service.d.ts +4 -0
- package/dist/module/workflow/service/action-category.service.js +12 -0
- package/dist/module/workflow/service/action-category.service.js.map +1 -1
- package/dist/module/workflow/service/action-resources-mapping.service.d.ts +6 -0
- package/dist/module/workflow/service/action-resources-mapping.service.js +27 -0
- package/dist/module/workflow/service/action-resources-mapping.service.js.map +1 -0
- package/dist/module/workflow/service/action.service.d.ts +3 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -1
- package/src/constant/global.constant.ts +1 -0
- package/src/module/notification/controller/otp.controller.ts +41 -14
- package/src/module/notification/notification.module.ts +33 -4
- package/src/module/notification/service/email.service.ts +39 -0
- package/src/module/workflow/controller/action-category.controller.ts +14 -0
- package/src/module/workflow/controller/action-resource-mapping.controller.ts +23 -0
- package/src/module/workflow/entity/action-category.entity.ts +9 -0
- package/src/module/workflow/entity/action-resources-mapping.entity.ts +23 -0
- package/src/module/workflow/repository/action.repository.ts +39 -7
- package/src/module/workflow/repository/task.repository.ts +1 -0
- package/src/module/workflow/service/action-category.service.ts +20 -0
- package/src/module/workflow/service/action-resources-mapping.service.ts +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rez_core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"private": false,
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@aws-sdk/client-s3": "^3.804.0",
|
|
25
|
+
"@nestjs-modules/mailer": "^2.0.2",
|
|
25
26
|
"@nestjs/axios": "^4.0.0",
|
|
26
27
|
"@nestjs/common": "^11.0.1",
|
|
27
28
|
"@nestjs/config": "^4.0.1",
|
|
@@ -41,9 +42,11 @@
|
|
|
41
42
|
"crypto-js": "^4.2.0",
|
|
42
43
|
"dotenv": "^16.4.7",
|
|
43
44
|
"exceljs": "^4.4.0",
|
|
45
|
+
"handlebars": "^4.7.8",
|
|
44
46
|
"moment": "^2.30.1",
|
|
45
47
|
"multer": "^1.4.5-lts.2",
|
|
46
48
|
"mysql2": "^3.12.0",
|
|
49
|
+
"nodemailer": "^7.0.5",
|
|
47
50
|
"passport": "^0.7.0",
|
|
48
51
|
"passport-google-oauth20": "^2.0.0",
|
|
49
52
|
"passport-jwt": "^4.0.1",
|
|
@@ -67,6 +70,7 @@
|
|
|
67
70
|
"@types/jest": "^29.5.14",
|
|
68
71
|
"@types/multer": "^1.4.12",
|
|
69
72
|
"@types/node": "^22.10.7",
|
|
73
|
+
"@types/nodemailer": "^6.4.17",
|
|
70
74
|
"@types/supertest": "^6.0.2",
|
|
71
75
|
"eslint": "^9.18.0",
|
|
72
76
|
"eslint-config-prettier": "^10.0.1",
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
BadRequestException,
|
|
3
|
+
Body,
|
|
4
|
+
Controller,
|
|
5
|
+
Get,
|
|
6
|
+
HttpCode,
|
|
7
|
+
HttpStatus,
|
|
8
|
+
Post,
|
|
9
|
+
Query,
|
|
10
|
+
} from '@nestjs/common';
|
|
2
11
|
import { OtpService } from '../service/otp.service';
|
|
3
12
|
import { ConfigService } from '@nestjs/config';
|
|
13
|
+
import { EmailService } from '../service/email.service';
|
|
4
14
|
|
|
5
15
|
@Controller('otp')
|
|
6
|
-
export class OtpController{
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
export class OtpController {
|
|
17
|
+
constructor(
|
|
18
|
+
private readonly otpService: OtpService,
|
|
19
|
+
private readonly emailService: EmailService,
|
|
9
20
|
private configService: ConfigService,
|
|
10
|
-
) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
otpLength = this.configService.get('OTP_LENGTH')|| '6';
|
|
21
|
+
) {}
|
|
22
|
+
|
|
23
|
+
otpExpiry = this.configService.get('OTP_EXPIRY') || '2';
|
|
24
|
+
otpLength = this.configService.get('OTP_LENGTH') || '6';
|
|
15
25
|
|
|
16
26
|
@Post('generate')
|
|
17
27
|
@HttpCode(HttpStatus.OK)
|
|
@@ -19,11 +29,16 @@ export class OtpController{
|
|
|
19
29
|
let identifier = request.identifier;
|
|
20
30
|
let service = request.service;
|
|
21
31
|
|
|
22
|
-
if(!identifier || !service) {
|
|
32
|
+
if (!identifier || !service) {
|
|
23
33
|
throw new BadRequestException('Missing identifier or service!');
|
|
24
34
|
}
|
|
25
|
-
let otp = await this.otpService.generate(
|
|
26
|
-
|
|
35
|
+
let otp = await this.otpService.generate(
|
|
36
|
+
identifier,
|
|
37
|
+
service,
|
|
38
|
+
parseInt(this.otpExpiry),
|
|
39
|
+
parseInt(this.otpLength),
|
|
40
|
+
);
|
|
41
|
+
return { otp_id: otp.otp_id, success: true };
|
|
27
42
|
}
|
|
28
43
|
|
|
29
44
|
@Post('verify')
|
|
@@ -36,6 +51,18 @@ export class OtpController{
|
|
|
36
51
|
if (!verify) {
|
|
37
52
|
throw new BadRequestException('Invalid OTP!');
|
|
38
53
|
}
|
|
39
|
-
return {
|
|
54
|
+
return { message: 'OTP verified successfully!', success: true };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@Get('send-mail')
|
|
58
|
+
@HttpCode(HttpStatus.OK)
|
|
59
|
+
async sendMail(@Query('email') email: string) {
|
|
60
|
+
// return await this.emailService.sendEmail(email, 'Harry', '123456');
|
|
61
|
+
return await this.emailService.sendEmailWithDynamicTemplate(
|
|
62
|
+
email,
|
|
63
|
+
'Sample OTP',
|
|
64
|
+
'<div style="font-family: Arial, sans-serif; padding: 20px; background-color: #f7f9fc; color: #333;"> <div style="max-width: 600px; margin: auto; background-color: #ffffff; padding: 30px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);"> <h2 style="color: #2c3e50;">Hello {{name}},</h2> <p style="font-size: 16px; line-height: 1.6;"> We received a request to verify your email address using a one-time password (OTP). </p> <p style="font-size: 16px; line-height: 1.6;"> Please use the following OTP to complete your action: </p> <div style="text-align: center; margin: 20px 0;"> <span style="font-size: 24px; font-weight: bold; color: #2e86de;">{{otp}}</span> </div> <p style="font-size: 16px; line-height: 1.6;"> This OTP is valid for the next 10 minutes. If you did not request this, please ignore this email. </p> <p style="font-size: 16px; line-height: 1.6;"> Regards,<br/> <strong>Your Company Team</strong> </p> <hr style="margin-top: 30px;"/> <p style="font-size: 12px; color: #999;"> This is an automated message, please do not reply to this email. </p> </div> </div>',
|
|
65
|
+
{ name: 'Harsh', otp: '123456' },
|
|
66
|
+
);
|
|
40
67
|
}
|
|
41
|
-
}
|
|
68
|
+
}
|
|
@@ -4,11 +4,40 @@ import { OtpRepository } from './repository/otp.repository';
|
|
|
4
4
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
5
5
|
import { Otp } from './entity/otp.entity';
|
|
6
6
|
import { OtpController } from './controller/otp.controller';
|
|
7
|
+
import { MailerModule } from '@nestjs-modules/mailer';
|
|
8
|
+
import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter';
|
|
9
|
+
import { EmailService } from './service/email.service';
|
|
10
|
+
import { join } from 'path';
|
|
7
11
|
|
|
8
12
|
@Module({
|
|
9
|
-
imports: [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
imports: [
|
|
14
|
+
TypeOrmModule.forFeature([Otp]),
|
|
15
|
+
MailerModule.forRootAsync({
|
|
16
|
+
useFactory: () => ({
|
|
17
|
+
transport: {
|
|
18
|
+
host: 'smtp.gmail.com',
|
|
19
|
+
port: 465,
|
|
20
|
+
secure: true,
|
|
21
|
+
auth: {
|
|
22
|
+
user: process.env.EMAIL_USER,
|
|
23
|
+
pass: process.env.EMAIL_PASSWORD,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaults: {
|
|
27
|
+
from: '"Support" <' + process.env.EMAIL_USER + '>',
|
|
28
|
+
},
|
|
29
|
+
template: {
|
|
30
|
+
dir: join(__dirname, '..', '..', 'templates'),
|
|
31
|
+
adapter: new HandlebarsAdapter(),
|
|
32
|
+
options: {
|
|
33
|
+
strict: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
],
|
|
39
|
+
providers: [OtpService, OtpRepository, EmailService],
|
|
40
|
+
exports: [OtpService, EmailService],
|
|
41
|
+
controllers: [OtpController],
|
|
13
42
|
})
|
|
14
43
|
export class NotificationModule {}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { MailerService } from '@nestjs-modules/mailer';
|
|
3
|
+
import * as Handlebars from 'handlebars';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class EmailService {
|
|
7
|
+
constructor(private readonly mailerService: MailerService) {}
|
|
8
|
+
|
|
9
|
+
async sendEmail(email, name: string, otp: string) {
|
|
10
|
+
this.mailerService
|
|
11
|
+
.sendMail({
|
|
12
|
+
to: email,
|
|
13
|
+
subject: 'Testing Nest MailerModule ✔', // Subject line
|
|
14
|
+
template: 'sample', // `.hbs` extension is appended automatically
|
|
15
|
+
context: {
|
|
16
|
+
name,
|
|
17
|
+
otp,
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
.then(() => {})
|
|
21
|
+
.catch(() => {});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async sendEmailWithDynamicTemplate(
|
|
25
|
+
email: string,
|
|
26
|
+
subject: string,
|
|
27
|
+
templateString: string,
|
|
28
|
+
context?: any,
|
|
29
|
+
) {
|
|
30
|
+
const compiled = Handlebars.compile(templateString);
|
|
31
|
+
const htmlContent = compiled(context);
|
|
32
|
+
|
|
33
|
+
await this.mailerService.sendMail({
|
|
34
|
+
to: email,
|
|
35
|
+
subject: subject,
|
|
36
|
+
html: htmlContent,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -32,4 +32,18 @@ export class ActionCategoryController {
|
|
|
32
32
|
);
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
@Post('/getreasoncode')
|
|
37
|
+
@HttpCode(HttpStatus.OK)
|
|
38
|
+
async getReasonCodeByActionCategoryId(
|
|
39
|
+
@Req() req: Request & { user: any },
|
|
40
|
+
@Body('action_cat_code') action_cat_code: string,
|
|
41
|
+
) {
|
|
42
|
+
const loggedInUser = req.user.userData;
|
|
43
|
+
const result = this.actionCategoryService.getReasonCodeByActionCategoryId(
|
|
44
|
+
loggedInUser,
|
|
45
|
+
action_cat_code,
|
|
46
|
+
);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
35
49
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Controller,
|
|
4
|
+
HttpCode,
|
|
5
|
+
HttpStatus,
|
|
6
|
+
Inject,
|
|
7
|
+
Post,
|
|
8
|
+
Req,
|
|
9
|
+
UseGuards,
|
|
10
|
+
} from '@nestjs/common';
|
|
11
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
12
|
+
import { ActionCategoryService } from '../service/action-category.service';
|
|
13
|
+
import { ActionResourcesMapping } from '../entity/action-resources-mapping.entity';
|
|
14
|
+
import { ActionResourcesMappingService } from '../service/action-resources-mapping.service';
|
|
15
|
+
|
|
16
|
+
@Controller('/actionResourcesMapping')
|
|
17
|
+
@UseGuards(JwtAuthGuard)
|
|
18
|
+
export class ActionResourcesMappingController {
|
|
19
|
+
constructor(
|
|
20
|
+
@Inject('ActionResourcesMappingService')
|
|
21
|
+
private readonly actionResourcesMapping: ActionResourcesMappingService,
|
|
22
|
+
) {}
|
|
23
|
+
}
|
|
@@ -17,4 +17,13 @@ export class ActionCategory extends BaseEntity {
|
|
|
17
17
|
|
|
18
18
|
@Column({ type: 'varchar', nullable: true })
|
|
19
19
|
mapped_entity_type: string;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'varchar', nullable: true })
|
|
22
|
+
reason_code: string;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'boolean', nullable: true })
|
|
25
|
+
is_template: boolean;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'boolean', nullable: true })
|
|
28
|
+
is_form: boolean;
|
|
20
29
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ACTION_CATEGORY,
|
|
3
|
+
ACTION_RESOURCES_MAPPING,
|
|
4
|
+
} from 'src/constant/global.constant';
|
|
5
|
+
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
6
|
+
import { Column, Entity } from 'typeorm';
|
|
7
|
+
|
|
8
|
+
@Entity({ name: 'cr_wf_action_resources_mapping' })
|
|
9
|
+
export class ActionResourcesMapping extends BaseEntity {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.entity_type = ACTION_RESOURCES_MAPPING;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'varchar', nullable: true })
|
|
16
|
+
template_code: string;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'varchar', nullable: true })
|
|
19
|
+
type: string;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'varchar', nullable: true })
|
|
22
|
+
form_id: string;
|
|
23
|
+
}
|
|
@@ -33,12 +33,17 @@ export class ActionRepository {
|
|
|
33
33
|
|
|
34
34
|
const actionIds = stageActions.map((sa) => sa.action_id);
|
|
35
35
|
|
|
36
|
-
// Step 2: Fetch all actions
|
|
36
|
+
// Step 2: Fetch all actions with category details
|
|
37
37
|
const actions = await this.dataSource
|
|
38
38
|
.createQueryBuilder()
|
|
39
39
|
.select([
|
|
40
40
|
'a.id AS action_id',
|
|
41
41
|
'a.name AS action_name',
|
|
42
|
+
'a.reason_code AS action_reason_code',
|
|
43
|
+
'a.default_reason_code AS default_reason_code',
|
|
44
|
+
'a.default_value AS default_value',
|
|
45
|
+
'a.action_category AS action_category_id',
|
|
46
|
+
'ac.reason_code AS category_reason_code',
|
|
42
47
|
'ac.modalName AS modalName',
|
|
43
48
|
'ac.logo AS logo',
|
|
44
49
|
'ac.name AS action_category_name',
|
|
@@ -49,7 +54,7 @@ export class ActionRepository {
|
|
|
49
54
|
.andWhere('a.id IN (:...actionIds)', { actionIds })
|
|
50
55
|
.getRawMany();
|
|
51
56
|
|
|
52
|
-
// Step 3: Fetch action_data
|
|
57
|
+
// Step 3: Fetch action_data
|
|
53
58
|
const actionData = await this.dataSource
|
|
54
59
|
.createQueryBuilder()
|
|
55
60
|
.select([
|
|
@@ -61,15 +66,12 @@ export class ActionRepository {
|
|
|
61
66
|
.from('cr_wf_action_data', 'ad')
|
|
62
67
|
.where('ad.stage_id = :stageId', { stageId: stage_id })
|
|
63
68
|
.andWhere('ad.action_id IN (:...actionIds)', { actionIds })
|
|
64
|
-
.andWhere('ad.mapped_entity_id = :mapped_entity_id', {
|
|
65
|
-
mapped_entity_id,
|
|
66
|
-
})
|
|
69
|
+
.andWhere('ad.mapped_entity_id = :mapped_entity_id', { mapped_entity_id })
|
|
67
70
|
.andWhere('ad.mapped_entity_type = :mapped_entity_type', {
|
|
68
71
|
mapped_entity_type,
|
|
69
72
|
})
|
|
70
73
|
.getRawMany();
|
|
71
74
|
|
|
72
|
-
// Step 4: Build map of action_id to data
|
|
73
75
|
const actionIdToData = actionData.reduce((acc, row) => {
|
|
74
76
|
acc[row.action_id] = {
|
|
75
77
|
is_current: row.is_current === 'Y',
|
|
@@ -79,21 +81,51 @@ export class ActionRepository {
|
|
|
79
81
|
return acc;
|
|
80
82
|
}, {});
|
|
81
83
|
|
|
82
|
-
// Step
|
|
84
|
+
// Step 4: Resolve all default_reason_code values (regardless of default_value)
|
|
85
|
+
const allDefaultReasonIds = actions
|
|
86
|
+
.filter((row) => row.default_reason_code)
|
|
87
|
+
.map((row) => row.default_reason_code);
|
|
88
|
+
|
|
89
|
+
let defaultReasonMap = {};
|
|
90
|
+
if (allDefaultReasonIds.length > 0) {
|
|
91
|
+
const listItems = await this.dataSource
|
|
92
|
+
.createQueryBuilder()
|
|
93
|
+
.select(['id', 'name'])
|
|
94
|
+
.from('cr_list_master_items', 'li')
|
|
95
|
+
.where('li.id IN (:...ids)', { ids: allDefaultReasonIds })
|
|
96
|
+
.getRawMany();
|
|
97
|
+
|
|
98
|
+
defaultReasonMap = listItems.reduce((acc, item) => {
|
|
99
|
+
acc[item.id] = item.name;
|
|
100
|
+
return acc;
|
|
101
|
+
}, {});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Step 5: Enrich actions
|
|
83
105
|
const enrichedResult = actions.map((row) => {
|
|
84
106
|
const data = actionIdToData[row.action_id];
|
|
107
|
+
|
|
108
|
+
const reason_code =
|
|
109
|
+
row.action_reason_code && row.action_reason_code.trim()
|
|
110
|
+
? row.action_reason_code
|
|
111
|
+
: row.category_reason_code;
|
|
112
|
+
|
|
85
113
|
return {
|
|
86
114
|
value: row.action_id,
|
|
87
115
|
label: row.action_name,
|
|
88
116
|
modalName: row.modalName,
|
|
89
117
|
logo: row.logo,
|
|
90
118
|
name: row.action_category_name,
|
|
119
|
+
reason_code,
|
|
120
|
+
default_reason_code: defaultReasonMap[row.default_reason_code] || null,
|
|
121
|
+
is_default: row.default_value === 1,
|
|
91
122
|
is_current: data?.is_current ?? false,
|
|
92
123
|
is_done: data?.is_done ?? false,
|
|
93
124
|
is_mandatory: data?.is_mandatory ?? false,
|
|
94
125
|
};
|
|
95
126
|
});
|
|
96
127
|
|
|
128
|
+
// Step 6: Add fallback option
|
|
97
129
|
enrichedResult.push({
|
|
98
130
|
value: 0,
|
|
99
131
|
label: 'Generic',
|
|
@@ -27,4 +27,24 @@ export class ActionCategoryService extends EntityServiceImpl {
|
|
|
27
27
|
value: row.id,
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
async getReasonCodeByActionCategoryId(
|
|
32
|
+
loggedInUser: UserData,
|
|
33
|
+
action_cat_code: string,
|
|
34
|
+
) {
|
|
35
|
+
const { organization_id } = loggedInUser;
|
|
36
|
+
const result = await this.dataSource.query(
|
|
37
|
+
`
|
|
38
|
+
SELECT id, reason_code
|
|
39
|
+
FROM cr_wf_action_category
|
|
40
|
+
WHERE organization_id = ? AND code = ?
|
|
41
|
+
`,
|
|
42
|
+
[organization_id, action_cat_code],
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
success: true,
|
|
47
|
+
value: result?.[0]?.reason_code || null,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
30
50
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
|
|
3
|
+
import { DataSource } from 'typeorm';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class ActionResourcesMappingService extends EntityServiceImpl {
|
|
7
|
+
constructor(private readonly dataSource: DataSource) {
|
|
8
|
+
super();
|
|
9
|
+
}
|
|
10
|
+
}
|