@platform-modules/foreign-ministry 1.3.297 → 1.3.307
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 +16 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +23 -1
- package/dist/models/EmbassyEvaluationApprovalModel.d.ts +22 -0
- package/dist/models/EmbassyEvaluationApprovalModel.js +85 -0
- package/dist/models/EmbassyEvaluationAssignmentModel.d.ts +24 -0
- package/dist/models/EmbassyEvaluationAssignmentModel.js +89 -0
- package/dist/models/EmbassyEvaluationAttachmentModel.d.ts +10 -0
- package/dist/models/EmbassyEvaluationAttachmentModel.js +48 -0
- package/dist/models/EmbassyEvaluationChatModel.d.ts +18 -0
- package/dist/models/EmbassyEvaluationChatModel.js +66 -0
- package/dist/models/EmbassyEvaluationCycleModel.d.ts +17 -0
- package/dist/models/EmbassyEvaluationCycleModel.js +57 -0
- package/dist/models/EmbassyEvaluationDepartmentSettingModel.d.ts +14 -0
- package/dist/models/EmbassyEvaluationDepartmentSettingModel.js +56 -0
- package/dist/models/EmbassyEvaluationRequestModel.d.ts +24 -0
- package/dist/models/EmbassyEvaluationRequestModel.js +86 -0
- package/dist/models/EmbassyEvaluationResponseModel.d.ts +8 -0
- package/dist/models/EmbassyEvaluationResponseModel.js +44 -0
- package/dist/models/EmbassyEvaluationWorkflowModel.d.ts +19 -0
- package/dist/models/EmbassyEvaluationWorkflowModel.js +73 -0
- package/dist/models/EmployeeOfMonthSupportNominationApprovalModel.d.ts +9 -7
- package/dist/models/EmployeeOfMonthSupportNominationApprovalModel.js +10 -11
- package/dist/models/EvaluationFormModel.js +5 -1
- package/package.json +1 -1
- package/src/data-source.ts +16 -0
- package/src/helpers/employee-evaluation-request.utils.ts +181 -181
- package/src/helpers/evaluation-eligibility.utils.ts +36 -36
- package/src/index.ts +26 -0
- package/src/models/EmbassyEvaluationApprovalModel.ts +57 -0
- package/src/models/EmbassyEvaluationAssignmentModel.ts +63 -0
- package/src/models/EmbassyEvaluationAttachmentModel.ts +26 -0
- package/src/models/EmbassyEvaluationChatModel.ts +43 -0
- package/src/models/EmbassyEvaluationCycleModel.ts +38 -0
- package/src/models/EmbassyEvaluationRequestModel.ts +59 -0
- package/src/models/EmbassyEvaluationResponseModel.ts +24 -0
- package/src/models/EmbassyEvaluationWorkflowModel.ts +48 -0
- package/src/models/EmployeeEvaluationPersonScoreModel.ts +25 -25
- package/src/models/EmployeeEvaluationRequestModel.ts +90 -90
- package/src/models/EmployeeOfMonthSupportNominationApprovalModel.ts +60 -57
- package/src/models/EmployeeOfMonthSupportNominationWorkflowModel.ts +48 -48
- package/src/models/EvaluationFormModel.ts +4 -0
- package/src/models/EvaluationFormQuestionModel.ts +52 -52
- package/src/models/EvaluationFormSectionModel.ts +33 -33
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum EmbassyEvaluationCycleStatus {
|
|
5
|
+
DRAFT = 'Draft',
|
|
6
|
+
ACTIVE = 'Active',
|
|
7
|
+
CLOSED = 'Closed',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Evaluation period window (month-day stored as MM-DD, year applied at runtime). */
|
|
11
|
+
@Entity({ name: 'embassy_evaluation_cycles' })
|
|
12
|
+
export class EmbassyEvaluationCycle extends BaseModel {
|
|
13
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
14
|
+
cycle_name: string;
|
|
15
|
+
|
|
16
|
+
/** Start of evaluation window, format MM-DD (e.g. 01-15). */
|
|
17
|
+
@Column({ type: 'varchar', length: 10, nullable: false })
|
|
18
|
+
start_date: string;
|
|
19
|
+
|
|
20
|
+
/** End of evaluation window, format MM-DD. Submissions locked after this date in the active year. */
|
|
21
|
+
@Column({ type: 'varchar', length: 10, nullable: false })
|
|
22
|
+
end_date: string;
|
|
23
|
+
|
|
24
|
+
@Column({
|
|
25
|
+
type: 'enum',
|
|
26
|
+
enum: EmbassyEvaluationCycleStatus,
|
|
27
|
+
enumName: 'embassy_eval_cycle_status_enum',
|
|
28
|
+
default: EmbassyEvaluationCycleStatus.DRAFT,
|
|
29
|
+
nullable: false,
|
|
30
|
+
})
|
|
31
|
+
status: EmbassyEvaluationCycleStatus;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'int', nullable: true })
|
|
34
|
+
service_id: number | null;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'int', nullable: true })
|
|
37
|
+
sub_service_id: number | null;
|
|
38
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum EmbassyEvaluationRequestStatus {
|
|
5
|
+
PENDING = 'Pending',
|
|
6
|
+
IN_PROGRESS = 'In Progress',
|
|
7
|
+
APPROVED = 'Approved',
|
|
8
|
+
REJECTED = 'Rejected',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Consolidated approval request when all departments complete evaluations for all embassies in a cycle. */
|
|
12
|
+
@Entity({ name: 'embassy_evaluation_requests' })
|
|
13
|
+
export class EmbassyEvaluationRequests extends BaseModel {
|
|
14
|
+
@Column({ type: 'int', nullable: false })
|
|
15
|
+
cycle_id: number;
|
|
16
|
+
|
|
17
|
+
/** Same cycle template can run each calendar year; year is set at activation (assignments), not on cycle. */
|
|
18
|
+
@Column({ type: 'int', nullable: true })
|
|
19
|
+
evaluation_year: number | null;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'jsonb', nullable: false })
|
|
22
|
+
embassy_ids: number[];
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'int', nullable: true })
|
|
25
|
+
req_user_department_id: number | null;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'int', nullable: true })
|
|
28
|
+
req_user_section_id: number | null;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'int', nullable: true })
|
|
31
|
+
service_id: number | null;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'int', nullable: true })
|
|
34
|
+
sub_service_id: number | null;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'int', nullable: false })
|
|
37
|
+
user_id: number;
|
|
38
|
+
|
|
39
|
+
@Column({ type: 'int', nullable: false, default: 0 })
|
|
40
|
+
total_assignments: number;
|
|
41
|
+
|
|
42
|
+
@Column({ type: 'int', nullable: false, default: 0 })
|
|
43
|
+
submitted_assignments: number;
|
|
44
|
+
|
|
45
|
+
@Column({
|
|
46
|
+
type: 'enum',
|
|
47
|
+
enum: EmbassyEvaluationRequestStatus,
|
|
48
|
+
enumName: 'embassy_evaluation_request_status_enum',
|
|
49
|
+
default: EmbassyEvaluationRequestStatus.PENDING,
|
|
50
|
+
nullable: false,
|
|
51
|
+
})
|
|
52
|
+
status: EmbassyEvaluationRequestStatus;
|
|
53
|
+
|
|
54
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
55
|
+
workflow_execution_id: string | null;
|
|
56
|
+
|
|
57
|
+
@Column({ type: 'text', nullable: true })
|
|
58
|
+
comments: string | null;
|
|
59
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Column, Entity, Index } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'embassy_evaluation_responses' })
|
|
5
|
+
@Index('uq_embassy_eval_response', ['assignment_id', 'question_id'], {
|
|
6
|
+
unique: true,
|
|
7
|
+
where: '"is_deleted" = false',
|
|
8
|
+
})
|
|
9
|
+
export class EmbassyEvaluationResponse extends BaseModel {
|
|
10
|
+
@Column({ type: 'int', nullable: false })
|
|
11
|
+
assignment_id: number;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'int', nullable: false })
|
|
14
|
+
question_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'text', nullable: true })
|
|
17
|
+
answer: string | null;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
|
20
|
+
score: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'text', nullable: true })
|
|
23
|
+
remarks: string | null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum EmbassyEvaluationWorkFlowStatus {
|
|
5
|
+
PENDING = 'Pending',
|
|
6
|
+
IN_PROGRESS = 'In Progress',
|
|
7
|
+
COMPLETED = 'Completed',
|
|
8
|
+
FAILED = 'Failed',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: 'embassy_evaluation_workflows' })
|
|
12
|
+
export class EmbassyEvaluationWorkFlow extends BaseModel {
|
|
13
|
+
@Column({ type: 'integer', nullable: false })
|
|
14
|
+
request_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'integer', nullable: true })
|
|
17
|
+
service_id: number | null;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'integer', nullable: true })
|
|
20
|
+
sub_service_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'integer', nullable: true })
|
|
23
|
+
user_id: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'integer', nullable: true })
|
|
26
|
+
role_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
department_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'integer', nullable: true })
|
|
32
|
+
section_id: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
35
|
+
task_name: string;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'text', nullable: true })
|
|
38
|
+
description: string | null;
|
|
39
|
+
|
|
40
|
+
@Column({
|
|
41
|
+
type: 'enum',
|
|
42
|
+
enum: EmbassyEvaluationWorkFlowStatus,
|
|
43
|
+
enumName: 'embassy_evaluation_workflow_status_enum',
|
|
44
|
+
default: EmbassyEvaluationWorkFlowStatus.PENDING,
|
|
45
|
+
nullable: false,
|
|
46
|
+
})
|
|
47
|
+
status: EmbassyEvaluationWorkFlowStatus;
|
|
48
|
+
}
|
|
@@ -1,25 +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
|
+
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,90 +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: '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
|
+
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,57 +1,60 @@
|
|
|
1
|
-
import { Column, Entity } from 'typeorm';
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
/** Approval status values (stored as varchar, not PostgreSQL enum). */
|
|
5
|
+
export const EmployeeOfMonthSupportNominationApprovalStatus = {
|
|
6
|
+
PENDING: 'Pending',
|
|
7
|
+
IN_PROGRESS: 'In Progress',
|
|
8
|
+
APPROVED: 'Approved',
|
|
9
|
+
REJECTED: 'Rejected',
|
|
10
|
+
} as const;
|
|
11
|
+
|
|
12
|
+
export type EmployeeOfMonthSupportNominationApprovalStatus =
|
|
13
|
+
(typeof EmployeeOfMonthSupportNominationApprovalStatus)[keyof typeof EmployeeOfMonthSupportNominationApprovalStatus];
|
|
14
|
+
|
|
15
|
+
@Entity({ name: 'employee_of_month_support_nomination_approvals' })
|
|
16
|
+
export class EmployeeOfMonthSupportNominationApprovalDetails extends BaseModel {
|
|
17
|
+
@Column({ type: 'integer', nullable: false })
|
|
18
|
+
request_id: number;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'integer', nullable: true })
|
|
21
|
+
service_id: number | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'integer', nullable: true })
|
|
24
|
+
sub_service_id: number | null;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'integer', nullable: false })
|
|
27
|
+
level: number;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'integer', nullable: true })
|
|
30
|
+
approver_role_id: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'integer', nullable: true })
|
|
33
|
+
department_id: number | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'integer', nullable: true })
|
|
36
|
+
section_id: number | null;
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'integer', nullable: true })
|
|
39
|
+
approver_user_id: number | null;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'integer', nullable: true })
|
|
42
|
+
delegate_user_id: number | null;
|
|
43
|
+
|
|
44
|
+
@Column({ type: 'integer', nullable: true })
|
|
45
|
+
approved_by: number | null;
|
|
46
|
+
|
|
47
|
+
@Column({ type: 'varchar', length: 500, nullable: true, default: '' })
|
|
48
|
+
comment: string;
|
|
49
|
+
|
|
50
|
+
@Column({
|
|
51
|
+
type: 'varchar',
|
|
52
|
+
length: 32,
|
|
53
|
+
default: EmployeeOfMonthSupportNominationApprovalStatus.PENDING,
|
|
54
|
+
nullable: false,
|
|
55
|
+
})
|
|
56
|
+
approval_status: string;
|
|
57
|
+
|
|
58
|
+
@Column({ type: 'boolean', default: true, nullable: false })
|
|
59
|
+
is_allowed: boolean;
|
|
60
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { Column, Entity } from 'typeorm';
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
export enum EmployeeOfMonthSupportNominationWorkFlowStatus {
|
|
5
|
-
PENDING = 'Pending',
|
|
6
|
-
IN_PROGRESS = 'In Progress',
|
|
7
|
-
COMPLETED = 'Completed',
|
|
8
|
-
FAILED = 'Failed',
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@Entity({ name: 'employee_of_month_support_nomination_workflows' })
|
|
12
|
-
export class EmployeeOfMonthSupportNominationWorkFlow extends BaseModel {
|
|
13
|
-
@Column({ type: 'integer', nullable: false })
|
|
14
|
-
request_id: number;
|
|
15
|
-
|
|
16
|
-
@Column({ type: 'integer', nullable: true })
|
|
17
|
-
service_id: number | null;
|
|
18
|
-
|
|
19
|
-
@Column({ type: 'integer', nullable: true })
|
|
20
|
-
sub_service_id: number | null;
|
|
21
|
-
|
|
22
|
-
@Column({ type: 'integer', nullable: true })
|
|
23
|
-
user_id: number | null;
|
|
24
|
-
|
|
25
|
-
@Column({ type: 'integer', nullable: true })
|
|
26
|
-
role_id: number | null;
|
|
27
|
-
|
|
28
|
-
@Column({ type: 'integer', nullable: true })
|
|
29
|
-
department_id: number | null;
|
|
30
|
-
|
|
31
|
-
@Column({ type: 'integer', nullable: true })
|
|
32
|
-
section_id: number | null;
|
|
33
|
-
|
|
34
|
-
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
35
|
-
task_name: string;
|
|
36
|
-
|
|
37
|
-
@Column({ type: 'text', nullable: true })
|
|
38
|
-
description: string | null;
|
|
39
|
-
|
|
40
|
-
@Column({
|
|
41
|
-
type: 'enum',
|
|
42
|
-
enum: EmployeeOfMonthSupportNominationWorkFlowStatus,
|
|
43
|
-
enumName: 'eom_support_nomination_workflow_status_enum',
|
|
44
|
-
default: EmployeeOfMonthSupportNominationWorkFlowStatus.PENDING,
|
|
45
|
-
nullable: false,
|
|
46
|
-
})
|
|
47
|
-
status: EmployeeOfMonthSupportNominationWorkFlowStatus;
|
|
48
|
-
}
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum EmployeeOfMonthSupportNominationWorkFlowStatus {
|
|
5
|
+
PENDING = 'Pending',
|
|
6
|
+
IN_PROGRESS = 'In Progress',
|
|
7
|
+
COMPLETED = 'Completed',
|
|
8
|
+
FAILED = 'Failed',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: 'employee_of_month_support_nomination_workflows' })
|
|
12
|
+
export class EmployeeOfMonthSupportNominationWorkFlow extends BaseModel {
|
|
13
|
+
@Column({ type: 'integer', nullable: false })
|
|
14
|
+
request_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'integer', nullable: true })
|
|
17
|
+
service_id: number | null;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'integer', nullable: true })
|
|
20
|
+
sub_service_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'integer', nullable: true })
|
|
23
|
+
user_id: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'integer', nullable: true })
|
|
26
|
+
role_id: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
department_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'integer', nullable: true })
|
|
32
|
+
section_id: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
35
|
+
task_name: string;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'text', nullable: true })
|
|
38
|
+
description: string | null;
|
|
39
|
+
|
|
40
|
+
@Column({
|
|
41
|
+
type: 'enum',
|
|
42
|
+
enum: EmployeeOfMonthSupportNominationWorkFlowStatus,
|
|
43
|
+
enumName: 'eom_support_nomination_workflow_status_enum',
|
|
44
|
+
default: EmployeeOfMonthSupportNominationWorkFlowStatus.PENDING,
|
|
45
|
+
nullable: false,
|
|
46
|
+
})
|
|
47
|
+
status: EmployeeOfMonthSupportNominationWorkFlowStatus;
|
|
48
|
+
}
|
|
@@ -10,6 +10,10 @@ export enum EvaluationFormType {
|
|
|
10
10
|
@Entity({ name: 'evaluation_forms' })
|
|
11
11
|
@Index('uq_evaluation_forms_form_name', ['form_name'], { unique: true, where: '"is_deleted" = false' })
|
|
12
12
|
@Index('uq_evaluation_forms_form_code', ['form_code'], { unique: true, where: '"is_deleted" = false' })
|
|
13
|
+
@Index('uq_evaluation_forms_dept_section', ['department_id', 'section_id'], {
|
|
14
|
+
unique: true,
|
|
15
|
+
where: `"is_deleted" = false AND form_type = 'department'`,
|
|
16
|
+
})
|
|
13
17
|
export class EvaluationForm extends BaseModel {
|
|
14
18
|
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
15
19
|
form_name: string;
|