@platform-modules/foreign-ministry 1.3.114 → 1.3.116

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 (45) hide show
  1. package/.env +15 -6
  2. package/dist/data-source.js +5 -1
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +2 -0
  5. package/dist/models/HelpContentMappedCategoriesModel.d.ts +6 -0
  6. package/dist/models/HelpContentMappedCategoriesModel.js +34 -0
  7. package/dist/models/HelpContentMappedTagsModel.d.ts +6 -0
  8. package/dist/models/HelpContentMappedTagsModel.js +34 -0
  9. package/dist/models/HelpContentTagsModel.d.ts +5 -0
  10. package/dist/models/HelpContentTagsModel.js +29 -0
  11. package/dist/models/LMSCourseExternalLecturerCostModel.d.ts +13 -0
  12. package/dist/models/LMSCourseExternalLecturerCostModel.js +60 -0
  13. package/dist/models/LMSCourseExternalLecturerLecturerModel.d.ts +15 -0
  14. package/dist/models/LMSCourseExternalLecturerLecturerModel.js +68 -0
  15. package/dist/models/LMSCourseExternalLecturerRequestModel.d.ts +9 -22
  16. package/dist/models/LMSCourseExternalLecturerRequestModel.js +19 -71
  17. package/dist/models/LMSExternalCourseParticipationCandidateModel.d.ts +16 -0
  18. package/dist/models/LMSExternalCourseParticipationCandidateModel.js +48 -1
  19. package/dist/models/RetiredCardRequestsModel.d.ts +1 -0
  20. package/dist/models/RetiredCardRequestsModel.js +4 -0
  21. package/dist/models/questionTagsModel.d.ts +6 -0
  22. package/dist/models/questionTagsModel.js +34 -0
  23. package/fix-lms-external-course-enum-conflict.sql +11 -0
  24. package/package.json +1 -1
  25. package/src/data-source.ts +5 -1
  26. package/src/index.ts +2 -0
  27. package/src/models/DocumentTranslationRequestModel.ts +54 -54
  28. package/src/models/LMSCourseExternalLecturerCostModel.ts +36 -0
  29. package/src/models/LMSCourseExternalLecturerLecturerModel.ts +42 -0
  30. package/src/models/LMSCourseExternalLecturerRequestModel.ts +18 -60
  31. package/src/models/LMSExternalCourseParticipationCandidateModel.ts +37 -0
  32. package/src/models/LeaveConfigModel.ts +71 -71
  33. package/src/models/MissionTravelApprovalModel.ts +101 -101
  34. package/src/models/MissionTravelAttachmentModel.ts +56 -56
  35. package/src/models/MissionTravelChatModel.ts +52 -52
  36. package/src/models/MissionTravelPersonModel.ts +105 -105
  37. package/src/models/MissionTravelWorkflowModel.ts +54 -54
  38. package/src/models/RegisterCandidateRequestModel.ts +177 -177
  39. package/src/models/RetiredCardRequestsModel.ts +4 -0
  40. package/src/models/SectionModel.ts +35 -35
  41. package/dist/models/MissionTravelClassConfigModel.d.ts +0 -10
  42. package/dist/models/MissionTravelClassConfigModel.js +0 -50
  43. package/dist/models/MissionTravelPerdiemModel.d.ts +0 -10
  44. package/dist/models/MissionTravelPerdiemModel.js +0 -54
  45. /package/src/models/{LeaveConfigGradesModel.Ts → LeaveConfigGradesModel.ts} +0 -0
@@ -0,0 +1,34 @@
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.QuestionTags = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let QuestionTags = class QuestionTags extends BaseModel_1.BaseModel {
16
+ constructor(name, question_Id) {
17
+ super();
18
+ this.name = name,
19
+ this.question_Id = question_Id;
20
+ }
21
+ };
22
+ exports.QuestionTags = QuestionTags;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ nullable: true }),
25
+ __metadata("design:type", String)
26
+ ], QuestionTags.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ nullable: true }),
29
+ __metadata("design:type", Number)
30
+ ], QuestionTags.prototype, "question_Id", void 0);
31
+ exports.QuestionTags = QuestionTags = __decorate([
32
+ (0, typeorm_1.Entity)({ name: 'question_tags' }),
33
+ __metadata("design:paramtypes", [String, Number])
34
+ ], QuestionTags);
@@ -0,0 +1,11 @@
1
+ -- Fix: "type lms_external_course_participation_candidate_approval_status_enu already exists"
2
+ -- Run this once when schema sync fails due to leftover enum types from a previous failed sync.
3
+ -- TypeORM renames the old enum to *_old before creating the new one; if a prior run failed,
4
+ -- *_old can already exist and the next sync fails with "already exists".
5
+
6
+ -- Drop leftover _old enum types if they exist (not used by any column after a partial sync)
7
+ DROP TYPE IF EXISTS "lms_external_course_participation_candidate_approval_status_enu_old" CASCADE;
8
+ DROP TYPE IF EXISTS "lms_external_course_participation_candidate_approval_status_enum_old" CASCADE;
9
+
10
+ -- Then re-run your application or schema sync. The entity uses enumName
11
+ -- 'lms_external_course_participation_candidate_approval_status_enum'.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.3.114",
3
+ "version": "1.3.116",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -118,6 +118,8 @@ import { LMSCourseExternalLecturerApprovalDetails } from './models/LMSCourseExte
118
118
  import { LMSCourseExternalLecturerRequestAttachment } from './models/LMSCourseExternalLecturerAttachmentModel';
119
119
  import { LMSCourseExternalLecturerRequestChat } from './models/LMSCourseExternalLecturerChatModel';
120
120
  import { LMSCourseExternalLecturerWorkFlow } from './models/LMSCourseExternalLecturerWorkflowModel';
121
+ import { LMSCourseExternalLecturerCost } from './models/LMSCourseExternalLecturerCostModel';
122
+ import { LMSCourseExternalLecturerLecturer } from './models/LMSCourseExternalLecturerLecturerModel';
121
123
  import { LMSExternalEntityTrainedRequests } from './models/LMSExternalEntityTrainedRequestModel';
122
124
  import { LMSExternalEntityTrainedApprovalDetails } from './models/LMSExternalEntityTrainedApprovalModel';
123
125
  import { LMSExternalEntityTrainedRequestAttachment } from './models/LMSExternalEntityTrainedAttachmentModel';
@@ -174,7 +176,7 @@ export const AppDataSource = new DataSource({
174
176
  username: process.env.DB_USER || 'postgres',
175
177
  password: process.env.DB_PASS || 'postgres',
176
178
  database: process.env.DB_NAME || 'common_models',
177
- synchronize: false, // auto-create tables (disable in prod)
179
+ synchronize: true, // auto-create tables (disable in prod)
178
180
  logging: false,
179
181
  entities: [
180
182
  User,
@@ -285,6 +287,8 @@ export const AppDataSource = new DataSource({
285
287
  LMSCourseExternalLecturerRequestAttachment,
286
288
  LMSCourseExternalLecturerRequestChat,
287
289
  LMSCourseExternalLecturerWorkFlow,
290
+ LMSCourseExternalLecturerCost,
291
+ LMSCourseExternalLecturerLecturer,
288
292
  LMSExternalEntityTrainedRequests,
289
293
  LMSExternalEntityTrainedApprovalDetails,
290
294
  LMSExternalEntityTrainedRequestAttachment,
package/src/index.ts CHANGED
@@ -115,6 +115,8 @@ export * from './models/LMSCourseExternalLecturerApprovalModel';
115
115
  export * from './models/LMSCourseExternalLecturerAttachmentModel';
116
116
  export * from './models/LMSCourseExternalLecturerChatModel';
117
117
  export * from './models/LMSCourseExternalLecturerWorkflowModel';
118
+ export * from './models/LMSCourseExternalLecturerCostModel';
119
+ export * from './models/LMSCourseExternalLecturerLecturerModel';
118
120
  export * from './models/LMSExternalEntityTrainedRequestModel';
119
121
  export * from './models/LMSExternalEntityTrainedApprovalModel';
120
122
  export * from './models/LMSExternalEntityTrainedAttachmentModel';
@@ -1,54 +1,54 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- export enum DocumentTranslationStatus {
5
- SUBMITTED = "Submitted",
6
- PENDING = "Pending",
7
- ASSIGNED = "Assigned",
8
- IN_PROGRESS = "In Progress",
9
- APPROVED = "Approved",
10
- REJECTED = "Rejected"
11
- }
12
-
13
- export enum DocumentClassificationType {
14
- NORMAL = "Normal",
15
- CONFIDENTIAL = "Confidential"
16
- }
17
-
18
- @Entity({ name: 'document_translation_requests' })
19
- export class DocumentTranslationRequests extends BaseModel {
20
-
21
- // Common columns
22
- @Column({ type: 'int', nullable: true })
23
- req_user_department_id: number | null;
24
-
25
- @Column({ type: 'int', nullable: true })
26
- req_user_section_id: number | null;
27
-
28
- @Column({ type: 'int', nullable: true })
29
- service_id: number | null;
30
-
31
- @Column({ type: 'int', nullable: true })
32
- sub_service_id: number | null;
33
-
34
- @Column({ type: 'int', nullable: false })
35
- user_id: number;
36
-
37
- // Document Translation specific columns
38
- @Column({ type: 'varchar', length: 255, nullable: false })
39
- document_type: string;
40
-
41
- @Column({ type: 'varchar', length: 500, nullable: false })
42
- document_name: string;
43
-
44
- @Column({ type: 'enum', enum: DocumentClassificationType, nullable: false })
45
- document_classification: DocumentClassificationType;
46
-
47
- @Column({ type: 'enum', enum: DocumentTranslationStatus, default: DocumentTranslationStatus.PENDING, nullable: false })
48
- status: DocumentTranslationStatus;
49
-
50
- @Column({ type: 'varchar', nullable: true })
51
- workflow_execution_id: string | null;
52
-
53
- }
54
-
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum DocumentTranslationStatus {
5
+ SUBMITTED = "Submitted",
6
+ PENDING = "Pending",
7
+ ASSIGNED = "Assigned",
8
+ IN_PROGRESS = "In Progress",
9
+ APPROVED = "Approved",
10
+ REJECTED = "Rejected"
11
+ }
12
+
13
+ export enum DocumentClassificationType {
14
+ NORMAL = "Normal",
15
+ CONFIDENTIAL = "Confidential"
16
+ }
17
+
18
+ @Entity({ name: 'document_translation_requests' })
19
+ export class DocumentTranslationRequests extends BaseModel {
20
+
21
+ // Common columns
22
+ @Column({ type: 'int', nullable: true })
23
+ req_user_department_id: number | null;
24
+
25
+ @Column({ type: 'int', nullable: true })
26
+ req_user_section_id: number | null;
27
+
28
+ @Column({ type: 'int', nullable: true })
29
+ service_id: number | null;
30
+
31
+ @Column({ type: 'int', nullable: true })
32
+ sub_service_id: number | null;
33
+
34
+ @Column({ type: 'int', nullable: false })
35
+ user_id: number;
36
+
37
+ // Document Translation specific columns
38
+ @Column({ type: 'varchar', length: 255, nullable: false })
39
+ document_type: string;
40
+
41
+ @Column({ type: 'varchar', length: 500, nullable: false })
42
+ document_name: string;
43
+
44
+ @Column({ type: 'enum', enum: DocumentClassificationType, nullable: false })
45
+ document_classification: DocumentClassificationType;
46
+
47
+ @Column({ type: 'enum', enum: DocumentTranslationStatus, default: DocumentTranslationStatus.PENDING, nullable: false })
48
+ status: DocumentTranslationStatus;
49
+
50
+ @Column({ type: 'varchar', nullable: true })
51
+ workflow_execution_id: string | null;
52
+
53
+ }
54
+
@@ -0,0 +1,36 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'lms_course_external_lecturer_costs' })
5
+ export class LMSCourseExternalLecturerCost extends BaseModel {
6
+
7
+ @Column({ type: 'integer', nullable: false })
8
+ request_id: number;
9
+
10
+ @Column({ type: 'integer', nullable: true })
11
+ service_id: number | null;
12
+
13
+ @Column({ type: 'integer', nullable: true })
14
+ sub_service_id: number | null;
15
+
16
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true, default: 0 })
17
+ material_price: number | null;
18
+
19
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true, default: 0 })
20
+ transportation: number | null;
21
+
22
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true, default: 0 })
23
+ accommodation: number | null;
24
+
25
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true, default: 0 })
26
+ allowances: number | null;
27
+
28
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true, default: 0 })
29
+ food: number | null;
30
+
31
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true, default: 0 })
32
+ present: number | null;
33
+
34
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true, default: 0 })
35
+ total_cost: number | null;
36
+ }
@@ -0,0 +1,42 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'lms_course_external_lecturer_lecturers' })
5
+ export class LMSCourseExternalLecturerLecturer extends BaseModel {
6
+
7
+ @Column({ type: 'integer', nullable: false })
8
+ request_id: number;
9
+
10
+ @Column({ type: 'integer', nullable: true })
11
+ service_id: number | null;
12
+
13
+ @Column({ type: 'integer', nullable: true })
14
+ sub_service_id: number | null;
15
+
16
+ @Column({ type: 'varchar', length: 255, nullable: false })
17
+ full_name: string;
18
+
19
+ @Column({ type: 'varchar', length: 100, nullable: false })
20
+ passport_or_id: string;
21
+
22
+ @Column({ type: 'integer', nullable: false })
23
+ age: number;
24
+
25
+ @Column({ type: 'text', nullable: false })
26
+ qualifications: string;
27
+
28
+ @Column({ type: 'text', nullable: false })
29
+ experience: string;
30
+
31
+ @Column({ type: 'varchar', length: 500, nullable: true })
32
+ cv_file_url: string | null;
33
+
34
+ @Column({ type: 'varchar', length: 255, nullable: true })
35
+ cv_file_name: string | null;
36
+
37
+ @Column({ type: 'varchar', length: 100, nullable: true })
38
+ cv_file_type: string | null;
39
+
40
+ @Column({ type: 'bigint', nullable: true })
41
+ cv_file_size: number | null;
42
+ }
@@ -27,78 +27,36 @@ export class LMSCourseExternalLecturerRequests extends BaseModel {
27
27
  @Column({ type: 'int', nullable: false })
28
28
  user_id: number;
29
29
 
30
+ @Column({ type: 'varchar', length: 255, nullable: false })
31
+ course_name: string;
30
32
 
31
- // New columns
32
- @Column({ type: 'varchar', length: 255, nullable: true })
33
- course_name: string | null;
33
+ @Column({ type: 'varchar', length: 100, nullable: false })
34
+ course_level: string;
34
35
 
35
- @Column({ type: 'varchar', length: 255, nullable: true })
36
- course_level: string | null;
36
+ @Column({ type: 'varchar', length: 255, nullable: false })
37
+ institution: string;
37
38
 
38
- @Column({ type: 'varchar', nullable: true })
39
- material_price: string | null;
40
-
41
- @Column({ type: 'varchar', nullable: true })
42
- transportation: string | null;
43
-
44
- @Column({ type: 'varchar', nullable: true })
45
- accommodation: string | null;
46
-
47
- @Column({ type: 'varchar', nullable: true })
48
- allowances: string | null;
49
-
50
- @Column({ type: 'varchar', nullable: true })
51
- food: string | null;
52
-
53
- @Column({ type: 'varchar', length: 255, nullable: true })
54
- present: string | null;
55
-
56
- @Column({ type: 'varchar', length: 255, nullable: true })
57
- currency_type: string | null;
39
+ @Column({ type: 'text', nullable: false })
40
+ reason_of_course: string;
58
41
 
59
- @Column({ type: 'text', nullable: true })
60
- reason_of_course: string | null;
61
-
62
- @Column({ type: 'int', nullable: true })
63
- estimated_number_of_participants: number | null;
64
-
65
- @Column({ type: 'date', nullable: true })
66
- date_from: Date | null;
67
-
68
- @Column({ type: 'date', nullable: true })
69
- date_to: Date | null;
70
-
71
- @Column({ type: 'varchar', length: 255, nullable: true })
72
- time_from: string | null;
73
-
74
- @Column({ type: 'varchar', length: 255, nullable: true })
75
- time_to: string | null;
76
-
77
- @Column({ type: 'varchar', length: 255, nullable: true })
78
- lecturer_full_name: string | null;
79
-
80
- @Column({ type: 'varchar', length: 255, nullable: true })
81
- passport: string | null;
82
-
83
- @Column({ type: 'int', nullable: true })
84
- age: number | null;
42
+ @Column({ type: 'int', nullable: false })
43
+ estimated_number_of_participants: number;
85
44
 
86
- @Column({ type: 'text', nullable: true })
87
- qualifications: string | null;
45
+ @Column({ type: 'date', nullable: false })
46
+ date_from: Date;
88
47
 
89
- @Column({ type: 'text', nullable: true })
90
- experience: string | null;
48
+ @Column({ type: 'date', nullable: false })
49
+ date_to: Date;
91
50
 
92
- @Column({ type: 'varchar', length: 500, nullable: true })
93
- cv_attachment: string | null;
51
+ @Column({ type: 'time', nullable: false })
52
+ time_from: string;
94
53
 
95
- @Column({ type: 'varchar', length: 500, nullable: true })
96
- course_material: string | null;
54
+ @Column({ type: 'time', nullable: false })
55
+ time_to: string;
97
56
 
98
57
  @Column({ type: 'enum', enum: LMSCourseExternalLecturerStatus, default: LMSCourseExternalLecturerStatus.PENDING, nullable: false })
99
58
  status: LMSCourseExternalLecturerStatus;
100
59
 
101
60
  @Column({ type: 'varchar', nullable: true })
102
61
  workflow_execution_id: string | null;
103
-
104
62
  }
@@ -1,6 +1,13 @@
1
1
  import { Column, Entity } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
3
 
4
+ export enum LMSExternalCourseParticipationCandidateApprovalStatus {
5
+ PENDING = "Pending",
6
+ IN_PROGRESS = "In Progress",
7
+ APPROVED = "Approved",
8
+ REJECTED = "Rejected"
9
+ }
10
+
4
11
  @Entity({ name: 'lms_external_course_participation_candidates' })
5
12
  export class LMSExternalCourseParticipationCandidate extends BaseModel {
6
13
  @Column({ type: 'integer', nullable: false })
@@ -14,4 +21,34 @@ export class LMSExternalCourseParticipationCandidate extends BaseModel {
14
21
 
15
22
  @Column({ type: 'varchar', length: 500, nullable: true })
16
23
  candidate_profile_url: string | null;
24
+
25
+ @Column({ type: 'integer', nullable: true })
26
+ service_id: number | null;
27
+
28
+ @Column({ type: 'integer', nullable: true })
29
+ sub_service_id: number | null;
30
+
31
+ @Column({ type: 'integer', nullable: true })
32
+ approver_role_id: number;
33
+
34
+ @Column({ type: 'integer', nullable: true })
35
+ department_id: number | null;
36
+
37
+ @Column({ type: 'integer', nullable: true })
38
+ section_id: number | null;
39
+
40
+ @Column({ type: 'integer', nullable: true })
41
+ approver_user_id: number | null;
42
+
43
+ @Column({ type: 'integer', nullable: true })
44
+ delegate_user_id: number | null;
45
+
46
+ @Column({ type: 'integer', nullable: true })
47
+ approved_by: number | null;
48
+
49
+ @Column({ type: 'varchar', length: 500, nullable: true, default: '' })
50
+ comment: string;
51
+
52
+ @Column({ type: 'enum', enum: LMSExternalCourseParticipationCandidateApprovalStatus, enumName: 'lms_external_course_participation_candidate_approval_status_enum', default: LMSExternalCourseParticipationCandidateApprovalStatus.PENDING, nullable: false })
53
+ approval_status: LMSExternalCourseParticipationCandidateApprovalStatus;
17
54
  }
@@ -1,72 +1,72 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- export enum enumFrequency {
5
- Monthly = 'Monthly',
6
- Yearly = 'Yearly',
7
- }
8
-
9
- //This model is used to store the Financial Grade declaration on the Admin Side
10
- @Entity({ name: 'leave_configuration' })
11
- export class LeaveConfiguration extends BaseModel {
12
-
13
- @Column({ type: 'varchar', nullable: true })
14
- category: string;
15
-
16
- @Column({ type: 'int', nullable: true })
17
- MandC_id: number;
18
-
19
- @Column({ type: 'int', nullable: true })
20
- leave_type_id: number;
21
-
22
- @Column({ type: 'varchar', nullable: true })
23
- frequency: enumFrequency;
24
-
25
- @Column({ type: 'varchar', nullable: true })
26
- region: string;
27
-
28
- @Column({ type: 'varchar', nullable: true })
29
- country: string;
30
-
31
- @Column({ type: 'varchar', nullable: true })
32
- location: string;
33
-
34
- @Column({ nullable: true, default: false })
35
- is_carryforward: boolean;
36
-
37
- @Column({ type: 'int', nullable: true, default: 0 })
38
- carryforward_limit: number;
39
-
40
- @Column({ type: 'date', nullable: true })
41
- from_date: Date;
42
-
43
- @Column({ type: 'date', nullable: true })
44
- to_date: Date;
45
-
46
- @Column({ type: 'varchar', nullable: true })
47
- reason: string;
48
-
49
- @Column({ type: 'int', nullable: true })
50
- emergency_balance_days: number | null;
51
-
52
- @Column({ type: 'date', nullable: true })
53
- last_credited: Date | null;
54
-
55
- constructor(category: string, MandC_id: number, leave_type_id: number, frequency: enumFrequency, region: string, country: string, location: string, is_carryforward: boolean, carryforward_limit: number, from_date: Date, to_date: Date, reason: string, emergency_balance_days?: number|null, last_credited?: Date|null) {
56
- super();
57
- this.category = category;
58
- this.MandC_id = MandC_id;
59
- this.leave_type_id = leave_type_id;
60
- this.frequency = frequency;
61
- this.region = region;
62
- this.country = country;
63
- this.location = location;
64
- this.is_carryforward = is_carryforward;
65
- this.carryforward_limit = carryforward_limit;
66
- this.from_date = from_date;
67
- this.to_date = to_date;
68
- this.reason = reason;
69
- this.emergency_balance_days = emergency_balance_days ?? null;
70
- this.last_credited = last_credited ?? null;
71
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum enumFrequency {
5
+ Monthly = 'Monthly',
6
+ Yearly = 'Yearly',
7
+ }
8
+
9
+ //This model is used to store the Financial Grade declaration on the Admin Side
10
+ @Entity({ name: 'leave_configuration' })
11
+ export class LeaveConfiguration extends BaseModel {
12
+
13
+ @Column({ type: 'varchar', nullable: true })
14
+ category: string;
15
+
16
+ @Column({ type: 'int', nullable: true })
17
+ MandC_id: number;
18
+
19
+ @Column({ type: 'int', nullable: true })
20
+ leave_type_id: number;
21
+
22
+ @Column({ type: 'varchar', nullable: true })
23
+ frequency: enumFrequency;
24
+
25
+ @Column({ type: 'varchar', nullable: true })
26
+ region: string;
27
+
28
+ @Column({ type: 'varchar', nullable: true })
29
+ country: string;
30
+
31
+ @Column({ type: 'varchar', nullable: true })
32
+ location: string;
33
+
34
+ @Column({ nullable: true, default: false })
35
+ is_carryforward: boolean;
36
+
37
+ @Column({ type: 'int', nullable: true, default: 0 })
38
+ carryforward_limit: number;
39
+
40
+ @Column({ type: 'date', nullable: true })
41
+ from_date: Date;
42
+
43
+ @Column({ type: 'date', nullable: true })
44
+ to_date: Date;
45
+
46
+ @Column({ type: 'varchar', nullable: true })
47
+ reason: string;
48
+
49
+ @Column({ type: 'int', nullable: true })
50
+ emergency_balance_days: number | null;
51
+
52
+ @Column({ type: 'date', nullable: true })
53
+ last_credited: Date | null;
54
+
55
+ constructor(category: string, MandC_id: number, leave_type_id: number, frequency: enumFrequency, region: string, country: string, location: string, is_carryforward: boolean, carryforward_limit: number, from_date: Date, to_date: Date, reason: string, emergency_balance_days?: number|null, last_credited?: Date|null) {
56
+ super();
57
+ this.category = category;
58
+ this.MandC_id = MandC_id;
59
+ this.leave_type_id = leave_type_id;
60
+ this.frequency = frequency;
61
+ this.region = region;
62
+ this.country = country;
63
+ this.location = location;
64
+ this.is_carryforward = is_carryforward;
65
+ this.carryforward_limit = carryforward_limit;
66
+ this.from_date = from_date;
67
+ this.to_date = to_date;
68
+ this.reason = reason;
69
+ this.emergency_balance_days = emergency_balance_days ?? null;
70
+ this.last_credited = last_credited ?? null;
71
+ }
72
72
  }