@platform-modules/foreign-ministry 1.3.286 → 1.3.296
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/data-source.js +52 -0
- package/dist/helpers/employee-evaluation-request.utils.d.ts +30 -0
- package/dist/helpers/employee-evaluation-request.utils.js +139 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +84 -1
- package/dist/models/EmployeeEvaluationAnswerModel.d.ts +5 -8
- package/dist/models/EmployeeEvaluationAnswerModel.js +18 -16
- package/dist/models/EmployeeEvaluationApprovalModel.d.ts +1 -1
- package/dist/models/EmployeeEvaluationApprovalModel.js +2 -2
- package/dist/models/EmployeeEvaluationPersonScoreModel.d.ts +9 -0
- package/dist/models/EmployeeEvaluationPersonScoreModel.js +45 -0
- package/dist/models/EmployeeEvaluationRequestModel.d.ts +6 -1
- package/dist/models/EmployeeEvaluationRequestModel.js +18 -2
- package/dist/models/EmployeeOfMonthNominationApprovalModel.d.ts +22 -0
- package/dist/models/EmployeeOfMonthNominationApprovalModel.js +84 -0
- package/dist/models/EmployeeOfMonthNominationAttachmentModel.d.ts +10 -0
- package/dist/models/EmployeeOfMonthNominationAttachmentModel.js +48 -0
- package/dist/models/EmployeeOfMonthNominationChatModel.d.ts +18 -0
- package/dist/models/EmployeeOfMonthNominationChatModel.js +65 -0
- package/dist/models/EmployeeOfMonthNominationRequestModel.d.ts +32 -0
- package/dist/models/EmployeeOfMonthNominationRequestModel.js +76 -0
- package/dist/models/EmployeeOfMonthNominationWorkflowModel.d.ts +19 -0
- package/dist/models/EmployeeOfMonthNominationWorkflowModel.js +72 -0
- package/dist/models/EmployeeOfMonthSupportNominationApprovalModel.d.ts +22 -0
- package/dist/models/EmployeeOfMonthSupportNominationApprovalModel.js +84 -0
- package/dist/models/EmployeeOfMonthSupportNominationAttachmentModel.d.ts +10 -0
- package/dist/models/EmployeeOfMonthSupportNominationAttachmentModel.js +48 -0
- package/dist/models/EmployeeOfMonthSupportNominationChatModel.d.ts +18 -0
- package/dist/models/EmployeeOfMonthSupportNominationChatModel.js +65 -0
- package/dist/models/EmployeeOfMonthSupportNominationRequestModel.d.ts +27 -0
- package/dist/models/EmployeeOfMonthSupportNominationRequestModel.js +76 -0
- package/dist/models/EmployeeOfMonthSupportNominationWorkflowModel.d.ts +19 -0
- package/dist/models/EmployeeOfMonthSupportNominationWorkflowModel.js +72 -0
- package/dist/models/EvaluationEligibilitySettingModel.d.ts +2 -0
- package/dist/models/EvaluationEligibilitySettingModel.js +4 -0
- package/dist/models/InitiatorEmployeeNominationApprovalModel.d.ts +22 -0
- package/dist/models/InitiatorEmployeeNominationApprovalModel.js +84 -0
- package/dist/models/InitiatorEmployeeNominationAttachmentModel.d.ts +11 -0
- package/dist/models/InitiatorEmployeeNominationAttachmentModel.js +52 -0
- package/dist/models/InitiatorEmployeeNominationChatModel.d.ts +18 -0
- package/dist/models/InitiatorEmployeeNominationChatModel.js +65 -0
- package/dist/models/InitiatorEmployeeNominationRequestModel.d.ts +51 -0
- package/dist/models/InitiatorEmployeeNominationRequestModel.js +95 -0
- package/dist/models/InitiatorEmployeeNominationWorkflowModel.d.ts +19 -0
- package/dist/models/InitiatorEmployeeNominationWorkflowModel.js +72 -0
- package/dist/models/InnovativeEmployeeNominationApprovalModel.d.ts +22 -0
- package/dist/models/InnovativeEmployeeNominationApprovalModel.js +84 -0
- package/dist/models/InnovativeEmployeeNominationAttachmentModel.d.ts +11 -0
- package/dist/models/InnovativeEmployeeNominationAttachmentModel.js +52 -0
- package/dist/models/InnovativeEmployeeNominationChatModel.d.ts +18 -0
- package/dist/models/InnovativeEmployeeNominationChatModel.js +65 -0
- package/dist/models/InnovativeEmployeeNominationRequestModel.d.ts +23 -0
- package/dist/models/InnovativeEmployeeNominationRequestModel.js +88 -0
- package/dist/models/InnovativeEmployeeNominationWorkflowModel.d.ts +19 -0
- package/dist/models/InnovativeEmployeeNominationWorkflowModel.js +72 -0
- package/dist/models/IpeGrievanceApprovalModel.d.ts +22 -0
- package/dist/models/IpeGrievanceApprovalModel.js +84 -0
- package/dist/models/IpeGrievanceAttachmentModel.d.ts +11 -0
- package/dist/models/IpeGrievanceAttachmentModel.js +52 -0
- package/dist/models/IpeGrievanceChatModel.d.ts +18 -0
- package/dist/models/IpeGrievanceChatModel.js +65 -0
- package/dist/models/IpeGrievanceRequestModel.d.ts +57 -0
- package/dist/models/IpeGrievanceRequestModel.js +178 -0
- package/dist/models/IpeGrievanceWorkflowModel.d.ts +19 -0
- package/dist/models/IpeGrievanceWorkflowModel.js +72 -0
- package/package.json +24 -24
- package/src/data-source.ts +664 -612
- package/src/helpers/employee-evaluation-request.utils.ts +181 -0
- package/src/index.ts +572 -467
- package/src/models/EmployeeEvaluationAnswerModel.ts +26 -28
- package/src/models/EmployeeEvaluationApprovalModel.ts +2 -2
- package/src/models/EmployeeEvaluationPersonScoreModel.ts +25 -0
- package/src/models/EmployeeEvaluationRequestModel.ts +90 -77
- package/src/models/EmployeeOfMonthNominationApprovalModel.ts +56 -0
- package/src/models/EmployeeOfMonthNominationAttachmentModel.ts +26 -0
- package/src/models/EmployeeOfMonthNominationChatModel.ts +42 -0
- package/src/models/EmployeeOfMonthNominationRequestModel.ts +63 -0
- package/src/models/EmployeeOfMonthNominationWorkflowModel.ts +47 -0
- package/src/models/EmployeeOfMonthSupportNominationApprovalModel.ts +56 -0
- package/src/models/EmployeeOfMonthSupportNominationAttachmentModel.ts +26 -0
- package/src/models/EmployeeOfMonthSupportNominationChatModel.ts +42 -0
- package/src/models/EmployeeOfMonthSupportNominationRequestModel.ts +58 -0
- package/src/models/EmployeeOfMonthSupportNominationWorkflowModel.ts +47 -0
- package/src/models/EvaluationEligibilitySettingModel.ts +51 -47
- package/src/models/InitiatorEmployeeNominationApprovalModel.ts +56 -0
- package/src/models/InitiatorEmployeeNominationAttachmentModel.ts +29 -0
- package/src/models/InitiatorEmployeeNominationChatModel.ts +42 -0
- package/src/models/InitiatorEmployeeNominationRequestModel.ts +74 -0
- package/src/models/InitiatorEmployeeNominationWorkflowModel.ts +47 -0
- package/src/models/InnovativeEmployeeNominationApprovalModel.ts +56 -0
- package/src/models/InnovativeEmployeeNominationAttachmentModel.ts +29 -0
- package/src/models/InnovativeEmployeeNominationChatModel.ts +42 -0
- package/src/models/InnovativeEmployeeNominationRequestModel.ts +59 -0
- package/src/models/InnovativeEmployeeNominationWorkflowModel.ts +47 -0
- package/src/models/IpeGrievanceApprovalModel.ts +56 -0
- package/src/models/IpeGrievanceAttachmentModel.ts +29 -0
- package/src/models/IpeGrievanceChatModel.ts +42 -0
- package/src/models/IpeGrievanceRequestModel.ts +139 -0
- package/src/models/IpeGrievanceWorkflowModel.ts +47 -0
package/dist/data-source.js
CHANGED
|
@@ -291,10 +291,36 @@ const EvaluationFormQuestionModel_1 = require("./models/EvaluationFormQuestionMo
|
|
|
291
291
|
const EmployeeEvaluationRequestModel_1 = require("./models/EmployeeEvaluationRequestModel");
|
|
292
292
|
const EmployeeEvaluationModel_1 = require("./models/EmployeeEvaluationModel");
|
|
293
293
|
const EmployeeEvaluationAnswerModel_1 = require("./models/EmployeeEvaluationAnswerModel");
|
|
294
|
+
const EmployeeEvaluationPersonScoreModel_1 = require("./models/EmployeeEvaluationPersonScoreModel");
|
|
294
295
|
const EmployeeEvaluationApprovalModel_1 = require("./models/EmployeeEvaluationApprovalModel");
|
|
295
296
|
const EmployeeEvaluationWorkflowModel_1 = require("./models/EmployeeEvaluationWorkflowModel");
|
|
296
297
|
const EmployeeEvaluationChatModel_1 = require("./models/EmployeeEvaluationChatModel");
|
|
297
298
|
const EmployeeEvaluationAttachmentModel_1 = require("./models/EmployeeEvaluationAttachmentModel");
|
|
299
|
+
const IpeGrievanceRequestModel_1 = require("./models/IpeGrievanceRequestModel");
|
|
300
|
+
const IpeGrievanceApprovalModel_1 = require("./models/IpeGrievanceApprovalModel");
|
|
301
|
+
const IpeGrievanceWorkflowModel_1 = require("./models/IpeGrievanceWorkflowModel");
|
|
302
|
+
const IpeGrievanceChatModel_1 = require("./models/IpeGrievanceChatModel");
|
|
303
|
+
const IpeGrievanceAttachmentModel_1 = require("./models/IpeGrievanceAttachmentModel");
|
|
304
|
+
const InitiatorEmployeeNominationRequestModel_1 = require("./models/InitiatorEmployeeNominationRequestModel");
|
|
305
|
+
const InitiatorEmployeeNominationApprovalModel_1 = require("./models/InitiatorEmployeeNominationApprovalModel");
|
|
306
|
+
const InitiatorEmployeeNominationWorkflowModel_1 = require("./models/InitiatorEmployeeNominationWorkflowModel");
|
|
307
|
+
const InitiatorEmployeeNominationChatModel_1 = require("./models/InitiatorEmployeeNominationChatModel");
|
|
308
|
+
const InitiatorEmployeeNominationAttachmentModel_1 = require("./models/InitiatorEmployeeNominationAttachmentModel");
|
|
309
|
+
const InnovativeEmployeeNominationRequestModel_1 = require("./models/InnovativeEmployeeNominationRequestModel");
|
|
310
|
+
const InnovativeEmployeeNominationApprovalModel_1 = require("./models/InnovativeEmployeeNominationApprovalModel");
|
|
311
|
+
const InnovativeEmployeeNominationWorkflowModel_1 = require("./models/InnovativeEmployeeNominationWorkflowModel");
|
|
312
|
+
const InnovativeEmployeeNominationChatModel_1 = require("./models/InnovativeEmployeeNominationChatModel");
|
|
313
|
+
const InnovativeEmployeeNominationAttachmentModel_1 = require("./models/InnovativeEmployeeNominationAttachmentModel");
|
|
314
|
+
const EmployeeOfMonthNominationRequestModel_1 = require("./models/EmployeeOfMonthNominationRequestModel");
|
|
315
|
+
const EmployeeOfMonthNominationApprovalModel_1 = require("./models/EmployeeOfMonthNominationApprovalModel");
|
|
316
|
+
const EmployeeOfMonthNominationWorkflowModel_1 = require("./models/EmployeeOfMonthNominationWorkflowModel");
|
|
317
|
+
const EmployeeOfMonthNominationChatModel_1 = require("./models/EmployeeOfMonthNominationChatModel");
|
|
318
|
+
const EmployeeOfMonthNominationAttachmentModel_1 = require("./models/EmployeeOfMonthNominationAttachmentModel");
|
|
319
|
+
const EmployeeOfMonthSupportNominationRequestModel_1 = require("./models/EmployeeOfMonthSupportNominationRequestModel");
|
|
320
|
+
const EmployeeOfMonthSupportNominationApprovalModel_1 = require("./models/EmployeeOfMonthSupportNominationApprovalModel");
|
|
321
|
+
const EmployeeOfMonthSupportNominationWorkflowModel_1 = require("./models/EmployeeOfMonthSupportNominationWorkflowModel");
|
|
322
|
+
const EmployeeOfMonthSupportNominationChatModel_1 = require("./models/EmployeeOfMonthSupportNominationChatModel");
|
|
323
|
+
const EmployeeOfMonthSupportNominationAttachmentModel_1 = require("./models/EmployeeOfMonthSupportNominationAttachmentModel");
|
|
298
324
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
299
325
|
type: 'postgres',
|
|
300
326
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -592,9 +618,35 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
592
618
|
EmployeeEvaluationRequestModel_1.EmployeeEvaluationRequests,
|
|
593
619
|
EmployeeEvaluationModel_1.EmployeeEvaluation,
|
|
594
620
|
EmployeeEvaluationAnswerModel_1.EmployeeEvaluationAnswers,
|
|
621
|
+
EmployeeEvaluationPersonScoreModel_1.EmployeeEvaluationPersonScore,
|
|
595
622
|
EmployeeEvaluationApprovalModel_1.EmployeeEvaluationApprovalDetails,
|
|
596
623
|
EmployeeEvaluationWorkflowModel_1.EmployeeEvaluationWorkFlow,
|
|
597
624
|
EmployeeEvaluationChatModel_1.EmployeeEvaluationRequestChat,
|
|
598
625
|
EmployeeEvaluationAttachmentModel_1.EmployeeEvaluationRequestAttachment,
|
|
626
|
+
IpeGrievanceRequestModel_1.IpeGrievanceRequests,
|
|
627
|
+
IpeGrievanceApprovalModel_1.IpeGrievanceApprovalDetails,
|
|
628
|
+
IpeGrievanceWorkflowModel_1.IpeGrievanceWorkFlow,
|
|
629
|
+
IpeGrievanceChatModel_1.IpeGrievanceRequestChat,
|
|
630
|
+
IpeGrievanceAttachmentModel_1.IpeGrievanceRequestAttachment,
|
|
631
|
+
InitiatorEmployeeNominationRequestModel_1.InitiatorEmployeeNominationRequests,
|
|
632
|
+
InitiatorEmployeeNominationApprovalModel_1.InitiatorEmployeeNominationApprovalDetails,
|
|
633
|
+
InitiatorEmployeeNominationWorkflowModel_1.InitiatorEmployeeNominationWorkFlow,
|
|
634
|
+
InitiatorEmployeeNominationChatModel_1.InitiatorEmployeeNominationRequestChat,
|
|
635
|
+
InitiatorEmployeeNominationAttachmentModel_1.InitiatorEmployeeNominationRequestAttachment,
|
|
636
|
+
InnovativeEmployeeNominationRequestModel_1.InnovativeEmployeeNominationRequests,
|
|
637
|
+
InnovativeEmployeeNominationApprovalModel_1.InnovativeEmployeeNominationApprovalDetails,
|
|
638
|
+
InnovativeEmployeeNominationWorkflowModel_1.InnovativeEmployeeNominationWorkFlow,
|
|
639
|
+
InnovativeEmployeeNominationChatModel_1.InnovativeEmployeeNominationRequestChat,
|
|
640
|
+
InnovativeEmployeeNominationAttachmentModel_1.InnovativeEmployeeNominationRequestAttachment,
|
|
641
|
+
EmployeeOfMonthNominationRequestModel_1.EmployeeOfMonthNominationRequests,
|
|
642
|
+
EmployeeOfMonthNominationApprovalModel_1.EmployeeOfMonthNominationApprovalDetails,
|
|
643
|
+
EmployeeOfMonthNominationWorkflowModel_1.EmployeeOfMonthNominationWorkFlow,
|
|
644
|
+
EmployeeOfMonthNominationChatModel_1.EmployeeOfMonthNominationRequestChat,
|
|
645
|
+
EmployeeOfMonthNominationAttachmentModel_1.EmployeeOfMonthNominationRequestAttachment,
|
|
646
|
+
EmployeeOfMonthSupportNominationRequestModel_1.EmployeeOfMonthSupportNominationRequests,
|
|
647
|
+
EmployeeOfMonthSupportNominationApprovalModel_1.EmployeeOfMonthSupportNominationApprovalDetails,
|
|
648
|
+
EmployeeOfMonthSupportNominationWorkflowModel_1.EmployeeOfMonthSupportNominationWorkFlow,
|
|
649
|
+
EmployeeOfMonthSupportNominationChatModel_1.EmployeeOfMonthSupportNominationRequestChat,
|
|
650
|
+
EmployeeOfMonthSupportNominationAttachmentModel_1.EmployeeOfMonthSupportNominationRequestAttachment,
|
|
599
651
|
],
|
|
600
652
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { EntityManager } from 'typeorm';
|
|
2
|
+
export declare const DEFAULT_MAX_EMPLOYEES_PER_REQUEST = 50;
|
|
3
|
+
export type EmployeeEvaluationSubmitAnswer = {
|
|
4
|
+
section_id: number;
|
|
5
|
+
question_id: number;
|
|
6
|
+
score: number;
|
|
7
|
+
remarks?: string | null;
|
|
8
|
+
};
|
|
9
|
+
export type EmployeeEvaluationSubmitEmployee = {
|
|
10
|
+
user_id: number;
|
|
11
|
+
is_rca?: boolean;
|
|
12
|
+
answers: EmployeeEvaluationSubmitAnswer[];
|
|
13
|
+
};
|
|
14
|
+
export type NormalizedEmployeeSubmission = EmployeeEvaluationSubmitEmployee;
|
|
15
|
+
export declare function normalizeEmployeeSubmissions(raw: unknown): {
|
|
16
|
+
employees: NormalizedEmployeeSubmission[];
|
|
17
|
+
error?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Resolve max employees from active eligibility setting for dept/section/month. */
|
|
20
|
+
export declare function resolveMaxEmployeesPerRequest(manager: EntityManager, department_id: number, section_id: number, month: number): Promise<number>;
|
|
21
|
+
export declare function persistEmployeeEvaluationScores(manager: EntityManager, opts: {
|
|
22
|
+
requestId: number;
|
|
23
|
+
formId: number;
|
|
24
|
+
createdBy: string;
|
|
25
|
+
employees: NormalizedEmployeeSubmission[];
|
|
26
|
+
}): Promise<{
|
|
27
|
+
totalScore: number;
|
|
28
|
+
averageScore: number;
|
|
29
|
+
employeeCount: number;
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_MAX_EMPLOYEES_PER_REQUEST = void 0;
|
|
4
|
+
exports.normalizeEmployeeSubmissions = normalizeEmployeeSubmissions;
|
|
5
|
+
exports.resolveMaxEmployeesPerRequest = resolveMaxEmployeesPerRequest;
|
|
6
|
+
exports.persistEmployeeEvaluationScores = persistEmployeeEvaluationScores;
|
|
7
|
+
const EmployeeEvaluationAnswerModel_1 = require("../models/EmployeeEvaluationAnswerModel");
|
|
8
|
+
const EmployeeEvaluationPersonScoreModel_1 = require("../models/EmployeeEvaluationPersonScoreModel");
|
|
9
|
+
const EmployeeEvaluationRequestModel_1 = require("../models/EmployeeEvaluationRequestModel");
|
|
10
|
+
const EvaluationEligibilitySettingModel_1 = require("../models/EvaluationEligibilitySettingModel");
|
|
11
|
+
const EvaluationFormQuestionModel_1 = require("../models/EvaluationFormQuestionModel");
|
|
12
|
+
exports.DEFAULT_MAX_EMPLOYEES_PER_REQUEST = 50;
|
|
13
|
+
function normalizeEmployeeSubmissions(raw) {
|
|
14
|
+
if (!Array.isArray(raw) || raw.length === 0) {
|
|
15
|
+
return { employees: [], error: 'employees must be a non-empty array' };
|
|
16
|
+
}
|
|
17
|
+
const seen = new Set();
|
|
18
|
+
const employees = [];
|
|
19
|
+
for (const item of raw) {
|
|
20
|
+
if (item == null || typeof item !== 'object') {
|
|
21
|
+
return { employees: [], error: 'Each employee entry must be an object' };
|
|
22
|
+
}
|
|
23
|
+
const o = item;
|
|
24
|
+
const user_id = Number(o.user_id ?? o.employee_id);
|
|
25
|
+
if (!Number.isFinite(user_id) || user_id <= 0) {
|
|
26
|
+
return { employees: [], error: 'Each employee must have a valid user_id' };
|
|
27
|
+
}
|
|
28
|
+
if (seen.has(user_id)) {
|
|
29
|
+
return { employees: [], error: `Duplicate user_id ${user_id} in employees list` };
|
|
30
|
+
}
|
|
31
|
+
seen.add(user_id);
|
|
32
|
+
const answersRaw = o.answers;
|
|
33
|
+
if (!Array.isArray(answersRaw) || answersRaw.length === 0) {
|
|
34
|
+
return { employees: [], error: `Employee ${user_id} must include a non-empty answers array` };
|
|
35
|
+
}
|
|
36
|
+
const answers = [];
|
|
37
|
+
const qSeen = new Set();
|
|
38
|
+
for (const a of answersRaw) {
|
|
39
|
+
if (a == null || typeof a !== 'object') {
|
|
40
|
+
return { employees: [], error: `Invalid answer for employee ${user_id}` };
|
|
41
|
+
}
|
|
42
|
+
const ar = a;
|
|
43
|
+
const section_id = Number(ar.section_id);
|
|
44
|
+
const question_id = Number(ar.question_id);
|
|
45
|
+
const score = Number(ar.score);
|
|
46
|
+
if (!Number.isFinite(section_id) || !Number.isFinite(question_id)) {
|
|
47
|
+
return { employees: [], error: `section_id and question_id required for employee ${user_id}` };
|
|
48
|
+
}
|
|
49
|
+
if (!Number.isFinite(score) || score < 0) {
|
|
50
|
+
return { employees: [], error: `score must be a non-negative number for employee ${user_id}, question ${question_id}` };
|
|
51
|
+
}
|
|
52
|
+
if (qSeen.has(question_id)) {
|
|
53
|
+
return { employees: [], error: `Duplicate question_id ${question_id} for employee ${user_id}` };
|
|
54
|
+
}
|
|
55
|
+
qSeen.add(question_id);
|
|
56
|
+
answers.push({
|
|
57
|
+
section_id,
|
|
58
|
+
question_id,
|
|
59
|
+
score,
|
|
60
|
+
remarks: ar.remarks != null ? String(ar.remarks) : null,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
employees.push({
|
|
64
|
+
user_id,
|
|
65
|
+
is_rca: o.is_rca !== undefined ? Boolean(o.is_rca) : false,
|
|
66
|
+
answers,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return { employees };
|
|
70
|
+
}
|
|
71
|
+
/** Resolve max employees from active eligibility setting for dept/section/month. */
|
|
72
|
+
async function resolveMaxEmployeesPerRequest(manager, department_id, section_id, month) {
|
|
73
|
+
const setting = await manager
|
|
74
|
+
.getRepository(EvaluationEligibilitySettingModel_1.EvaluationEligibilitySetting)
|
|
75
|
+
.createQueryBuilder('s')
|
|
76
|
+
.where('s.is_deleted = false')
|
|
77
|
+
.andWhere('s.is_active = true')
|
|
78
|
+
.andWhere('s.department_id = :department_id', { department_id })
|
|
79
|
+
.andWhere('s.section_id = :section_id', { section_id })
|
|
80
|
+
.andWhere('s.from_month <= :month', { month })
|
|
81
|
+
.andWhere('s.to_month >= :month', { month })
|
|
82
|
+
.orderBy('s.id', 'DESC')
|
|
83
|
+
.getOne();
|
|
84
|
+
const max = setting?.max_employees_per_request;
|
|
85
|
+
if (max != null && Number.isFinite(Number(max)) && Number(max) > 0) {
|
|
86
|
+
return Math.floor(Number(max));
|
|
87
|
+
}
|
|
88
|
+
return exports.DEFAULT_MAX_EMPLOYEES_PER_REQUEST;
|
|
89
|
+
}
|
|
90
|
+
async function persistEmployeeEvaluationScores(manager, opts) {
|
|
91
|
+
const { requestId, formId, createdBy, employees } = opts;
|
|
92
|
+
let requestTotal = 0;
|
|
93
|
+
for (const emp of employees) {
|
|
94
|
+
let personTotal = 0;
|
|
95
|
+
for (const ans of emp.answers) {
|
|
96
|
+
const qMeta = await manager.findOne(EvaluationFormQuestionModel_1.EvaluationFormQuestion, {
|
|
97
|
+
where: { id: ans.question_id, is_deleted: false },
|
|
98
|
+
});
|
|
99
|
+
const questionSectionId = qMeta?.form_section_id;
|
|
100
|
+
if (!qMeta || questionSectionId == null || questionSectionId !== ans.section_id) {
|
|
101
|
+
throw new Error(`Invalid question ${ans.question_id} for section ${ans.section_id}`);
|
|
102
|
+
}
|
|
103
|
+
if (qMeta.max_score != null && ans.score > qMeta.max_score) {
|
|
104
|
+
throw new Error(`score ${ans.score} exceeds max_score ${qMeta.max_score} for question ${ans.question_id}`);
|
|
105
|
+
}
|
|
106
|
+
personTotal += ans.score;
|
|
107
|
+
await manager.save(EmployeeEvaluationAnswerModel_1.EmployeeEvaluationAnswers, manager.create(EmployeeEvaluationAnswerModel_1.EmployeeEvaluationAnswers, {
|
|
108
|
+
request_id: requestId,
|
|
109
|
+
user_id: emp.user_id,
|
|
110
|
+
form_id: formId,
|
|
111
|
+
section_id: ans.section_id,
|
|
112
|
+
question_id: ans.question_id,
|
|
113
|
+
score: ans.score,
|
|
114
|
+
remarks: ans.remarks ?? null,
|
|
115
|
+
created_by: createdBy,
|
|
116
|
+
is_deleted: false,
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
await manager.save(EmployeeEvaluationPersonScoreModel_1.EmployeeEvaluationPersonScore, manager.create(EmployeeEvaluationPersonScoreModel_1.EmployeeEvaluationPersonScore, {
|
|
120
|
+
request_id: requestId,
|
|
121
|
+
user_id: emp.user_id,
|
|
122
|
+
is_rca: Boolean(emp.is_rca),
|
|
123
|
+
us_feedback: null,
|
|
124
|
+
total_score: personTotal,
|
|
125
|
+
created_by: createdBy,
|
|
126
|
+
is_deleted: false,
|
|
127
|
+
}));
|
|
128
|
+
requestTotal += personTotal;
|
|
129
|
+
}
|
|
130
|
+
const employeeCount = employees.length;
|
|
131
|
+
const averageScore = employeeCount ? requestTotal / employeeCount : 0;
|
|
132
|
+
await manager.update(EmployeeEvaluationRequestModel_1.EmployeeEvaluationRequests, { id: requestId }, {
|
|
133
|
+
total_score: requestTotal,
|
|
134
|
+
average_score: averageScore,
|
|
135
|
+
employee_count: employeeCount,
|
|
136
|
+
updated_by: createdBy,
|
|
137
|
+
});
|
|
138
|
+
return { totalScore: requestTotal, averageScore, employeeCount };
|
|
139
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -407,13 +407,44 @@ export { ServicesNotificationTriggerType } from './models/ServicesNotificationCo
|
|
|
407
407
|
export * from './models/MoodleUsersModel';
|
|
408
408
|
export { EvaluationEligibilitySetting, EvaluationEligibilitySettingEmployee, } from './models/EvaluationEligibilitySettingModel';
|
|
409
409
|
export { isEvaluationEligibilityWindowOpen, parseEvaluationEndDay, parseMonthRange, } from './helpers/evaluation-eligibility.utils';
|
|
410
|
+
export { DEFAULT_MAX_EMPLOYEES_PER_REQUEST, normalizeEmployeeSubmissions, resolveMaxEmployeesPerRequest, persistEmployeeEvaluationScores, } from './helpers/employee-evaluation-request.utils';
|
|
411
|
+
export type { EmployeeEvaluationSubmitAnswer, EmployeeEvaluationSubmitEmployee, NormalizedEmployeeSubmission, } from './helpers/employee-evaluation-request.utils';
|
|
410
412
|
export { EmployeeEvaluationRequests, EmployeeEvaluationRequestStatus, EmployeeEvaluationRoutingBucket, } from './models/EmployeeEvaluationRequestModel';
|
|
411
413
|
export { EmployeeEvaluation, EmployeeEvaluationUsFeedback } from './models/EmployeeEvaluationModel';
|
|
412
414
|
export { EmployeeEvaluationAnswers } from './models/EmployeeEvaluationAnswerModel';
|
|
415
|
+
export { EmployeeEvaluationPersonScore } from './models/EmployeeEvaluationPersonScoreModel';
|
|
413
416
|
export { EmployeeEvaluationApprovalDetails, EmployeeEvaluationApprovalStatus, } from './models/EmployeeEvaluationApprovalModel';
|
|
414
417
|
export { EmployeeEvaluationWorkFlow, EmployeeEvaluationWorkFlowStatus, } from './models/EmployeeEvaluationWorkflowModel';
|
|
415
418
|
export { EmployeeEvaluationRequestChat, EmployeeEvaluationMessageType, } from './models/EmployeeEvaluationChatModel';
|
|
416
419
|
export { EmployeeEvaluationRequestAttachment } from './models/EmployeeEvaluationAttachmentModel';
|
|
420
|
+
export { IpeGrievanceRequests, IpeGrievanceRequestStatus, IpeGrievanceFinalEvaluationResult, IpeGrievancePeriodType, IpeGrievanceExemptionReason, IpeGrievancePeriodRating, } from './models/IpeGrievanceRequestModel';
|
|
421
|
+
export { IpeGrievanceApprovalDetails, IpeGrievanceApprovalStatus, } from './models/IpeGrievanceApprovalModel';
|
|
422
|
+
export { IpeGrievanceWorkFlow, IpeGrievanceWorkFlowStatus, } from './models/IpeGrievanceWorkflowModel';
|
|
423
|
+
export { IpeGrievanceRequestChat, IpeGrievanceMessageType, } from './models/IpeGrievanceChatModel';
|
|
424
|
+
export { IpeGrievanceRequestAttachment } from './models/IpeGrievanceAttachmentModel';
|
|
425
|
+
export { InitiatorEmployeeNominationRequests, InitiatorEmployeeNominationRequestStatus, InitiatorInitiativeType, } from './models/InitiatorEmployeeNominationRequestModel';
|
|
426
|
+
export type { InitiatorNominationRatingScores } from './models/InitiatorEmployeeNominationRequestModel';
|
|
427
|
+
export { InitiatorEmployeeNominationApprovalDetails, InitiatorEmployeeNominationApprovalStatus, } from './models/InitiatorEmployeeNominationApprovalModel';
|
|
428
|
+
export { InitiatorEmployeeNominationWorkFlow, InitiatorEmployeeNominationWorkFlowStatus, } from './models/InitiatorEmployeeNominationWorkflowModel';
|
|
429
|
+
export { InitiatorEmployeeNominationRequestChat, InitiatorEmployeeNominationMessageType, } from './models/InitiatorEmployeeNominationChatModel';
|
|
430
|
+
export { InitiatorEmployeeNominationRequestAttachment } from './models/InitiatorEmployeeNominationAttachmentModel';
|
|
431
|
+
export { InnovativeEmployeeNominationRequests, InnovativeEmployeeNominationRequestStatus, } from './models/InnovativeEmployeeNominationRequestModel';
|
|
432
|
+
export { InnovativeEmployeeNominationApprovalDetails, InnovativeEmployeeNominationApprovalStatus, } from './models/InnovativeEmployeeNominationApprovalModel';
|
|
433
|
+
export { InnovativeEmployeeNominationWorkFlow, InnovativeEmployeeNominationWorkFlowStatus, } from './models/InnovativeEmployeeNominationWorkflowModel';
|
|
434
|
+
export { InnovativeEmployeeNominationRequestChat, InnovativeEmployeeNominationMessageType, } from './models/InnovativeEmployeeNominationChatModel';
|
|
435
|
+
export { InnovativeEmployeeNominationRequestAttachment } from './models/InnovativeEmployeeNominationAttachmentModel';
|
|
436
|
+
export { EmployeeOfMonthNominationRequests, EmployeeOfMonthNominationRequestStatus, } from './models/EmployeeOfMonthNominationRequestModel';
|
|
437
|
+
export type { EomNominationRatingScores } from './models/EmployeeOfMonthNominationRequestModel';
|
|
438
|
+
export { EmployeeOfMonthNominationApprovalDetails, EmployeeOfMonthNominationApprovalStatus, } from './models/EmployeeOfMonthNominationApprovalModel';
|
|
439
|
+
export { EmployeeOfMonthNominationWorkFlow, EmployeeOfMonthNominationWorkFlowStatus, } from './models/EmployeeOfMonthNominationWorkflowModel';
|
|
440
|
+
export { EmployeeOfMonthNominationRequestChat, EmployeeOfMonthNominationMessageType, } from './models/EmployeeOfMonthNominationChatModel';
|
|
441
|
+
export { EmployeeOfMonthNominationRequestAttachment } from './models/EmployeeOfMonthNominationAttachmentModel';
|
|
442
|
+
export { EmployeeOfMonthSupportNominationRequests, EmployeeOfMonthSupportNominationRequestStatus, } from './models/EmployeeOfMonthSupportNominationRequestModel';
|
|
443
|
+
export type { EomSupportNominationRatingScores } from './models/EmployeeOfMonthSupportNominationRequestModel';
|
|
444
|
+
export { EmployeeOfMonthSupportNominationApprovalDetails, EmployeeOfMonthSupportNominationApprovalStatus, } from './models/EmployeeOfMonthSupportNominationApprovalModel';
|
|
445
|
+
export { EmployeeOfMonthSupportNominationWorkFlow, EmployeeOfMonthSupportNominationWorkFlowStatus, } from './models/EmployeeOfMonthSupportNominationWorkflowModel';
|
|
446
|
+
export { EmployeeOfMonthSupportNominationRequestChat, EmployeeOfMonthSupportNominationMessageType, } from './models/EmployeeOfMonthSupportNominationChatModel';
|
|
447
|
+
export { EmployeeOfMonthSupportNominationRequestAttachment } from './models/EmployeeOfMonthSupportNominationAttachmentModel';
|
|
417
448
|
export { EvaluationForm, EvaluationFormType, } from './models/EvaluationFormModel';
|
|
418
449
|
export { EvaluationFormSection } from './models/EvaluationFormSectionModel';
|
|
419
450
|
export { EvaluationFormQuestion, EvaluationFormQuestionType, } from './models/EvaluationFormQuestionModel';
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.EvaluationEligibilitySetting = exports.ServicesNotificationTriggerType = exports.AppointmentWorkFlowStatus = exports.AppointmentMessageType = exports.AppointmentAttendeeStatus = exports.AppointmentApprovalStatus = exports.AppointmentAttendees = exports.AppointmentWorkFlow = exports.AppointmentRequestChat = exports.AppointmentRequestAttachment = exports.AppointmentApprovalDetails = exports.AppointmentRequestStatus = exports.AppointmentRequests = exports.TravelClass = exports.MissionTravelWorkFlowStatus = exports.MissionTravelApprovalStatus = exports.AllowanceRatio = exports.DecisionType = exports.MissionType = exports.MissionTravelStatus = exports.GatePassMessageType = exports.GatePassWorkFlowStatus = exports.GatePassApprovalStatus = exports.GatePassType = exports.GatePassRequestStatus = exports.SecurityDeptMessageType = exports.SecurityDeptAccessType = exports.SecurityDeptRequestStatus = exports.RetiredCardMessageType = exports.RetiredCardWorkFlowStatus = exports.RetiredCardApprovalStatus = exports.RetiredCardAccessType = exports.RetiredCardRequestStatus = exports.TitleCategory = exports.ProfileUpdateRequestStatus = exports.StayAfterHoursTransactionStatus = exports.StayAfterHoursTransaction = exports.StayAfterHoursBalance = exports.EarlyCheckoutTransactionStatus = exports.EarlyCheckoutTransaction = exports.EarlyCheckoutFrequency = exports.EarlyCheckoutConfiguration = exports.EarlyCheckoutBalance = exports.LeaveTransactionStatus = exports.LeaveTransaction = exports.LeaveConfigurationGrades = exports.enumFrequency = exports.LeaveConfiguration = exports.ParcelDepartmentCategory = exports.RegisterCandidateExperienceActivity = void 0;
|
|
18
|
-
exports.
|
|
18
|
+
exports.InnovativeEmployeeNominationWorkFlow = exports.InnovativeEmployeeNominationApprovalStatus = exports.InnovativeEmployeeNominationApprovalDetails = exports.InnovativeEmployeeNominationRequestStatus = exports.InnovativeEmployeeNominationRequests = exports.InitiatorEmployeeNominationRequestAttachment = exports.InitiatorEmployeeNominationMessageType = exports.InitiatorEmployeeNominationRequestChat = exports.InitiatorEmployeeNominationWorkFlowStatus = exports.InitiatorEmployeeNominationWorkFlow = exports.InitiatorEmployeeNominationApprovalStatus = exports.InitiatorEmployeeNominationApprovalDetails = exports.InitiatorInitiativeType = exports.InitiatorEmployeeNominationRequestStatus = exports.InitiatorEmployeeNominationRequests = exports.IpeGrievanceRequestAttachment = exports.IpeGrievanceMessageType = exports.IpeGrievanceRequestChat = exports.IpeGrievanceWorkFlowStatus = exports.IpeGrievanceWorkFlow = exports.IpeGrievanceApprovalStatus = exports.IpeGrievanceApprovalDetails = exports.IpeGrievancePeriodRating = exports.IpeGrievanceExemptionReason = exports.IpeGrievancePeriodType = exports.IpeGrievanceFinalEvaluationResult = exports.IpeGrievanceRequestStatus = exports.IpeGrievanceRequests = exports.EmployeeEvaluationRequestAttachment = exports.EmployeeEvaluationMessageType = exports.EmployeeEvaluationRequestChat = exports.EmployeeEvaluationWorkFlowStatus = exports.EmployeeEvaluationWorkFlow = exports.EmployeeEvaluationApprovalStatus = exports.EmployeeEvaluationApprovalDetails = exports.EmployeeEvaluationPersonScore = exports.EmployeeEvaluationAnswers = exports.EmployeeEvaluationUsFeedback = exports.EmployeeEvaluation = exports.EmployeeEvaluationRoutingBucket = exports.EmployeeEvaluationRequestStatus = exports.EmployeeEvaluationRequests = exports.persistEmployeeEvaluationScores = exports.resolveMaxEmployeesPerRequest = exports.normalizeEmployeeSubmissions = exports.DEFAULT_MAX_EMPLOYEES_PER_REQUEST = exports.parseMonthRange = exports.parseEvaluationEndDay = exports.isEvaluationEligibilityWindowOpen = exports.EvaluationEligibilitySettingEmployee = void 0;
|
|
19
|
+
exports.EvaluationFormQuestionType = exports.EvaluationFormQuestion = exports.EvaluationFormSection = exports.EvaluationFormType = exports.EvaluationForm = exports.EmployeeOfMonthSupportNominationRequestAttachment = exports.EmployeeOfMonthSupportNominationMessageType = exports.EmployeeOfMonthSupportNominationRequestChat = exports.EmployeeOfMonthSupportNominationWorkFlowStatus = exports.EmployeeOfMonthSupportNominationWorkFlow = exports.EmployeeOfMonthSupportNominationApprovalStatus = exports.EmployeeOfMonthSupportNominationApprovalDetails = exports.EmployeeOfMonthSupportNominationRequestStatus = exports.EmployeeOfMonthSupportNominationRequests = exports.EmployeeOfMonthNominationRequestAttachment = exports.EmployeeOfMonthNominationMessageType = exports.EmployeeOfMonthNominationRequestChat = exports.EmployeeOfMonthNominationWorkFlowStatus = exports.EmployeeOfMonthNominationWorkFlow = exports.EmployeeOfMonthNominationApprovalStatus = exports.EmployeeOfMonthNominationApprovalDetails = exports.EmployeeOfMonthNominationRequestStatus = exports.EmployeeOfMonthNominationRequests = exports.InnovativeEmployeeNominationRequestAttachment = exports.InnovativeEmployeeNominationMessageType = exports.InnovativeEmployeeNominationRequestChat = exports.InnovativeEmployeeNominationWorkFlowStatus = void 0;
|
|
19
20
|
__exportStar(require("./models/user"), exports);
|
|
20
21
|
__exportStar(require("./models/role"), exports);
|
|
21
22
|
__exportStar(require("./models/user-sessions"), exports);
|
|
@@ -499,6 +500,11 @@ var evaluation_eligibility_utils_1 = require("./helpers/evaluation-eligibility.u
|
|
|
499
500
|
Object.defineProperty(exports, "isEvaluationEligibilityWindowOpen", { enumerable: true, get: function () { return evaluation_eligibility_utils_1.isEvaluationEligibilityWindowOpen; } });
|
|
500
501
|
Object.defineProperty(exports, "parseEvaluationEndDay", { enumerable: true, get: function () { return evaluation_eligibility_utils_1.parseEvaluationEndDay; } });
|
|
501
502
|
Object.defineProperty(exports, "parseMonthRange", { enumerable: true, get: function () { return evaluation_eligibility_utils_1.parseMonthRange; } });
|
|
503
|
+
var employee_evaluation_request_utils_1 = require("./helpers/employee-evaluation-request.utils");
|
|
504
|
+
Object.defineProperty(exports, "DEFAULT_MAX_EMPLOYEES_PER_REQUEST", { enumerable: true, get: function () { return employee_evaluation_request_utils_1.DEFAULT_MAX_EMPLOYEES_PER_REQUEST; } });
|
|
505
|
+
Object.defineProperty(exports, "normalizeEmployeeSubmissions", { enumerable: true, get: function () { return employee_evaluation_request_utils_1.normalizeEmployeeSubmissions; } });
|
|
506
|
+
Object.defineProperty(exports, "resolveMaxEmployeesPerRequest", { enumerable: true, get: function () { return employee_evaluation_request_utils_1.resolveMaxEmployeesPerRequest; } });
|
|
507
|
+
Object.defineProperty(exports, "persistEmployeeEvaluationScores", { enumerable: true, get: function () { return employee_evaluation_request_utils_1.persistEmployeeEvaluationScores; } });
|
|
502
508
|
var EmployeeEvaluationRequestModel_1 = require("./models/EmployeeEvaluationRequestModel");
|
|
503
509
|
Object.defineProperty(exports, "EmployeeEvaluationRequests", { enumerable: true, get: function () { return EmployeeEvaluationRequestModel_1.EmployeeEvaluationRequests; } });
|
|
504
510
|
Object.defineProperty(exports, "EmployeeEvaluationRequestStatus", { enumerable: true, get: function () { return EmployeeEvaluationRequestModel_1.EmployeeEvaluationRequestStatus; } });
|
|
@@ -508,6 +514,8 @@ Object.defineProperty(exports, "EmployeeEvaluation", { enumerable: true, get: fu
|
|
|
508
514
|
Object.defineProperty(exports, "EmployeeEvaluationUsFeedback", { enumerable: true, get: function () { return EmployeeEvaluationModel_1.EmployeeEvaluationUsFeedback; } });
|
|
509
515
|
var EmployeeEvaluationAnswerModel_1 = require("./models/EmployeeEvaluationAnswerModel");
|
|
510
516
|
Object.defineProperty(exports, "EmployeeEvaluationAnswers", { enumerable: true, get: function () { return EmployeeEvaluationAnswerModel_1.EmployeeEvaluationAnswers; } });
|
|
517
|
+
var EmployeeEvaluationPersonScoreModel_1 = require("./models/EmployeeEvaluationPersonScoreModel");
|
|
518
|
+
Object.defineProperty(exports, "EmployeeEvaluationPersonScore", { enumerable: true, get: function () { return EmployeeEvaluationPersonScoreModel_1.EmployeeEvaluationPersonScore; } });
|
|
511
519
|
var EmployeeEvaluationApprovalModel_1 = require("./models/EmployeeEvaluationApprovalModel");
|
|
512
520
|
Object.defineProperty(exports, "EmployeeEvaluationApprovalDetails", { enumerable: true, get: function () { return EmployeeEvaluationApprovalModel_1.EmployeeEvaluationApprovalDetails; } });
|
|
513
521
|
Object.defineProperty(exports, "EmployeeEvaluationApprovalStatus", { enumerable: true, get: function () { return EmployeeEvaluationApprovalModel_1.EmployeeEvaluationApprovalStatus; } });
|
|
@@ -519,6 +527,81 @@ Object.defineProperty(exports, "EmployeeEvaluationRequestChat", { enumerable: tr
|
|
|
519
527
|
Object.defineProperty(exports, "EmployeeEvaluationMessageType", { enumerable: true, get: function () { return EmployeeEvaluationChatModel_1.EmployeeEvaluationMessageType; } });
|
|
520
528
|
var EmployeeEvaluationAttachmentModel_1 = require("./models/EmployeeEvaluationAttachmentModel");
|
|
521
529
|
Object.defineProperty(exports, "EmployeeEvaluationRequestAttachment", { enumerable: true, get: function () { return EmployeeEvaluationAttachmentModel_1.EmployeeEvaluationRequestAttachment; } });
|
|
530
|
+
var IpeGrievanceRequestModel_1 = require("./models/IpeGrievanceRequestModel");
|
|
531
|
+
Object.defineProperty(exports, "IpeGrievanceRequests", { enumerable: true, get: function () { return IpeGrievanceRequestModel_1.IpeGrievanceRequests; } });
|
|
532
|
+
Object.defineProperty(exports, "IpeGrievanceRequestStatus", { enumerable: true, get: function () { return IpeGrievanceRequestModel_1.IpeGrievanceRequestStatus; } });
|
|
533
|
+
Object.defineProperty(exports, "IpeGrievanceFinalEvaluationResult", { enumerable: true, get: function () { return IpeGrievanceRequestModel_1.IpeGrievanceFinalEvaluationResult; } });
|
|
534
|
+
Object.defineProperty(exports, "IpeGrievancePeriodType", { enumerable: true, get: function () { return IpeGrievanceRequestModel_1.IpeGrievancePeriodType; } });
|
|
535
|
+
Object.defineProperty(exports, "IpeGrievanceExemptionReason", { enumerable: true, get: function () { return IpeGrievanceRequestModel_1.IpeGrievanceExemptionReason; } });
|
|
536
|
+
Object.defineProperty(exports, "IpeGrievancePeriodRating", { enumerable: true, get: function () { return IpeGrievanceRequestModel_1.IpeGrievancePeriodRating; } });
|
|
537
|
+
var IpeGrievanceApprovalModel_1 = require("./models/IpeGrievanceApprovalModel");
|
|
538
|
+
Object.defineProperty(exports, "IpeGrievanceApprovalDetails", { enumerable: true, get: function () { return IpeGrievanceApprovalModel_1.IpeGrievanceApprovalDetails; } });
|
|
539
|
+
Object.defineProperty(exports, "IpeGrievanceApprovalStatus", { enumerable: true, get: function () { return IpeGrievanceApprovalModel_1.IpeGrievanceApprovalStatus; } });
|
|
540
|
+
var IpeGrievanceWorkflowModel_1 = require("./models/IpeGrievanceWorkflowModel");
|
|
541
|
+
Object.defineProperty(exports, "IpeGrievanceWorkFlow", { enumerable: true, get: function () { return IpeGrievanceWorkflowModel_1.IpeGrievanceWorkFlow; } });
|
|
542
|
+
Object.defineProperty(exports, "IpeGrievanceWorkFlowStatus", { enumerable: true, get: function () { return IpeGrievanceWorkflowModel_1.IpeGrievanceWorkFlowStatus; } });
|
|
543
|
+
var IpeGrievanceChatModel_1 = require("./models/IpeGrievanceChatModel");
|
|
544
|
+
Object.defineProperty(exports, "IpeGrievanceRequestChat", { enumerable: true, get: function () { return IpeGrievanceChatModel_1.IpeGrievanceRequestChat; } });
|
|
545
|
+
Object.defineProperty(exports, "IpeGrievanceMessageType", { enumerable: true, get: function () { return IpeGrievanceChatModel_1.IpeGrievanceMessageType; } });
|
|
546
|
+
var IpeGrievanceAttachmentModel_1 = require("./models/IpeGrievanceAttachmentModel");
|
|
547
|
+
Object.defineProperty(exports, "IpeGrievanceRequestAttachment", { enumerable: true, get: function () { return IpeGrievanceAttachmentModel_1.IpeGrievanceRequestAttachment; } });
|
|
548
|
+
var InitiatorEmployeeNominationRequestModel_1 = require("./models/InitiatorEmployeeNominationRequestModel");
|
|
549
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationRequests", { enumerable: true, get: function () { return InitiatorEmployeeNominationRequestModel_1.InitiatorEmployeeNominationRequests; } });
|
|
550
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationRequestStatus", { enumerable: true, get: function () { return InitiatorEmployeeNominationRequestModel_1.InitiatorEmployeeNominationRequestStatus; } });
|
|
551
|
+
Object.defineProperty(exports, "InitiatorInitiativeType", { enumerable: true, get: function () { return InitiatorEmployeeNominationRequestModel_1.InitiatorInitiativeType; } });
|
|
552
|
+
var InitiatorEmployeeNominationApprovalModel_1 = require("./models/InitiatorEmployeeNominationApprovalModel");
|
|
553
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationApprovalDetails", { enumerable: true, get: function () { return InitiatorEmployeeNominationApprovalModel_1.InitiatorEmployeeNominationApprovalDetails; } });
|
|
554
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationApprovalStatus", { enumerable: true, get: function () { return InitiatorEmployeeNominationApprovalModel_1.InitiatorEmployeeNominationApprovalStatus; } });
|
|
555
|
+
var InitiatorEmployeeNominationWorkflowModel_1 = require("./models/InitiatorEmployeeNominationWorkflowModel");
|
|
556
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationWorkFlow", { enumerable: true, get: function () { return InitiatorEmployeeNominationWorkflowModel_1.InitiatorEmployeeNominationWorkFlow; } });
|
|
557
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationWorkFlowStatus", { enumerable: true, get: function () { return InitiatorEmployeeNominationWorkflowModel_1.InitiatorEmployeeNominationWorkFlowStatus; } });
|
|
558
|
+
var InitiatorEmployeeNominationChatModel_1 = require("./models/InitiatorEmployeeNominationChatModel");
|
|
559
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationRequestChat", { enumerable: true, get: function () { return InitiatorEmployeeNominationChatModel_1.InitiatorEmployeeNominationRequestChat; } });
|
|
560
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationMessageType", { enumerable: true, get: function () { return InitiatorEmployeeNominationChatModel_1.InitiatorEmployeeNominationMessageType; } });
|
|
561
|
+
var InitiatorEmployeeNominationAttachmentModel_1 = require("./models/InitiatorEmployeeNominationAttachmentModel");
|
|
562
|
+
Object.defineProperty(exports, "InitiatorEmployeeNominationRequestAttachment", { enumerable: true, get: function () { return InitiatorEmployeeNominationAttachmentModel_1.InitiatorEmployeeNominationRequestAttachment; } });
|
|
563
|
+
var InnovativeEmployeeNominationRequestModel_1 = require("./models/InnovativeEmployeeNominationRequestModel");
|
|
564
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationRequests", { enumerable: true, get: function () { return InnovativeEmployeeNominationRequestModel_1.InnovativeEmployeeNominationRequests; } });
|
|
565
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationRequestStatus", { enumerable: true, get: function () { return InnovativeEmployeeNominationRequestModel_1.InnovativeEmployeeNominationRequestStatus; } });
|
|
566
|
+
var InnovativeEmployeeNominationApprovalModel_1 = require("./models/InnovativeEmployeeNominationApprovalModel");
|
|
567
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationApprovalDetails", { enumerable: true, get: function () { return InnovativeEmployeeNominationApprovalModel_1.InnovativeEmployeeNominationApprovalDetails; } });
|
|
568
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationApprovalStatus", { enumerable: true, get: function () { return InnovativeEmployeeNominationApprovalModel_1.InnovativeEmployeeNominationApprovalStatus; } });
|
|
569
|
+
var InnovativeEmployeeNominationWorkflowModel_1 = require("./models/InnovativeEmployeeNominationWorkflowModel");
|
|
570
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationWorkFlow", { enumerable: true, get: function () { return InnovativeEmployeeNominationWorkflowModel_1.InnovativeEmployeeNominationWorkFlow; } });
|
|
571
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationWorkFlowStatus", { enumerable: true, get: function () { return InnovativeEmployeeNominationWorkflowModel_1.InnovativeEmployeeNominationWorkFlowStatus; } });
|
|
572
|
+
var InnovativeEmployeeNominationChatModel_1 = require("./models/InnovativeEmployeeNominationChatModel");
|
|
573
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationRequestChat", { enumerable: true, get: function () { return InnovativeEmployeeNominationChatModel_1.InnovativeEmployeeNominationRequestChat; } });
|
|
574
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationMessageType", { enumerable: true, get: function () { return InnovativeEmployeeNominationChatModel_1.InnovativeEmployeeNominationMessageType; } });
|
|
575
|
+
var InnovativeEmployeeNominationAttachmentModel_1 = require("./models/InnovativeEmployeeNominationAttachmentModel");
|
|
576
|
+
Object.defineProperty(exports, "InnovativeEmployeeNominationRequestAttachment", { enumerable: true, get: function () { return InnovativeEmployeeNominationAttachmentModel_1.InnovativeEmployeeNominationRequestAttachment; } });
|
|
577
|
+
var EmployeeOfMonthNominationRequestModel_1 = require("./models/EmployeeOfMonthNominationRequestModel");
|
|
578
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationRequests", { enumerable: true, get: function () { return EmployeeOfMonthNominationRequestModel_1.EmployeeOfMonthNominationRequests; } });
|
|
579
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationRequestStatus", { enumerable: true, get: function () { return EmployeeOfMonthNominationRequestModel_1.EmployeeOfMonthNominationRequestStatus; } });
|
|
580
|
+
var EmployeeOfMonthNominationApprovalModel_1 = require("./models/EmployeeOfMonthNominationApprovalModel");
|
|
581
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationApprovalDetails", { enumerable: true, get: function () { return EmployeeOfMonthNominationApprovalModel_1.EmployeeOfMonthNominationApprovalDetails; } });
|
|
582
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationApprovalStatus", { enumerable: true, get: function () { return EmployeeOfMonthNominationApprovalModel_1.EmployeeOfMonthNominationApprovalStatus; } });
|
|
583
|
+
var EmployeeOfMonthNominationWorkflowModel_1 = require("./models/EmployeeOfMonthNominationWorkflowModel");
|
|
584
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationWorkFlow", { enumerable: true, get: function () { return EmployeeOfMonthNominationWorkflowModel_1.EmployeeOfMonthNominationWorkFlow; } });
|
|
585
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationWorkFlowStatus", { enumerable: true, get: function () { return EmployeeOfMonthNominationWorkflowModel_1.EmployeeOfMonthNominationWorkFlowStatus; } });
|
|
586
|
+
var EmployeeOfMonthNominationChatModel_1 = require("./models/EmployeeOfMonthNominationChatModel");
|
|
587
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationRequestChat", { enumerable: true, get: function () { return EmployeeOfMonthNominationChatModel_1.EmployeeOfMonthNominationRequestChat; } });
|
|
588
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationMessageType", { enumerable: true, get: function () { return EmployeeOfMonthNominationChatModel_1.EmployeeOfMonthNominationMessageType; } });
|
|
589
|
+
var EmployeeOfMonthNominationAttachmentModel_1 = require("./models/EmployeeOfMonthNominationAttachmentModel");
|
|
590
|
+
Object.defineProperty(exports, "EmployeeOfMonthNominationRequestAttachment", { enumerable: true, get: function () { return EmployeeOfMonthNominationAttachmentModel_1.EmployeeOfMonthNominationRequestAttachment; } });
|
|
591
|
+
var EmployeeOfMonthSupportNominationRequestModel_1 = require("./models/EmployeeOfMonthSupportNominationRequestModel");
|
|
592
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationRequests", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationRequestModel_1.EmployeeOfMonthSupportNominationRequests; } });
|
|
593
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationRequestStatus", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationRequestModel_1.EmployeeOfMonthSupportNominationRequestStatus; } });
|
|
594
|
+
var EmployeeOfMonthSupportNominationApprovalModel_1 = require("./models/EmployeeOfMonthSupportNominationApprovalModel");
|
|
595
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationApprovalDetails", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationApprovalModel_1.EmployeeOfMonthSupportNominationApprovalDetails; } });
|
|
596
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationApprovalStatus", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationApprovalModel_1.EmployeeOfMonthSupportNominationApprovalStatus; } });
|
|
597
|
+
var EmployeeOfMonthSupportNominationWorkflowModel_1 = require("./models/EmployeeOfMonthSupportNominationWorkflowModel");
|
|
598
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationWorkFlow", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationWorkflowModel_1.EmployeeOfMonthSupportNominationWorkFlow; } });
|
|
599
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationWorkFlowStatus", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationWorkflowModel_1.EmployeeOfMonthSupportNominationWorkFlowStatus; } });
|
|
600
|
+
var EmployeeOfMonthSupportNominationChatModel_1 = require("./models/EmployeeOfMonthSupportNominationChatModel");
|
|
601
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationRequestChat", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationChatModel_1.EmployeeOfMonthSupportNominationRequestChat; } });
|
|
602
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationMessageType", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationChatModel_1.EmployeeOfMonthSupportNominationMessageType; } });
|
|
603
|
+
var EmployeeOfMonthSupportNominationAttachmentModel_1 = require("./models/EmployeeOfMonthSupportNominationAttachmentModel");
|
|
604
|
+
Object.defineProperty(exports, "EmployeeOfMonthSupportNominationRequestAttachment", { enumerable: true, get: function () { return EmployeeOfMonthSupportNominationAttachmentModel_1.EmployeeOfMonthSupportNominationRequestAttachment; } });
|
|
522
605
|
var EvaluationFormModel_1 = require("./models/EvaluationFormModel");
|
|
523
606
|
Object.defineProperty(exports, "EvaluationForm", { enumerable: true, get: function () { return EvaluationFormModel_1.EvaluationForm; } });
|
|
524
607
|
Object.defineProperty(exports, "EvaluationFormType", { enumerable: true, get: function () { return EvaluationFormModel_1.EvaluationFormType; } });
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { BaseModel } from './BaseModel';
|
|
2
|
-
import { EvaluationFormSection } from './EvaluationFormSectionModel';
|
|
3
|
-
import { EvaluationFormQuestion } from './EvaluationFormQuestionModel';
|
|
4
|
-
import { EmployeeEvaluation } from './EmployeeEvaluationModel';
|
|
5
2
|
export declare class EmployeeEvaluationAnswers extends BaseModel {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
request_id: number;
|
|
4
|
+
user_id: number;
|
|
5
|
+
form_id: number;
|
|
6
|
+
section_id: number;
|
|
7
|
+
question_id: number;
|
|
11
8
|
score: number;
|
|
12
9
|
remarks: string | null;
|
|
13
10
|
}
|
|
@@ -12,29 +12,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.EmployeeEvaluationAnswers = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
const EvaluationFormSectionModel_1 = require("./EvaluationFormSectionModel");
|
|
16
|
-
const EvaluationFormQuestionModel_1 = require("./EvaluationFormQuestionModel");
|
|
17
|
-
const EmployeeEvaluationModel_1 = require("./EmployeeEvaluationModel");
|
|
18
15
|
let EmployeeEvaluationAnswers = class EmployeeEvaluationAnswers extends BaseModel_1.BaseModel {
|
|
19
16
|
};
|
|
20
17
|
exports.EmployeeEvaluationAnswers = EmployeeEvaluationAnswers;
|
|
21
18
|
__decorate([
|
|
22
|
-
(0, typeorm_1.
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], EmployeeEvaluationAnswers.prototype, "request_id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], EmployeeEvaluationAnswers.prototype, "user_id", void 0);
|
|
26
26
|
__decorate([
|
|
27
|
-
(0, typeorm_1.
|
|
28
|
-
(
|
|
29
|
-
|
|
30
|
-
], EmployeeEvaluationAnswers.prototype, "evaluation_section", void 0);
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], EmployeeEvaluationAnswers.prototype, "form_id", void 0);
|
|
31
30
|
__decorate([
|
|
32
|
-
(0, typeorm_1.
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], EmployeeEvaluationAnswers.prototype, "section_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], EmployeeEvaluationAnswers.prototype, "question_id", void 0);
|
|
36
38
|
__decorate([
|
|
37
|
-
(0, typeorm_1.Column)({ type: '
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
38
40
|
__metadata("design:type", Number)
|
|
39
41
|
], EmployeeEvaluationAnswers.prototype, "score", void 0);
|
|
40
42
|
__decorate([
|
|
@@ -10,7 +10,7 @@ export declare class EmployeeEvaluationApprovalDetails extends BaseModel {
|
|
|
10
10
|
service_id: number | null;
|
|
11
11
|
sub_service_id: number | null;
|
|
12
12
|
level: number;
|
|
13
|
-
approver_role_id: number;
|
|
13
|
+
approver_role_id: number | null;
|
|
14
14
|
department_id: number | null;
|
|
15
15
|
section_id: number | null;
|
|
16
16
|
approver_user_id: number | null;
|
|
@@ -39,8 +39,8 @@ __decorate([
|
|
|
39
39
|
__metadata("design:type", Number)
|
|
40
40
|
], EmployeeEvaluationApprovalDetails.prototype, "level", void 0);
|
|
41
41
|
__decorate([
|
|
42
|
-
(0, typeorm_1.Column)({ type: 'integer', nullable:
|
|
43
|
-
__metadata("design:type",
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
44
|
], EmployeeEvaluationApprovalDetails.prototype, "approver_role_id", void 0);
|
|
45
45
|
__decorate([
|
|
46
46
|
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
import { EmployeeEvaluationUsFeedback } from './EmployeeEvaluationModel';
|
|
3
|
+
export declare class EmployeeEvaluationPersonScore extends BaseModel {
|
|
4
|
+
request_id: number;
|
|
5
|
+
user_id: number;
|
|
6
|
+
us_feedback: EmployeeEvaluationUsFeedback | null;
|
|
7
|
+
is_rca: boolean;
|
|
8
|
+
total_score: number | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EmployeeEvaluationPersonScore = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
const EmployeeEvaluationModel_1 = require("./EmployeeEvaluationModel");
|
|
16
|
+
let EmployeeEvaluationPersonScore = class EmployeeEvaluationPersonScore extends BaseModel_1.BaseModel {
|
|
17
|
+
};
|
|
18
|
+
exports.EmployeeEvaluationPersonScore = EmployeeEvaluationPersonScore;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], EmployeeEvaluationPersonScore.prototype, "request_id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], EmployeeEvaluationPersonScore.prototype, "user_id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({
|
|
29
|
+
type: 'enum',
|
|
30
|
+
enum: EmployeeEvaluationModel_1.EmployeeEvaluationUsFeedback,
|
|
31
|
+
nullable: true,
|
|
32
|
+
}),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], EmployeeEvaluationPersonScore.prototype, "us_feedback", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false, nullable: false }),
|
|
37
|
+
__metadata("design:type", Boolean)
|
|
38
|
+
], EmployeeEvaluationPersonScore.prototype, "is_rca", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'float', nullable: true }),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], EmployeeEvaluationPersonScore.prototype, "total_score", void 0);
|
|
43
|
+
exports.EmployeeEvaluationPersonScore = EmployeeEvaluationPersonScore = __decorate([
|
|
44
|
+
(0, typeorm_1.Entity)({ name: 'employee_evaluation_person_scores' })
|
|
45
|
+
], EmployeeEvaluationPersonScore);
|
|
@@ -19,7 +19,7 @@ export declare class EmployeeEvaluationRequests extends BaseModel {
|
|
|
19
19
|
sub_service_id: number | null;
|
|
20
20
|
/** User who raised the request (e.g. HOD). */
|
|
21
21
|
user_id: number;
|
|
22
|
-
evaluation_year:
|
|
22
|
+
evaluation_year: string;
|
|
23
23
|
evaluation_period: string;
|
|
24
24
|
evaluation_month: number;
|
|
25
25
|
/** Scope: employees must belong to this department. */
|
|
@@ -31,4 +31,9 @@ export declare class EmployeeEvaluationRequests extends BaseModel {
|
|
|
31
31
|
status: EmployeeEvaluationRequestStatus;
|
|
32
32
|
workflow_execution_id: string | null;
|
|
33
33
|
comments: string | null;
|
|
34
|
+
total_score: number | null;
|
|
35
|
+
average_score: number | null;
|
|
36
|
+
employee_count: number;
|
|
37
|
+
/** Form structure snapshot at request creation (sections/questions). */
|
|
38
|
+
dynamic_evaluation_form: Record<string, unknown> | null;
|
|
34
39
|
}
|