@platform-modules/foreign-ministry 1.3.286 → 1.3.290
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 +2 -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 +3 -0
- package/dist/index.js +8 -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/EvaluationEligibilitySettingModel.d.ts +2 -0
- package/dist/models/EvaluationEligibilitySettingModel.js +4 -0
- package/package.json +24 -24
- package/scripts/migration-employee-evaluation-approval-role-null.sql +11 -0
- package/scripts/migration-employee-evaluation-request-v2.sql +63 -0
- package/scripts/migration-evaluation-max-employees-per-request.sql +2 -0
- package/src/data-source.ts +614 -612
- package/src/helpers/employee-evaluation-request.utils.ts +181 -0
- package/src/index.ts +479 -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/EvaluationEligibilitySettingModel.ts +51 -47
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import { Column, Entity
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
remarks: string | null;
|
|
28
|
-
}
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'employee_evaluation_answers' })
|
|
5
|
+
export class EmployeeEvaluationAnswers extends BaseModel {
|
|
6
|
+
@Column({ type: 'integer', nullable: false })
|
|
7
|
+
request_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'integer', nullable: false })
|
|
10
|
+
user_id: number;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'integer', nullable: false })
|
|
13
|
+
form_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'integer', nullable: false })
|
|
16
|
+
section_id: number;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'integer', nullable: false })
|
|
19
|
+
question_id: number;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'integer', nullable: false })
|
|
22
|
+
score: number;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'text', nullable: true })
|
|
25
|
+
remarks: string | null;
|
|
26
|
+
}
|
|
@@ -22,8 +22,8 @@ export class EmployeeEvaluationApprovalDetails extends BaseModel {
|
|
|
22
22
|
@Column({ type: 'integer', nullable: false })
|
|
23
23
|
level: number;
|
|
24
24
|
|
|
25
|
-
@Column({ type: 'integer', nullable:
|
|
26
|
-
approver_role_id: number;
|
|
25
|
+
@Column({ type: 'integer', nullable: true })
|
|
26
|
+
approver_role_id: number | null;
|
|
27
27
|
|
|
28
28
|
@Column({ type: 'integer', nullable: true })
|
|
29
29
|
department_id: number | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
import { EmployeeEvaluationUsFeedback } from './EmployeeEvaluationModel';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'employee_evaluation_person_scores' })
|
|
6
|
+
export class EmployeeEvaluationPersonScore extends BaseModel {
|
|
7
|
+
@Column({ type: 'integer', nullable: false })
|
|
8
|
+
request_id: number;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'integer', nullable: false })
|
|
11
|
+
user_id: number;
|
|
12
|
+
|
|
13
|
+
@Column({
|
|
14
|
+
type: 'enum',
|
|
15
|
+
enum: EmployeeEvaluationUsFeedback,
|
|
16
|
+
nullable: true,
|
|
17
|
+
})
|
|
18
|
+
us_feedback: EmployeeEvaluationUsFeedback | null;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'boolean', default: false, nullable: false })
|
|
21
|
+
is_rca: boolean;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'float', nullable: true })
|
|
24
|
+
total_score: number | null;
|
|
25
|
+
}
|
|
@@ -1,77 +1,90 @@
|
|
|
1
|
-
import { Column, Entity } from 'typeorm';
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
export enum EmployeeEvaluationRequestStatus {
|
|
5
|
-
PENDING = 'Pending',
|
|
6
|
-
IN_PROGRESS = 'In Progress',
|
|
7
|
-
APPROVED = 'Approved',
|
|
8
|
-
REJECTED = 'Rejected',
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** Routing bucket derived from undersecretary department (US Political / Administrative / Finance). */
|
|
12
|
-
export enum EmployeeEvaluationRoutingBucket {
|
|
13
|
-
US_POLITICAL = 'US_POLITICAL',
|
|
14
|
-
US_ADMINISTRATIVE = 'US_ADMINISTRATIVE',
|
|
15
|
-
FINANCE = 'FINANCE',
|
|
16
|
-
OTHER = 'OTHER',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@Entity({ name: 'employee_evaluation_requests' })
|
|
20
|
-
export class EmployeeEvaluationRequests extends BaseModel {
|
|
21
|
-
@Column({ type: 'int', nullable: true })
|
|
22
|
-
req_user_department_id: number | null;
|
|
23
|
-
|
|
24
|
-
@Column({ type: 'int', nullable: true })
|
|
25
|
-
req_user_section_id: number | null;
|
|
26
|
-
|
|
27
|
-
@Column({ type: 'int', nullable: true })
|
|
28
|
-
service_id: number | null;
|
|
29
|
-
|
|
30
|
-
@Column({ type: 'int', nullable: true })
|
|
31
|
-
sub_service_id: number | null;
|
|
32
|
-
|
|
33
|
-
/** User who raised the request (e.g. HOD). */
|
|
34
|
-
@Column({ type: 'int', nullable: false })
|
|
35
|
-
user_id: number;
|
|
36
|
-
|
|
37
|
-
@Column({ type: '
|
|
38
|
-
evaluation_year:
|
|
39
|
-
|
|
40
|
-
@Column({ type: 'varchar', length: 120, nullable: false })
|
|
41
|
-
evaluation_period: string;
|
|
42
|
-
|
|
43
|
-
@Column({ type: 'int', nullable: false })
|
|
44
|
-
evaluation_month: number;
|
|
45
|
-
|
|
46
|
-
/** Scope: employees must belong to this department. */
|
|
47
|
-
@Column({ type: 'int', nullable: false })
|
|
48
|
-
department_id: number;
|
|
49
|
-
|
|
50
|
-
/** Scope: employees must belong to this section. */
|
|
51
|
-
@Column({ type: 'int', nullable: false })
|
|
52
|
-
section_id: number;
|
|
53
|
-
|
|
54
|
-
@Column({ type: 'bigint', nullable: true })
|
|
55
|
-
undersecretary_department_id: number | null;
|
|
56
|
-
|
|
57
|
-
@Column({
|
|
58
|
-
type: 'enum',
|
|
59
|
-
enum: EmployeeEvaluationRoutingBucket,
|
|
60
|
-
nullable: true,
|
|
61
|
-
})
|
|
62
|
-
evaluation_routing_bucket: EmployeeEvaluationRoutingBucket | null;
|
|
63
|
-
|
|
64
|
-
@Column({
|
|
65
|
-
type: 'enum',
|
|
66
|
-
enum: EmployeeEvaluationRequestStatus,
|
|
67
|
-
default: EmployeeEvaluationRequestStatus.PENDING,
|
|
68
|
-
nullable: false,
|
|
69
|
-
})
|
|
70
|
-
status: EmployeeEvaluationRequestStatus;
|
|
71
|
-
|
|
72
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
73
|
-
workflow_execution_id: string | null;
|
|
74
|
-
|
|
75
|
-
@Column({ type: 'text', nullable: true })
|
|
76
|
-
comments: string | null;
|
|
77
|
-
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum EmployeeEvaluationRequestStatus {
|
|
5
|
+
PENDING = 'Pending',
|
|
6
|
+
IN_PROGRESS = 'In Progress',
|
|
7
|
+
APPROVED = 'Approved',
|
|
8
|
+
REJECTED = 'Rejected',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Routing bucket derived from undersecretary department (US Political / Administrative / Finance). */
|
|
12
|
+
export enum EmployeeEvaluationRoutingBucket {
|
|
13
|
+
US_POLITICAL = 'US_POLITICAL',
|
|
14
|
+
US_ADMINISTRATIVE = 'US_ADMINISTRATIVE',
|
|
15
|
+
FINANCE = 'FINANCE',
|
|
16
|
+
OTHER = 'OTHER',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Entity({ name: 'employee_evaluation_requests' })
|
|
20
|
+
export class EmployeeEvaluationRequests extends BaseModel {
|
|
21
|
+
@Column({ type: 'int', nullable: true })
|
|
22
|
+
req_user_department_id: number | null;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'int', nullable: true })
|
|
25
|
+
req_user_section_id: number | null;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'int', nullable: true })
|
|
28
|
+
service_id: number | null;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'int', nullable: true })
|
|
31
|
+
sub_service_id: number | null;
|
|
32
|
+
|
|
33
|
+
/** User who raised the request (e.g. HOD). */
|
|
34
|
+
@Column({ type: 'int', nullable: false })
|
|
35
|
+
user_id: number;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'varchar', length: 10, nullable: false })
|
|
38
|
+
evaluation_year: string;
|
|
39
|
+
|
|
40
|
+
@Column({ type: 'varchar', length: 120, nullable: false })
|
|
41
|
+
evaluation_period: string;
|
|
42
|
+
|
|
43
|
+
@Column({ type: 'int', nullable: false })
|
|
44
|
+
evaluation_month: number;
|
|
45
|
+
|
|
46
|
+
/** Scope: employees must belong to this department. */
|
|
47
|
+
@Column({ type: 'int', nullable: false })
|
|
48
|
+
department_id: number;
|
|
49
|
+
|
|
50
|
+
/** Scope: employees must belong to this section. */
|
|
51
|
+
@Column({ type: 'int', nullable: false })
|
|
52
|
+
section_id: number;
|
|
53
|
+
|
|
54
|
+
@Column({ type: 'bigint', nullable: true })
|
|
55
|
+
undersecretary_department_id: number | null;
|
|
56
|
+
|
|
57
|
+
@Column({
|
|
58
|
+
type: 'enum',
|
|
59
|
+
enum: EmployeeEvaluationRoutingBucket,
|
|
60
|
+
nullable: true,
|
|
61
|
+
})
|
|
62
|
+
evaluation_routing_bucket: EmployeeEvaluationRoutingBucket | null;
|
|
63
|
+
|
|
64
|
+
@Column({
|
|
65
|
+
type: 'enum',
|
|
66
|
+
enum: EmployeeEvaluationRequestStatus,
|
|
67
|
+
default: EmployeeEvaluationRequestStatus.PENDING,
|
|
68
|
+
nullable: false,
|
|
69
|
+
})
|
|
70
|
+
status: EmployeeEvaluationRequestStatus;
|
|
71
|
+
|
|
72
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
73
|
+
workflow_execution_id: string | null;
|
|
74
|
+
|
|
75
|
+
@Column({ type: 'text', nullable: true })
|
|
76
|
+
comments: string | null;
|
|
77
|
+
|
|
78
|
+
@Column({ type: 'float', nullable: true })
|
|
79
|
+
total_score: number | null;
|
|
80
|
+
|
|
81
|
+
@Column({ type: 'float', nullable: true })
|
|
82
|
+
average_score: number | null;
|
|
83
|
+
|
|
84
|
+
@Column({ type: 'int', default: 0, nullable: false })
|
|
85
|
+
employee_count: number;
|
|
86
|
+
|
|
87
|
+
/** Form structure snapshot at request creation (sections/questions). */
|
|
88
|
+
@Column({ type: 'jsonb', nullable: true })
|
|
89
|
+
dynamic_evaluation_form: Record<string, unknown> | null;
|
|
90
|
+
}
|
|
@@ -1,47 +1,51 @@
|
|
|
1
|
-
import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Department/section/month evaluation window: which employees are excluded or re-included
|
|
6
|
-
* for that cycle (e.g. excluded in January, eligible again in May via a different month row).
|
|
7
|
-
*/
|
|
8
|
-
@Entity({ name: 'evaluation_eligibility_settings' })
|
|
9
|
-
export class EvaluationEligibilitySetting extends BaseModel {
|
|
10
|
-
@Column({ type: 'int' })
|
|
11
|
-
department_id: number;
|
|
12
|
-
|
|
13
|
-
@Column({ type: 'int' })
|
|
14
|
-
section_id: number;
|
|
15
|
-
|
|
16
|
-
/** Evaluation window start month (1–12). */
|
|
17
|
-
@Column({ type: 'int' })
|
|
18
|
-
from_month: number;
|
|
19
|
-
|
|
20
|
-
/** Evaluation window end month (1–12), inclusive. */
|
|
21
|
-
@Column({ type: 'int' })
|
|
22
|
-
to_month: number;
|
|
23
|
-
|
|
24
|
-
/** Last day of the evaluation month (1–31) when submissions close. */
|
|
25
|
-
@Column({ type: 'int' })
|
|
26
|
-
evaluation_end_date: number;
|
|
27
|
-
|
|
28
|
-
@Column({ type: 'boolean', default: true })
|
|
29
|
-
is_active: boolean;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
@
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
@Column({ type: '
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Department/section/month evaluation window: which employees are excluded or re-included
|
|
6
|
+
* for that cycle (e.g. excluded in January, eligible again in May via a different month row).
|
|
7
|
+
*/
|
|
8
|
+
@Entity({ name: 'evaluation_eligibility_settings' })
|
|
9
|
+
export class EvaluationEligibilitySetting extends BaseModel {
|
|
10
|
+
@Column({ type: 'int' })
|
|
11
|
+
department_id: number;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'int' })
|
|
14
|
+
section_id: number;
|
|
15
|
+
|
|
16
|
+
/** Evaluation window start month (1–12). */
|
|
17
|
+
@Column({ type: 'int' })
|
|
18
|
+
from_month: number;
|
|
19
|
+
|
|
20
|
+
/** Evaluation window end month (1–12), inclusive. */
|
|
21
|
+
@Column({ type: 'int' })
|
|
22
|
+
to_month: number;
|
|
23
|
+
|
|
24
|
+
/** Last day of the evaluation month (1–31) when submissions close. */
|
|
25
|
+
@Column({ type: 'int' })
|
|
26
|
+
evaluation_end_date: number;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'boolean', default: true })
|
|
29
|
+
is_active: boolean;
|
|
30
|
+
|
|
31
|
+
/** Maximum employees allowed in one evaluation request for this dept/section window. */
|
|
32
|
+
@Column({ type: 'int', default: 50 })
|
|
33
|
+
max_employees_per_request: number;
|
|
34
|
+
|
|
35
|
+
@OneToMany(() => EvaluationEligibilitySettingEmployee, (e) => e.evaluation_eligibility_setting)
|
|
36
|
+
employees?: EvaluationEligibilitySettingEmployee[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Entity({ name: 'evaluation_eligibility_setting_employees' })
|
|
40
|
+
export class EvaluationEligibilitySettingEmployee extends BaseModel {
|
|
41
|
+
@ManyToOne(() => EvaluationEligibilitySetting, (s) => s.employees, { onDelete: 'CASCADE' })
|
|
42
|
+
@JoinColumn({ name: 'setting_id' })
|
|
43
|
+
evaluation_eligibility_setting: EvaluationEligibilitySetting;
|
|
44
|
+
|
|
45
|
+
@Column({ type: 'int' })
|
|
46
|
+
employee_id: number;
|
|
47
|
+
|
|
48
|
+
/** When true, employee is excluded from evaluation for this setting’s month/department/section. */
|
|
49
|
+
@Column({ type: 'boolean', default: true })
|
|
50
|
+
is_excluded_from_evaluation: boolean;
|
|
51
|
+
}
|