@platform-modules/foreign-ministry 1.3.110 → 1.3.112

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 (47) hide show
  1. package/.env +17 -3
  2. package/dist/data-source.js +12 -0
  3. package/dist/index.d.ts +6 -1
  4. package/dist/index.js +6 -1
  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/LMSExternalCourseParticipationApprovalModel.d.ts +23 -0
  12. package/dist/models/LMSExternalCourseParticipationApprovalModel.js +83 -0
  13. package/dist/models/LMSExternalCourseParticipationAttachmentModel.d.ts +11 -0
  14. package/dist/models/LMSExternalCourseParticipationAttachmentModel.js +52 -0
  15. package/dist/models/LMSExternalCourseParticipationCandidateModel.d.ts +7 -0
  16. package/dist/models/LMSExternalCourseParticipationCandidateModel.js +36 -0
  17. package/dist/models/LMSExternalCourseParticipationChatModel.d.ts +19 -0
  18. package/dist/models/LMSExternalCourseParticipationChatModel.js +78 -0
  19. package/dist/models/LMSExternalCourseParticipationRequestModel.d.ts +26 -0
  20. package/dist/models/LMSExternalCourseParticipationRequestModel.js +92 -0
  21. package/dist/models/LMSExternalCourseParticipationWorkflowModel.d.ts +17 -0
  22. package/dist/models/LMSExternalCourseParticipationWorkflowModel.js +62 -0
  23. package/dist/models/RegisterCandidateRequestModel.d.ts +5 -0
  24. package/dist/models/RegisterCandidateRequestModel.js +20 -0
  25. package/dist/models/questionTagsModel.d.ts +6 -0
  26. package/dist/models/questionTagsModel.js +34 -0
  27. package/fix-enum-conflict-complete.sql +150 -0
  28. package/fix-enum-conflict-simple.sql +38 -0
  29. package/fix-enum-conflict.sql +23 -0
  30. package/package.json +1 -1
  31. package/src/data-source.ts +12 -0
  32. package/src/index.ts +6 -1
  33. package/src/models/LMSExternalCourseParticipationApprovalModel.ts +54 -0
  34. package/src/models/LMSExternalCourseParticipationAttachmentModel.ts +30 -0
  35. package/src/models/LMSExternalCourseParticipationCandidateModel.ts +17 -0
  36. package/src/models/LMSExternalCourseParticipationChatModel.ts +65 -0
  37. package/src/models/LMSExternalCourseParticipationRequestModel.ts +63 -0
  38. package/src/models/LMSExternalCourseParticipationWorkflowModel.ts +38 -0
  39. package/src/models/RegisterCandidateRequestModel.ts +177 -162
  40. package/dist/models/EmbassyMasterModel.d.ts +0 -16
  41. package/dist/models/EmbassyMasterModel.js +0 -75
  42. package/dist/models/StationeryRequestMaterialsModel.d.ts +0 -15
  43. package/dist/models/StationeryRequestMaterialsModel.js +0 -60
  44. package/dist/models/UserDependentsModel.d.ts +0 -18
  45. package/dist/models/UserDependentsModel.js +0 -94
  46. package/src/models/StationeryRequestMaterialsModel.ts +0 -43
  47. /package/src/models/{LeaveConfigGradesModel.Ts → LeaveConfigGradesModel.ts} +0 -0
@@ -0,0 +1,92 @@
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.LMSExternalCourseParticipationRequests = exports.LMSExternalCourseParticipationStatus = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ var LMSExternalCourseParticipationStatus;
16
+ (function (LMSExternalCourseParticipationStatus) {
17
+ LMSExternalCourseParticipationStatus["PENDING"] = "Pending";
18
+ LMSExternalCourseParticipationStatus["ASSIGNED"] = "Assigned";
19
+ LMSExternalCourseParticipationStatus["IN_PROGRESS"] = "In Progress";
20
+ LMSExternalCourseParticipationStatus["APPROVED"] = "Approved";
21
+ LMSExternalCourseParticipationStatus["REJECTED"] = "Rejected";
22
+ })(LMSExternalCourseParticipationStatus || (exports.LMSExternalCourseParticipationStatus = LMSExternalCourseParticipationStatus = {}));
23
+ let LMSExternalCourseParticipationRequests = class LMSExternalCourseParticipationRequests extends BaseModel_1.BaseModel {
24
+ };
25
+ exports.LMSExternalCourseParticipationRequests = LMSExternalCourseParticipationRequests;
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
28
+ __metadata("design:type", Object)
29
+ ], LMSExternalCourseParticipationRequests.prototype, "req_user_department_id", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
32
+ __metadata("design:type", Object)
33
+ ], LMSExternalCourseParticipationRequests.prototype, "req_user_section_id", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
36
+ __metadata("design:type", Object)
37
+ ], LMSExternalCourseParticipationRequests.prototype, "service_id", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
40
+ __metadata("design:type", Object)
41
+ ], LMSExternalCourseParticipationRequests.prototype, "sub_service_id", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
44
+ __metadata("design:type", Number)
45
+ ], LMSExternalCourseParticipationRequests.prototype, "user_id", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: 'enum', enum: LMSExternalCourseParticipationStatus, default: LMSExternalCourseParticipationStatus.PENDING, nullable: false }),
48
+ __metadata("design:type", String)
49
+ ], LMSExternalCourseParticipationRequests.prototype, "status", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
52
+ __metadata("design:type", Object)
53
+ ], LMSExternalCourseParticipationRequests.prototype, "workflow_execution_id", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
56
+ __metadata("design:type", Object)
57
+ ], LMSExternalCourseParticipationRequests.prototype, "course_name", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
60
+ __metadata("design:type", Object)
61
+ ], LMSExternalCourseParticipationRequests.prototype, "institution", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
64
+ __metadata("design:type", Object)
65
+ ], LMSExternalCourseParticipationRequests.prototype, "course_required_qualifications", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
68
+ __metadata("design:type", Object)
69
+ ], LMSExternalCourseParticipationRequests.prototype, "course_start_date", void 0);
70
+ __decorate([
71
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
72
+ __metadata("design:type", Object)
73
+ ], LMSExternalCourseParticipationRequests.prototype, "course_end_date", void 0);
74
+ __decorate([
75
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
76
+ __metadata("design:type", Object)
77
+ ], LMSExternalCourseParticipationRequests.prototype, "course_location", void 0);
78
+ __decorate([
79
+ (0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 2, nullable: true }),
80
+ __metadata("design:type", Object)
81
+ ], LMSExternalCourseParticipationRequests.prototype, "cost", void 0);
82
+ __decorate([
83
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
84
+ __metadata("design:type", Object)
85
+ ], LMSExternalCourseParticipationRequests.prototype, "currency_type", void 0);
86
+ __decorate([
87
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
88
+ __metadata("design:type", Object)
89
+ ], LMSExternalCourseParticipationRequests.prototype, "comment", void 0);
90
+ exports.LMSExternalCourseParticipationRequests = LMSExternalCourseParticipationRequests = __decorate([
91
+ (0, typeorm_1.Entity)({ name: 'lms_external_course_participation_requests' })
92
+ ], LMSExternalCourseParticipationRequests);
@@ -0,0 +1,17 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare enum LMSExternalCourseParticipationWorkFlowStatus {
3
+ COMPLETED = "Completed",
4
+ NOT_YET_STARTED = "Not Yet Started",
5
+ PENDING = "Pending"
6
+ }
7
+ export declare class LMSExternalCourseParticipationWorkFlow extends BaseModel {
8
+ request_id: number;
9
+ service_id: number | null;
10
+ sub_service_id: number | null;
11
+ content: string;
12
+ status: LMSExternalCourseParticipationWorkFlowStatus;
13
+ user_id: number | null;
14
+ role_id: number | null;
15
+ department_id: number | null;
16
+ section_id: number | null;
17
+ }
@@ -0,0 +1,62 @@
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.LMSExternalCourseParticipationWorkFlow = exports.LMSExternalCourseParticipationWorkFlowStatus = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ var LMSExternalCourseParticipationWorkFlowStatus;
16
+ (function (LMSExternalCourseParticipationWorkFlowStatus) {
17
+ LMSExternalCourseParticipationWorkFlowStatus["COMPLETED"] = "Completed";
18
+ LMSExternalCourseParticipationWorkFlowStatus["NOT_YET_STARTED"] = "Not Yet Started";
19
+ LMSExternalCourseParticipationWorkFlowStatus["PENDING"] = "Pending";
20
+ })(LMSExternalCourseParticipationWorkFlowStatus || (exports.LMSExternalCourseParticipationWorkFlowStatus = LMSExternalCourseParticipationWorkFlowStatus = {}));
21
+ let LMSExternalCourseParticipationWorkFlow = class LMSExternalCourseParticipationWorkFlow extends BaseModel_1.BaseModel {
22
+ };
23
+ exports.LMSExternalCourseParticipationWorkFlow = LMSExternalCourseParticipationWorkFlow;
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
26
+ __metadata("design:type", Number)
27
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "request_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
30
+ __metadata("design:type", Object)
31
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "service_id", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
34
+ __metadata("design:type", Object)
35
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "sub_service_id", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: false }),
38
+ __metadata("design:type", String)
39
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "content", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: 'enum', enum: LMSExternalCourseParticipationWorkFlowStatus, default: LMSExternalCourseParticipationWorkFlowStatus.NOT_YET_STARTED, nullable: false }),
42
+ __metadata("design:type", String)
43
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "status", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
46
+ __metadata("design:type", Object)
47
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "user_id", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
50
+ __metadata("design:type", Object)
51
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "role_id", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
54
+ __metadata("design:type", Object)
55
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "department_id", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
58
+ __metadata("design:type", Object)
59
+ ], LMSExternalCourseParticipationWorkFlow.prototype, "section_id", void 0);
60
+ exports.LMSExternalCourseParticipationWorkFlow = LMSExternalCourseParticipationWorkFlow = __decorate([
61
+ (0, typeorm_1.Entity)({ name: 'lms_external_course_participation_workflows' })
62
+ ], LMSExternalCourseParticipationWorkFlow);
@@ -24,6 +24,7 @@ export declare class RegisterCandidateRequests extends BaseModel {
24
24
  date_of_birth: Date | null;
25
25
  nationality: string | null;
26
26
  religion_and_sect: string | null;
27
+ sub_religion_and_sect: string | null;
27
28
  present_residence: string | null;
28
29
  occupation_and_employer: string | null;
29
30
  type_of_study_specializations_qualification: string | null;
@@ -43,6 +44,7 @@ export declare class RegisterCandidateRequests extends BaseModel {
43
44
  address2_po_box_telephone_fax: string | null;
44
45
  reference_full_name: string | null;
45
46
  reference_address_and_telephone: string | null;
47
+ telephone_number: string | null;
46
48
  reference_employer: string | null;
47
49
  vacancy_id: number | null;
48
50
  vacancy_description: string | null;
@@ -51,7 +53,10 @@ export declare class RegisterCandidateRequests extends BaseModel {
51
53
  interviewer_name: string | null;
52
54
  candidate_status: CandidateStatusType | null;
53
55
  joining_date: Date | null;
56
+ salary: string | null;
57
+ currency: string | null;
54
58
  expected_salary: string | null;
59
+ expected_currency: string | null;
55
60
  currency_type: string | null;
56
61
  status: RegisterCandidateStatus;
57
62
  workflow_execution_id: string | null;
@@ -71,6 +71,10 @@ __decorate([
71
71
  (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
72
72
  __metadata("design:type", Object)
73
73
  ], RegisterCandidateRequests.prototype, "religion_and_sect", void 0);
74
+ __decorate([
75
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
76
+ __metadata("design:type", Object)
77
+ ], RegisterCandidateRequests.prototype, "sub_religion_and_sect", void 0);
74
78
  __decorate([
75
79
  (0, typeorm_1.Column)({ type: 'text', nullable: true }),
76
80
  __metadata("design:type", Object)
@@ -147,6 +151,10 @@ __decorate([
147
151
  (0, typeorm_1.Column)({ type: 'text', nullable: true }),
148
152
  __metadata("design:type", Object)
149
153
  ], RegisterCandidateRequests.prototype, "reference_address_and_telephone", void 0);
154
+ __decorate([
155
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
156
+ __metadata("design:type", Object)
157
+ ], RegisterCandidateRequests.prototype, "telephone_number", void 0);
150
158
  __decorate([
151
159
  (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
152
160
  __metadata("design:type", Object)
@@ -179,10 +187,22 @@ __decorate([
179
187
  (0, typeorm_1.Column)({ type: 'date', nullable: true }),
180
188
  __metadata("design:type", Object)
181
189
  ], RegisterCandidateRequests.prototype, "joining_date", void 0);
190
+ __decorate([
191
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
192
+ __metadata("design:type", Object)
193
+ ], RegisterCandidateRequests.prototype, "salary", void 0);
194
+ __decorate([
195
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
196
+ __metadata("design:type", Object)
197
+ ], RegisterCandidateRequests.prototype, "currency", void 0);
182
198
  __decorate([
183
199
  (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
184
200
  __metadata("design:type", Object)
185
201
  ], RegisterCandidateRequests.prototype, "expected_salary", void 0);
202
+ __decorate([
203
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
204
+ __metadata("design:type", Object)
205
+ ], RegisterCandidateRequests.prototype, "expected_currency", void 0);
186
206
  __decorate([
187
207
  (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
188
208
  __metadata("design:type", Object)
@@ -0,0 +1,6 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class QuestionTags extends BaseModel {
3
+ name: string;
4
+ question_Id: number;
5
+ constructor(name: string, question_Id: number);
6
+ }
@@ -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,150 @@
1
+ -- ============================================================
2
+ -- Fix for TypeORM enum conflict issue
3
+ -- Run these queries in your PostgreSQL database to resolve the enum type conflict
4
+ -- ============================================================
5
+
6
+ -- Step 1: Check existing enum types (for reference)
7
+ SELECT typname, typtype
8
+ FROM pg_type
9
+ WHERE typname LIKE '%lms_external_course_participation_approvals_approval_status%';
10
+
11
+ -- Step 2: Drop the old enum type if it exists (from previous failed sync attempts)
12
+ DROP TYPE IF EXISTS "lms_external_course_participation_approvals_approval_status_enu_old" CASCADE;
13
+
14
+ -- Step 3: Check if the table exists and what columns use the enum
15
+ SELECT
16
+ table_name,
17
+ column_name,
18
+ data_type,
19
+ udt_name
20
+ FROM information_schema.columns
21
+ WHERE table_name = 'lms_external_course_participation_approvals'
22
+ AND column_name = 'approval_status';
23
+
24
+ -- Step 4: If the table exists, we need to handle the enum carefully
25
+ -- First, let's check if the table has any data
26
+ DO $$
27
+ DECLARE
28
+ row_count INTEGER;
29
+ BEGIN
30
+ SELECT COUNT(*) INTO row_count
31
+ FROM information_schema.tables
32
+ WHERE table_schema = 'public'
33
+ AND table_name = 'lms_external_course_participation_approvals';
34
+
35
+ IF row_count > 0 THEN
36
+ RAISE NOTICE 'Table exists. Proceeding with safe enum update...';
37
+ ELSE
38
+ RAISE NOTICE 'Table does not exist. Enum will be created when table is created.';
39
+ END IF;
40
+ END $$;
41
+
42
+ -- Step 5: Drop the existing enum type if it exists (we'll recreate it)
43
+ -- Note: This will fail if the enum is in use, so we handle it in the next step
44
+ DO $$
45
+ BEGIN
46
+ -- Try to drop the enum type
47
+ IF EXISTS (SELECT 1 FROM pg_type WHERE typname = 'lms_external_course_participation_approvals_approval_status_enu') THEN
48
+ -- Check if it's being used by any column
49
+ IF EXISTS (
50
+ SELECT 1
51
+ FROM information_schema.columns
52
+ WHERE udt_name = 'lms_external_course_participation_approvals_approval_status_enu'
53
+ ) THEN
54
+ RAISE NOTICE 'Enum type is in use. Changing column to text first...';
55
+
56
+ -- Change the column to text temporarily
57
+ ALTER TABLE IF EXISTS lms_external_course_participation_approvals
58
+ ALTER COLUMN approval_status TYPE text USING approval_status::text;
59
+
60
+ -- Now drop the enum
61
+ DROP TYPE IF EXISTS "lms_external_course_participation_approvals_approval_status_enu" CASCADE;
62
+
63
+ RAISE NOTICE 'Enum type dropped. Recreating with correct values...';
64
+ ELSE
65
+ -- Not in use, safe to drop
66
+ DROP TYPE IF EXISTS "lms_external_course_participation_approvals_approval_status_enu" CASCADE;
67
+ RAISE NOTICE 'Enum type dropped (was not in use).';
68
+ END IF;
69
+ ELSE
70
+ RAISE NOTICE 'Enum type does not exist.';
71
+ END IF;
72
+ END $$;
73
+
74
+ -- Step 6: Create the enum type with correct values
75
+ DO $$
76
+ BEGIN
77
+ IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'lms_external_course_participation_approvals_approval_status_enu') THEN
78
+ CREATE TYPE "lms_external_course_participation_approvals_approval_status_enu" AS ENUM (
79
+ 'Pending',
80
+ 'In Progress',
81
+ 'Approved',
82
+ 'Rejected'
83
+ );
84
+ RAISE NOTICE 'Enum type created successfully.';
85
+ ELSE
86
+ RAISE NOTICE 'Enum type already exists.';
87
+ END IF;
88
+ END $$;
89
+
90
+ -- Step 7: If table exists and column was changed to text, change it back to enum
91
+ DO $$
92
+ BEGIN
93
+ IF EXISTS (
94
+ SELECT 1
95
+ FROM information_schema.columns
96
+ WHERE table_name = 'lms_external_course_participation_approvals'
97
+ AND column_name = 'approval_status'
98
+ AND data_type = 'text'
99
+ ) THEN
100
+ RAISE NOTICE 'Changing column back to enum type...';
101
+
102
+ -- Change column back to enum type
103
+ ALTER TABLE lms_external_course_participation_approvals
104
+ ALTER COLUMN approval_status TYPE "lms_external_course_participation_approvals_approval_status_enu"
105
+ USING approval_status::"lms_external_course_participation_approvals_approval_status_enu";
106
+
107
+ -- Set default value
108
+ ALTER TABLE lms_external_course_participation_approvals
109
+ ALTER COLUMN approval_status SET DEFAULT 'Pending'::"lms_external_course_participation_approvals_approval_status_enu";
110
+
111
+ -- Set NOT NULL constraint
112
+ ALTER TABLE lms_external_course_participation_approvals
113
+ ALTER COLUMN approval_status SET NOT NULL;
114
+
115
+ RAISE NOTICE 'Column changed back to enum type successfully.';
116
+ ELSE
117
+ RAISE NOTICE 'Column is already using enum type or table does not exist.';
118
+ END IF;
119
+ END $$;
120
+
121
+ -- Step 8: Verify the fix
122
+ SELECT
123
+ typname as enum_name,
124
+ array_agg(enumlabel ORDER BY enumsortorder) as enum_values
125
+ FROM pg_type t
126
+ JOIN pg_enum e ON t.oid = e.enumtypid
127
+ WHERE typname = 'lms_external_course_participation_approvals_approval_status_enu'
128
+ GROUP BY typname;
129
+
130
+ -- Step 9: Final verification - check table structure
131
+ SELECT
132
+ column_name,
133
+ data_type,
134
+ udt_name,
135
+ column_default,
136
+ is_nullable
137
+ FROM information_schema.columns
138
+ WHERE table_name = 'lms_external_course_participation_approvals'
139
+ AND column_name = 'approval_status';
140
+
141
+ -- ============================================================
142
+ -- Summary:
143
+ -- 1. Dropped old enum type (_old version)
144
+ -- 2. Dropped existing enum type if it exists
145
+ -- 3. Created new enum type with correct values
146
+ -- 4. Updated column to use enum type if table exists
147
+ --
148
+ -- After running this script, restart your application.
149
+ -- TypeORM synchronize should work correctly now.
150
+ -- ============================================================
@@ -0,0 +1,38 @@
1
+ -- ============================================================
2
+ -- SIMPLE FIX - Run these queries in order
3
+ -- ============================================================
4
+
5
+ -- Query 1: Drop the old enum type (from previous failed attempts)
6
+ DROP TYPE IF EXISTS "lms_external_course_participation_approvals_approval_status_enu_old" CASCADE;
7
+
8
+ -- Query 2: If table exists, change column to text temporarily
9
+ ALTER TABLE IF EXISTS lms_external_course_participation_approvals
10
+ ALTER COLUMN approval_status TYPE text USING approval_status::text;
11
+
12
+ -- Query 3: Drop the existing enum type
13
+ DROP TYPE IF EXISTS "lms_external_course_participation_approvals_approval_status_enu" CASCADE;
14
+
15
+ -- Query 4: Create the enum type with correct values
16
+ CREATE TYPE "lms_external_course_participation_approvals_approval_status_enu" AS ENUM (
17
+ 'Pending',
18
+ 'In Progress',
19
+ 'Approved',
20
+ 'Rejected'
21
+ );
22
+
23
+ -- Query 5: Change column back to enum type (if table exists)
24
+ ALTER TABLE IF EXISTS lms_external_course_participation_approvals
25
+ ALTER COLUMN approval_status TYPE "lms_external_course_participation_approvals_approval_status_enu"
26
+ USING approval_status::"lms_external_course_participation_approvals_approval_status_enu";
27
+
28
+ -- Query 6: Set default value (if table exists)
29
+ ALTER TABLE IF EXISTS lms_external_course_participation_approvals
30
+ ALTER COLUMN approval_status SET DEFAULT 'Pending'::"lms_external_course_participation_approvals_approval_status_enu";
31
+
32
+ -- Query 7: Set NOT NULL constraint (if table exists)
33
+ ALTER TABLE IF EXISTS lms_external_course_participation_approvals
34
+ ALTER COLUMN approval_status SET NOT NULL;
35
+
36
+ -- ============================================================
37
+ -- After running these queries, restart your application
38
+ -- ============================================================
@@ -0,0 +1,23 @@
1
+ -- Fix for TypeORM enum conflict issue
2
+ -- Run this SQL script in your PostgreSQL database to resolve the enum type conflict
3
+
4
+ -- Drop the old enum type if it exists (from previous failed sync attempts)
5
+ DROP TYPE IF EXISTS "lms_external_course_participation_approvals_approval_status_enu_old" CASCADE;
6
+
7
+ -- Verify the current enum type exists and has correct values
8
+ DO $$
9
+ BEGIN
10
+ -- Check if the enum type exists
11
+ IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'lms_external_course_participation_approvals_approval_status_enu') THEN
12
+ -- Create the enum type if it doesn't exist
13
+ CREATE TYPE "lms_external_course_participation_approvals_approval_status_enu" AS ENUM (
14
+ 'Pending',
15
+ 'In Progress',
16
+ 'Approved',
17
+ 'Rejected'
18
+ );
19
+ END IF;
20
+ END $$;
21
+
22
+ -- Note: After running this script, restart your application
23
+ -- The TypeORM synchronize should work correctly now
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.3.110",
3
+ "version": "1.3.112",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -123,6 +123,12 @@ import { LMSExternalEntityTrainedApprovalDetails } from './models/LMSExternalEnt
123
123
  import { LMSExternalEntityTrainedRequestAttachment } from './models/LMSExternalEntityTrainedAttachmentModel';
124
124
  import { LMSExternalEntityTrainedRequestChat } from './models/LMSExternalEntityTrainedChatModel';
125
125
  import { LMSExternalEntityTrainedWorkFlow } from './models/LMSExternalEntityTrainedWorkflowModel';
126
+ import { LMSExternalCourseParticipationRequests } from './models/LMSExternalCourseParticipationRequestModel';
127
+ import { LMSExternalCourseParticipationApprovalDetails } from './models/LMSExternalCourseParticipationApprovalModel';
128
+ import { LMSExternalCourseParticipationRequestAttachment } from './models/LMSExternalCourseParticipationAttachmentModel';
129
+ import { LMSExternalCourseParticipationRequestChat } from './models/LMSExternalCourseParticipationChatModel';
130
+ import { LMSExternalCourseParticipationWorkFlow } from './models/LMSExternalCourseParticipationWorkflowModel';
131
+ import { LMSExternalCourseParticipationCandidate } from './models/LMSExternalCourseParticipationCandidateModel';
126
132
  import { RequestParcelRequests } from './models/RequestParcelRequestModel';
127
133
  import { RequestParcelApprovalDetails } from './models/RequestParcelApprovalModel';
128
134
  import { RequestParcelRequestAttachment } from './models/RequestParcelAttachmentModel';
@@ -284,6 +290,12 @@ export const AppDataSource = new DataSource({
284
290
  LMSExternalEntityTrainedRequestAttachment,
285
291
  LMSExternalEntityTrainedRequestChat,
286
292
  LMSExternalEntityTrainedWorkFlow,
293
+ LMSExternalCourseParticipationRequests,
294
+ LMSExternalCourseParticipationApprovalDetails,
295
+ LMSExternalCourseParticipationRequestAttachment,
296
+ LMSExternalCourseParticipationRequestChat,
297
+ LMSExternalCourseParticipationWorkFlow,
298
+ LMSExternalCourseParticipationCandidate,
287
299
  RequestParcelRequests,
288
300
  RequestParcelApprovalDetails,
289
301
  RequestParcelRequestAttachment,
package/src/index.ts CHANGED
@@ -120,6 +120,12 @@ export * from './models/LMSExternalEntityTrainedApprovalModel';
120
120
  export * from './models/LMSExternalEntityTrainedAttachmentModel';
121
121
  export * from './models/LMSExternalEntityTrainedChatModel';
122
122
  export * from './models/LMSExternalEntityTrainedWorkflowModel';
123
+ export * from './models/LMSExternalCourseParticipationRequestModel';
124
+ export * from './models/LMSExternalCourseParticipationApprovalModel';
125
+ export * from './models/LMSExternalCourseParticipationAttachmentModel';
126
+ export * from './models/LMSExternalCourseParticipationChatModel';
127
+ export * from './models/LMSExternalCourseParticipationWorkflowModel';
128
+ export * from './models/LMSExternalCourseParticipationCandidateModel';
123
129
  export * from './models/RequestParcelRequestModel';
124
130
  export * from './models/RequestParcelApprovalModel';
125
131
  export * from './models/RequestParcelAttachmentModel';
@@ -167,7 +173,6 @@ export * from './models/StayAfterHoursTransactionModel';
167
173
  export { StayAfterHoursTransaction, StayAfterHoursTransactionStatus } from './models/StayAfterHoursTransactionModel';
168
174
  export * from './models/TelephoneDirectoryModel';
169
175
  export * from './models/StationeryRequestsModel';
170
- export * from './models/StationeryRequestMaterialsModel';
171
176
  export * from './models/StationeryMaterialMasterModel';
172
177
  export * from './models/ProfileUpdateRequestsModel';
173
178
  export * from './models/UserPersonalDetailsModel';
@@ -0,0 +1,54 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum LMSExternalCourseParticipationApprovalStatus {
5
+ PENDING = "Pending",
6
+ IN_PROGRESS = "In Progress",
7
+ APPROVED = "Approved",
8
+ REJECTED = "Rejected"
9
+ }
10
+
11
+ @Entity({ name: 'lms_external_course_participation_approvals' })
12
+ export class LMSExternalCourseParticipationApprovalDetails 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;
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({ type: 'enum', enum: LMSExternalCourseParticipationApprovalStatus, enumName: 'lms_external_course_participation_approval_status_enum', default: LMSExternalCourseParticipationApprovalStatus.PENDING, nullable: false })
47
+ approval_status: LMSExternalCourseParticipationApprovalStatus;
48
+
49
+ @Column({ type: 'boolean', default: true, nullable: false })
50
+ is_allowed: boolean;
51
+
52
+ @Column({ type: 'varchar', length: 255, nullable: true })
53
+ task_name: string | null;
54
+ }
@@ -0,0 +1,30 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'lms_external_course_participation_attachments' })
5
+ export class LMSExternalCourseParticipationRequestAttachment 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: 500, nullable: false })
17
+ file_url: string;
18
+
19
+ @Column({ type: 'varchar', length: 255, nullable: true })
20
+ file_name: string;
21
+
22
+ @Column({ type: 'varchar', length: 100, nullable: true })
23
+ file_type: string;
24
+
25
+ @Column({ type: 'bigint', nullable: true })
26
+ file_size: number | null;
27
+
28
+ @Column({ type: 'integer', nullable: true })
29
+ chat_id: number | null;
30
+ }