@platform-modules/foreign-ministry 1.3.297 → 1.3.309

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 (52) hide show
  1. package/dist/data-source.js +16 -0
  2. package/dist/index.d.ts +8 -0
  3. package/dist/index.js +23 -1
  4. package/dist/models/EmbassyEvaluationApprovalModel.d.ts +22 -0
  5. package/dist/models/EmbassyEvaluationApprovalModel.js +85 -0
  6. package/dist/models/EmbassyEvaluationAssignmentModel.d.ts +24 -0
  7. package/dist/models/EmbassyEvaluationAssignmentModel.js +89 -0
  8. package/dist/models/EmbassyEvaluationAttachmentModel.d.ts +10 -0
  9. package/dist/models/EmbassyEvaluationAttachmentModel.js +48 -0
  10. package/dist/models/EmbassyEvaluationChatModel.d.ts +18 -0
  11. package/dist/models/EmbassyEvaluationChatModel.js +66 -0
  12. package/dist/models/EmbassyEvaluationCycleModel.d.ts +17 -0
  13. package/dist/models/EmbassyEvaluationCycleModel.js +57 -0
  14. package/dist/models/EmbassyEvaluationDepartmentSettingModel.d.ts +14 -0
  15. package/dist/models/EmbassyEvaluationDepartmentSettingModel.js +56 -0
  16. package/dist/models/EmbassyEvaluationRequestModel.d.ts +24 -0
  17. package/dist/models/EmbassyEvaluationRequestModel.js +86 -0
  18. package/dist/models/EmbassyEvaluationResponseModel.d.ts +8 -0
  19. package/dist/models/EmbassyEvaluationResponseModel.js +44 -0
  20. package/dist/models/EmbassyEvaluationWorkflowModel.d.ts +19 -0
  21. package/dist/models/EmbassyEvaluationWorkflowModel.js +73 -0
  22. package/dist/models/EmployeeOfMonthSupportNominationApprovalModel.d.ts +9 -7
  23. package/dist/models/EmployeeOfMonthSupportNominationApprovalModel.js +10 -11
  24. package/dist/models/EmployeeOfMonthSupportNominationChatModel.d.ts +9 -8
  25. package/dist/models/EmployeeOfMonthSupportNominationChatModel.js +10 -12
  26. package/dist/models/EmployeeOfMonthSupportNominationRequestModel.d.ts +8 -7
  27. package/dist/models/EmployeeOfMonthSupportNominationRequestModel.js +9 -11
  28. package/dist/models/EmployeeOfMonthSupportNominationWorkflowModel.d.ts +8 -7
  29. package/dist/models/EmployeeOfMonthSupportNominationWorkflowModel.js +9 -11
  30. package/dist/models/EvaluationFormModel.js +5 -1
  31. package/package.json +1 -1
  32. package/src/data-source.ts +16 -0
  33. package/src/helpers/employee-evaluation-request.utils.ts +181 -181
  34. package/src/helpers/evaluation-eligibility.utils.ts +36 -36
  35. package/src/index.ts +26 -0
  36. package/src/models/EmbassyEvaluationApprovalModel.ts +57 -0
  37. package/src/models/EmbassyEvaluationAssignmentModel.ts +63 -0
  38. package/src/models/EmbassyEvaluationAttachmentModel.ts +26 -0
  39. package/src/models/EmbassyEvaluationChatModel.ts +43 -0
  40. package/src/models/EmbassyEvaluationCycleModel.ts +38 -0
  41. package/src/models/EmbassyEvaluationRequestModel.ts +59 -0
  42. package/src/models/EmbassyEvaluationResponseModel.ts +24 -0
  43. package/src/models/EmbassyEvaluationWorkflowModel.ts +48 -0
  44. package/src/models/EmployeeEvaluationPersonScoreModel.ts +25 -25
  45. package/src/models/EmployeeEvaluationRequestModel.ts +90 -90
  46. package/src/models/EmployeeOfMonthSupportNominationApprovalModel.ts +60 -57
  47. package/src/models/EmployeeOfMonthSupportNominationChatModel.ts +13 -11
  48. package/src/models/EmployeeOfMonthSupportNominationRequestModel.ts +12 -10
  49. package/src/models/EmployeeOfMonthSupportNominationWorkflowModel.ts +50 -48
  50. package/src/models/EvaluationFormModel.ts +4 -0
  51. package/src/models/EvaluationFormQuestionModel.ts +52 -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
- export enum EmployeeOfMonthSupportNominationApprovalStatus {
5
- PENDING = 'Pending',
6
- IN_PROGRESS = 'In Progress',
7
- APPROVED = 'Approved',
8
- REJECTED = 'Rejected',
9
- }
10
-
11
- @Entity({ name: 'employee_of_month_support_nomination_approvals' })
12
- export class EmployeeOfMonthSupportNominationApprovalDetails 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: true })
26
- approver_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: '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: EmployeeOfMonthSupportNominationApprovalStatus,
49
- enumName: 'eom_support_nomination_approval_status_enum',
50
- default: EmployeeOfMonthSupportNominationApprovalStatus.PENDING,
51
- nullable: false,
52
- })
53
- approval_status: EmployeeOfMonthSupportNominationApprovalStatus;
54
-
55
- @Column({ type: 'boolean', default: true, nullable: false })
56
- is_allowed: boolean;
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,13 +1,16 @@
1
1
  import { Column, Entity } from 'typeorm';
2
2
  import { BaseModel } from './BaseModel';
3
3
 
4
- export enum EmployeeOfMonthSupportNominationMessageType {
5
- TEXT = 'text',
6
- IMAGE = 'image',
7
- VIDEO = 'video',
8
- FILE = 'file',
9
- LINK = 'link',
10
- }
4
+ export const EmployeeOfMonthSupportNominationMessageType = {
5
+ TEXT: 'text',
6
+ IMAGE: 'image',
7
+ VIDEO: 'video',
8
+ FILE: 'file',
9
+ LINK: 'link',
10
+ } as const;
11
+
12
+ export type EmployeeOfMonthSupportNominationMessageType =
13
+ (typeof EmployeeOfMonthSupportNominationMessageType)[keyof typeof EmployeeOfMonthSupportNominationMessageType];
11
14
 
12
15
  @Entity({ name: 'employee_of_month_support_nomination_chats' })
13
16
  export class EmployeeOfMonthSupportNominationRequestChat extends BaseModel {
@@ -30,13 +33,12 @@ export class EmployeeOfMonthSupportNominationRequestChat extends BaseModel {
30
33
  message: string;
31
34
 
32
35
  @Column({
33
- type: 'enum',
34
- enum: EmployeeOfMonthSupportNominationMessageType,
35
- enumName: 'eom_support_nomination_message_type_enum',
36
+ type: 'varchar',
37
+ length: 32,
36
38
  default: EmployeeOfMonthSupportNominationMessageType.TEXT,
37
39
  nullable: false,
38
40
  })
39
- message_type: EmployeeOfMonthSupportNominationMessageType;
41
+ message_type: string;
40
42
 
41
43
  @Column({ type: 'text', nullable: true })
42
44
  status: string | null;
@@ -1,12 +1,15 @@
1
1
  import { Column, Entity } from 'typeorm';
2
2
  import { BaseModel } from './BaseModel';
3
3
 
4
- export enum EmployeeOfMonthSupportNominationRequestStatus {
5
- PENDING = 'Pending',
6
- IN_PROGRESS = 'In Progress',
7
- APPROVED = 'Approved',
8
- REJECTED = 'Rejected',
9
- }
4
+ export const EmployeeOfMonthSupportNominationRequestStatus = {
5
+ PENDING: 'Pending',
6
+ IN_PROGRESS: 'In Progress',
7
+ APPROVED: 'Approved',
8
+ REJECTED: 'Rejected',
9
+ } as const;
10
+
11
+ export type EmployeeOfMonthSupportNominationRequestStatus =
12
+ (typeof EmployeeOfMonthSupportNominationRequestStatus)[keyof typeof EmployeeOfMonthSupportNominationRequestStatus];
10
13
 
11
14
  export type EomSupportNominationRatingScores = {
12
15
  professional_ethics_teamwork: number;
@@ -43,13 +46,12 @@ export class EmployeeOfMonthSupportNominationRequests extends BaseModel {
43
46
  rating_scores: EomSupportNominationRatingScores;
44
47
 
45
48
  @Column({
46
- type: 'enum',
47
- enum: EmployeeOfMonthSupportNominationRequestStatus,
48
- enumName: 'eom_support_nomination_request_status_enum',
49
+ type: 'varchar',
50
+ length: 32,
49
51
  default: EmployeeOfMonthSupportNominationRequestStatus.PENDING,
50
52
  nullable: false,
51
53
  })
52
- status: EmployeeOfMonthSupportNominationRequestStatus;
54
+ status: string;
53
55
 
54
56
  @Column({ type: 'varchar', length: 255, nullable: true })
55
57
  workflow_execution_id: string | null;