@platform-modules/foreign-ministry 1.3.276 → 1.3.277

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.
Files changed (36) hide show
  1. package/dist/data-source.js +22 -1
  2. package/dist/index.d.ts +10 -0
  3. package/dist/index.js +30 -1
  4. package/dist/models/EmployeeEvaluationAnswerModel.d.ts +11 -0
  5. package/dist/models/EmployeeEvaluationAnswerModel.js +46 -0
  6. package/dist/models/EmployeeEvaluationApprovalModel.d.ts +22 -0
  7. package/dist/models/EmployeeEvaluationApprovalModel.js +84 -0
  8. package/dist/models/EmployeeEvaluationAttachmentModel.d.ts +11 -0
  9. package/dist/models/EmployeeEvaluationAttachmentModel.js +52 -0
  10. package/dist/models/EmployeeEvaluationChatModel.d.ts +18 -0
  11. package/dist/models/EmployeeEvaluationChatModel.js +65 -0
  12. package/dist/models/EmployeeEvaluationModel.d.ts +16 -0
  13. package/dist/models/EmployeeEvaluationModel.js +59 -0
  14. package/dist/models/EmployeeEvaluationRequestModel.d.ts +34 -0
  15. package/dist/models/EmployeeEvaluationRequestModel.js +104 -0
  16. package/dist/models/EmployeeEvaluationWorkflowModel.d.ts +17 -0
  17. package/dist/models/EmployeeEvaluationWorkflowModel.js +67 -0
  18. package/dist/models/EvaluationEligibilitySettingModel.d.ts +20 -0
  19. package/dist/models/EvaluationEligibilitySettingModel.js +67 -0
  20. package/dist/models/EvaluationQuestionMasterModel.d.ts +10 -0
  21. package/dist/models/EvaluationQuestionMasterModel.js +42 -0
  22. package/dist/models/EvaluationSectionMasterModel.d.ts +7 -0
  23. package/dist/models/EvaluationSectionMasterModel.js +36 -0
  24. package/package.json +1 -1
  25. package/src/data-source.ts +28 -2
  26. package/src/index.ts +456 -429
  27. package/src/models/EmployeeEvaluationAnswerModel.ts +26 -0
  28. package/src/models/EmployeeEvaluationApprovalModel.ts +56 -0
  29. package/src/models/EmployeeEvaluationAttachmentModel.ts +29 -0
  30. package/src/models/EmployeeEvaluationChatModel.ts +42 -0
  31. package/src/models/EmployeeEvaluationModel.ts +38 -0
  32. package/src/models/EmployeeEvaluationRequestModel.ts +77 -0
  33. package/src/models/EmployeeEvaluationWorkflowModel.ts +43 -0
  34. package/src/models/EvaluationEligibilitySettingModel.ts +42 -0
  35. package/src/models/EvaluationQuestionMasterModel.ts +23 -0
  36. package/src/models/EvaluationSectionMasterModel.ts +17 -0
@@ -0,0 +1,26 @@
1
+ import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+ import { EvaluationSectionMaster } from './EvaluationSectionMasterModel';
4
+ import { EvaluationQuestionMaster } from './EvaluationQuestionMasterModel';
5
+ import { EmployeeEvaluation } from './EmployeeEvaluationModel';
6
+
7
+ @Entity({ name: 'employee_evaluation_answers' })
8
+ export class EmployeeEvaluationAnswers extends BaseModel {
9
+ @ManyToOne(() => EmployeeEvaluation, { onDelete: 'CASCADE' })
10
+ @JoinColumn({ name: 'employee_evaluation_id' })
11
+ employee_evaluation: EmployeeEvaluation;
12
+
13
+ @ManyToOne(() => EvaluationSectionMaster, { onDelete: 'RESTRICT' })
14
+ @JoinColumn({ name: 'evaluation_section_id' })
15
+ evaluation_section: EvaluationSectionMaster;
16
+
17
+ @ManyToOne(() => EvaluationQuestionMaster, { onDelete: 'RESTRICT' })
18
+ @JoinColumn({ name: 'evaluation_question_id' })
19
+ evaluation_question: EvaluationQuestionMaster;
20
+
21
+ @Column({ type: 'int', nullable: false })
22
+ score: number;
23
+
24
+ @Column({ type: 'text', nullable: true })
25
+ remarks: string | null;
26
+ }
@@ -0,0 +1,56 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum EmployeeEvaluationApprovalStatus {
5
+ PENDING = 'Pending',
6
+ IN_PROGRESS = 'In Progress',
7
+ APPROVED = 'Approved',
8
+ REJECTED = 'Rejected',
9
+ }
10
+
11
+ @Entity({ name: 'employee_evaluation_approvals' })
12
+ export class EmployeeEvaluationApprovalDetails 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: false })
23
+ level: number;
24
+
25
+ @Column({ type: 'integer', nullable: false })
26
+ approver_role_id: number;
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: 'integer', nullable: true })
35
+ approver_user_id: number | null;
36
+
37
+ @Column({ type: 'integer', nullable: true })
38
+ delegate_user_id: number | null;
39
+
40
+ @Column({ type: 'integer', nullable: true })
41
+ approved_by: number | null;
42
+
43
+ @Column({ type: 'varchar', length: 500, nullable: true, default: '' })
44
+ comment: string;
45
+
46
+ @Column({
47
+ type: 'enum',
48
+ enum: EmployeeEvaluationApprovalStatus,
49
+ default: EmployeeEvaluationApprovalStatus.PENDING,
50
+ nullable: false,
51
+ })
52
+ approval_status: EmployeeEvaluationApprovalStatus;
53
+
54
+ @Column({ type: 'boolean', default: true, nullable: false })
55
+ is_allowed: boolean;
56
+ }
@@ -0,0 +1,29 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'employee_evaluation_attachments' })
5
+ export class EmployeeEvaluationRequestAttachment extends BaseModel {
6
+ @Column({ type: 'integer', nullable: false })
7
+ request_id: number;
8
+
9
+ @Column({ type: 'integer', nullable: true })
10
+ service_id: number | null;
11
+
12
+ @Column({ type: 'integer', nullable: true })
13
+ sub_service_id: number | null;
14
+
15
+ @Column({ type: 'varchar', length: 500, nullable: false })
16
+ file_url: string;
17
+
18
+ @Column({ type: 'varchar', length: 255, nullable: true })
19
+ file_name: string | null;
20
+
21
+ @Column({ type: 'varchar', length: 100, nullable: true })
22
+ file_type: string | null;
23
+
24
+ @Column({ type: 'bigint', nullable: true })
25
+ file_size: number | null;
26
+
27
+ @Column({ type: 'integer', nullable: true })
28
+ chat_id: number | null;
29
+ }
@@ -0,0 +1,42 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum EmployeeEvaluationMessageType {
5
+ TEXT = 'text',
6
+ IMAGE = 'image',
7
+ VIDEO = 'video',
8
+ FILE = 'file',
9
+ LINK = 'link',
10
+ }
11
+
12
+ @Entity({ name: 'employee_evaluation_chats' })
13
+ export class EmployeeEvaluationRequestChat extends BaseModel {
14
+ @Column({ type: 'integer', nullable: false })
15
+ request_id: number;
16
+
17
+ @Column({ type: 'integer', nullable: true })
18
+ service_id: number | null;
19
+
20
+ @Column({ type: 'integer', nullable: true })
21
+ sub_service_id: number | null;
22
+
23
+ @Column({ type: 'integer', nullable: false })
24
+ user_id: number;
25
+
26
+ @Column({ type: 'integer', nullable: true })
27
+ role_id: number | null;
28
+
29
+ @Column({ type: 'text', nullable: false })
30
+ message: string;
31
+
32
+ @Column({
33
+ type: 'enum',
34
+ enum: EmployeeEvaluationMessageType,
35
+ default: EmployeeEvaluationMessageType.TEXT,
36
+ nullable: false,
37
+ })
38
+ message_type: EmployeeEvaluationMessageType;
39
+
40
+ @Column({ type: 'text', nullable: true })
41
+ status: string | null;
42
+ }
@@ -0,0 +1,38 @@
1
+ import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+ import { EmployeeEvaluationRequests } from './EmployeeEvaluationRequestModel';
4
+
5
+ export enum EmployeeEvaluationUsFeedback {
6
+ EXCELLENT = 'Excellent',
7
+ VERY_GOOD = 'Very good',
8
+ }
9
+
10
+ @Entity({ name: 'employee_evaluations' })
11
+ export class EmployeeEvaluation extends BaseModel {
12
+ @ManyToOne(() => EmployeeEvaluationRequests, { onDelete: 'CASCADE' })
13
+ @JoinColumn({ name: 'evaluation_request_id' })
14
+ evaluation_request: EmployeeEvaluationRequests;
15
+
16
+ @Column({ type: 'int', nullable: false })
17
+ user_id: number;
18
+
19
+ /** Snapshot of section/question structure from masters at request creation (JSON). */
20
+ @Column({ type: 'jsonb', nullable: true })
21
+ dynamic_evaluation_form: Record<string, unknown> | null;
22
+
23
+ @Column({ type: 'boolean', default: false })
24
+ is_rca: boolean;
25
+
26
+ @Column({
27
+ type: 'enum',
28
+ enum: EmployeeEvaluationUsFeedback,
29
+ nullable: true,
30
+ })
31
+ us_feedback: EmployeeEvaluationUsFeedback | null;
32
+
33
+ @Column({ type: 'float', nullable: true })
34
+ section_total_score: number | null;
35
+
36
+ @Column({ type: 'float', nullable: true })
37
+ final_total_score: number | null;
38
+ }
@@ -0,0 +1,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: 'int', nullable: false })
38
+ evaluation_year: number;
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
+ }
@@ -0,0 +1,43 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum EmployeeEvaluationWorkFlowStatus {
5
+ COMPLETED = 'Completed',
6
+ NOT_YET_STARTED = 'Not Yet Started',
7
+ PENDING = 'Pending',
8
+ }
9
+
10
+ @Entity({ name: 'employee_evaluation_workflows' })
11
+ export class EmployeeEvaluationWorkFlow extends BaseModel {
12
+ @Column({ type: 'integer', nullable: false })
13
+ request_id: number;
14
+
15
+ @Column({ type: 'integer', nullable: true })
16
+ service_id: number | null;
17
+
18
+ @Column({ type: 'integer', nullable: true })
19
+ sub_service_id: number | null;
20
+
21
+ @Column({ type: 'varchar', length: 500, nullable: false })
22
+ content: string;
23
+
24
+ @Column({
25
+ type: 'enum',
26
+ enum: EmployeeEvaluationWorkFlowStatus,
27
+ default: EmployeeEvaluationWorkFlowStatus.NOT_YET_STARTED,
28
+ nullable: false,
29
+ })
30
+ status: EmployeeEvaluationWorkFlowStatus;
31
+
32
+ @Column({ type: 'integer', nullable: true })
33
+ user_id: number | null;
34
+
35
+ @Column({ type: 'integer', nullable: true })
36
+ role_id: number | null;
37
+
38
+ @Column({ type: 'integer', nullable: true })
39
+ department_id: number | null;
40
+
41
+ @Column({ type: 'integer', nullable: true })
42
+ section_id: number | null;
43
+ }
@@ -0,0 +1,42 @@
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
+ /** Calendar month 1–12 */
17
+ @Column({ type: 'int' })
18
+ month: number;
19
+
20
+ @Column({ type: 'date' })
21
+ evaluation_end_date: Date;
22
+
23
+ @Column({ type: 'boolean', default: true })
24
+ is_active: boolean;
25
+
26
+ @OneToMany(() => EvaluationEligibilitySettingEmployee, (e) => e.evaluation_eligibility_setting)
27
+ employees?: EvaluationEligibilitySettingEmployee[];
28
+ }
29
+
30
+ @Entity({ name: 'evaluation_eligibility_setting_employees' })
31
+ export class EvaluationEligibilitySettingEmployee extends BaseModel {
32
+ @ManyToOne(() => EvaluationEligibilitySetting, (s) => s.employees, { onDelete: 'CASCADE' })
33
+ @JoinColumn({ name: 'setting_id' })
34
+ evaluation_eligibility_setting: EvaluationEligibilitySetting;
35
+
36
+ @Column({ type: 'int' })
37
+ employee_id: number;
38
+
39
+ /** When true, employee is excluded from evaluation for this setting’s month/department/section. */
40
+ @Column({ type: 'boolean', default: true })
41
+ is_excluded_from_evaluation: boolean;
42
+ }
@@ -0,0 +1,23 @@
1
+ import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+ import { EvaluationSectionMaster } from './EvaluationSectionMasterModel';
4
+
5
+ @Entity({ name: 'evaluation_question_master' })
6
+ export class EvaluationQuestionMaster extends BaseModel {
7
+ @ManyToOne(() => EvaluationSectionMaster, { onDelete: 'CASCADE' })
8
+ @JoinColumn({ name: 'evaluation_section_id' })
9
+ evaluation_section: EvaluationSectionMaster;
10
+
11
+ @Column({ type: 'text', nullable: false })
12
+ question_text: string;
13
+
14
+ @Column({ type: 'int', default: 0 })
15
+ sequence_order: number;
16
+
17
+ /** Max score for this question (evaluation scale 0–4). */
18
+ @Column({ type: 'int', default: 4 })
19
+ max_score: number;
20
+
21
+ @Column({ type: 'boolean', default: true })
22
+ is_active: boolean;
23
+ }
@@ -0,0 +1,17 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'evaluation_section_master' })
5
+ export class EvaluationSectionMaster extends BaseModel {
6
+ @Column({ type: 'varchar', length: 64, nullable: false })
7
+ section_code: string;
8
+
9
+ @Column({ type: 'varchar', length: 500, nullable: false })
10
+ section_title: string;
11
+
12
+ @Column({ type: 'int', default: 0 })
13
+ sequence_order: number;
14
+
15
+ @Column({ type: 'boolean', default: true })
16
+ is_active: boolean;
17
+ }