@platform-modules/foreign-ministry 1.3.351 → 1.3.358
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/employee-evaluation-request.utils.d.ts +12 -0
- package/dist/helpers/employee-evaluation-request.utils.js +85 -0
- package/dist/helpers/sla-request-status.helper.d.ts +3 -0
- package/dist/helpers/sla-request-status.helper.js +36 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -3
- package/dist/models/EmbassyEvaluationDepartmentSettingModel.d.ts +14 -0
- package/dist/models/EmbassyEvaluationDepartmentSettingModel.js +56 -0
- package/dist/models/EvaluationMastersModel.d.ts +16 -0
- package/dist/models/EvaluationMastersModel.js +67 -0
- package/dist/models/EvaluationQuestionMasterModel.d.ts +10 -0
- package/dist/models/EvaluationQuestionMasterModel.js +42 -0
- package/dist/models/EvaluationSectionMasterModel.d.ts +7 -0
- package/dist/models/EvaluationSectionMasterModel.js +36 -0
- package/dist/models/EvaluationWorkflowModel.d.ts +60 -0
- package/dist/models/EvaluationWorkflowModel.js +215 -0
- package/dist/models/IneligibleForEvaluationModel.d.ts +8 -0
- package/dist/models/IneligibleForEvaluationModel.js +44 -0
- package/dist/models/MissionTravelClassConfigModel.d.ts +10 -0
- package/dist/models/MissionTravelClassConfigModel.js +50 -0
- package/dist/models/MissionTravelPerdiemModel.d.ts +10 -0
- package/dist/models/MissionTravelPerdiemModel.js +54 -0
- package/dist/models/SlaApprovalsViewModel.js +54 -54
- package/dist/models/SlaMyRequestsViewModel.d.ts +3 -0
- package/dist/models/SlaMyRequestsViewModel.js +73 -53
- package/dist/models/UuidAuditModel.d.ts +9 -0
- package/dist/models/UuidAuditModel.js +41 -0
- package/package.json +2 -2
- package/scripts/check-column-types.js +38 -38
- package/scripts/check-service-tables.js +42 -42
- package/scripts/sync-sla-reports-sql.js +92 -92
- package/sql/sla-reports-sync.manifest.json +9 -9
- package/sql/sla_reports_admin_procedures.sql +321 -322
- package/sql/sla_reports_approvals_workbook.sql +427 -430
- package/sql/sla_reports_procedures.sql +883 -886
- package/sql/sla_requests_status_to_varchar.sql +28 -28
- package/sql/vw_sla_approvals.sql +115 -115
- package/sql/vw_sla_my_requests.sql +60 -55
- package/src/helpers/employee-evaluation-request.utils.ts +127 -0
- package/src/helpers/evaluation-eligibility.utils.ts +126 -126
- package/src/index.ts +1 -0
- package/src/models/DiplomaticAcademyRequestModel.ts +80 -80
- package/src/models/DocumentationFileModel.ts +40 -40
- package/src/models/EmbassyEvaluationCycleModel.ts +45 -45
- package/src/models/EmbassyEvaluationRequestModel.ts +59 -59
- package/src/models/EmployeeEvaluationAnswerModel.ts +26 -26
- package/src/models/EvaluationEligibilitySettingModel.ts +51 -51
- package/src/models/EvaluationFormModel.ts +44 -44
- package/src/models/LanguageCourseRequestModel.ts +67 -67
- package/src/models/LeaveApprovalsModel.ts +66 -66
- package/src/models/LeaveConfigModel.ts +71 -71
- package/src/models/MissionTravelApprovalModel.ts +101 -101
- package/src/models/MissionTravelAttachmentModel.ts +56 -56
- package/src/models/MissionTravelChatModel.ts +52 -52
- package/src/models/MissionTravelPersonModel.ts +105 -105
- package/src/models/MissionTravelWorkflowModel.ts +54 -54
- package/src/models/ProjectContactsModel.ts +51 -51
- package/src/models/ProjectFaqModel.ts +36 -36
- package/src/models/ProjectInvoicesModel.ts +41 -41
- package/src/models/ProjectModel.ts +75 -75
- package/src/models/ProjectTasksModel.ts +75 -75
- package/src/models/ServiceSlaApprovalModel.ts +63 -63
- package/src/models/ServicesNotificationConfigsModel.ts +55 -55
- package/src/models/SlaApprovalsViewModel.ts +142 -142
- package/src/models/SlaMyRequestsViewModel.ts +192 -172
- package/src/models/SlaRequestModel.ts +57 -57
- package/src/sla-report-views.ts +3 -3
- package/dist/auth/authenticate-jwt-session.d.ts +0 -19
- package/dist/auth/authenticate-jwt-session.js +0 -35
- package/dist/auth/jwt-token.helper.d.ts +0 -18
- package/dist/auth/jwt-token.helper.js +0 -58
- package/dist/auth/user-session-validation.d.ts +0 -42
- package/dist/auth/user-session-validation.js +0 -95
- package/dist/i18n/workflow-chat-i18n.d.ts +0 -5
- package/dist/i18n/workflow-chat-i18n.js +0 -21
- package/dist/i18n/workflow-chat-i18n.json +0 -320
- package/dist/i18n/workflow-chat-message.builder.d.ts +0 -325
- package/dist/i18n/workflow-chat-message.builder.js +0 -924
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Evaluation exception cycle dates are stored as MM-DD strings (e.g. 01-01, 05-31, 04-12).
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export type MmDdInterval = { start: number; end: number };
|
|
6
|
-
|
|
7
|
-
/** Validate and normalize MM-DD (e.g. 1-1 → 01-01). */
|
|
8
|
-
export function parseMonthDay(value: unknown): string | null {
|
|
9
|
-
if (value == null || value === '') return null;
|
|
10
|
-
const s = String(value).trim();
|
|
11
|
-
const m = /^(\d{1,2})-(\d{1,2})$/.exec(s);
|
|
12
|
-
if (!m) return null;
|
|
13
|
-
const month = parseInt(m[1], 10);
|
|
14
|
-
const day = parseInt(m[2], 10);
|
|
15
|
-
if (month < 1 || month > 12 || day < 1 || day > 31) return null;
|
|
16
|
-
return `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function parseMmDdParts(mmDd: string): { month: number; day: number } | null {
|
|
20
|
-
const normalized = parseMonthDay(mmDd);
|
|
21
|
-
if (!normalized) return null;
|
|
22
|
-
const [month, day] = normalized.split('-').map(Number);
|
|
23
|
-
return { month, day };
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Sortable key for MM-DD overlap checks (month * 100 + day). */
|
|
27
|
-
export function mmDdSortKey(mmDd: string): number {
|
|
28
|
-
const parts = parseMmDdParts(mmDd);
|
|
29
|
-
if (!parts) return 0;
|
|
30
|
-
return parts.month * 100 + parts.day;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function expandMmDdWindow(startMmDd: string, endMmDd: string): MmDdInterval[] {
|
|
34
|
-
const start = mmDdSortKey(startMmDd);
|
|
35
|
-
const end = mmDdSortKey(endMmDd);
|
|
36
|
-
if (start <= end) return [{ start, end }];
|
|
37
|
-
return [
|
|
38
|
-
{ start, end: 1231 },
|
|
39
|
-
{ start: 101, end },
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function linearIntervalsOverlap(a: MmDdInterval, b: MmDdInterval): boolean {
|
|
44
|
-
return a.start <= b.end && b.start <= a.end;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** True when two MM-DD windows share any calendar period. */
|
|
48
|
-
export function mmDdWindowsOverlap(
|
|
49
|
-
startA: string,
|
|
50
|
-
endA: string,
|
|
51
|
-
startB: string,
|
|
52
|
-
endB: string
|
|
53
|
-
): boolean {
|
|
54
|
-
const intervalsA = expandMmDdWindow(startA, endA);
|
|
55
|
-
const intervalsB = expandMmDdWindow(startB, endB);
|
|
56
|
-
for (const ia of intervalsA) {
|
|
57
|
-
for (const ib of intervalsB) {
|
|
58
|
-
if (linearIntervalsOverlap(ia, ib)) return true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** Whether calendar month (1–12) falls within the inclusive MM-DD window. */
|
|
65
|
-
export function isCalendarMonthInEligibilityRange(
|
|
66
|
-
fromMmDd: string,
|
|
67
|
-
toMmDd: string,
|
|
68
|
-
calendarMonth: number
|
|
69
|
-
): boolean {
|
|
70
|
-
const from = parseMmDdParts(fromMmDd);
|
|
71
|
-
const to = parseMmDdParts(toMmDd);
|
|
72
|
-
if (!from || !to || calendarMonth < 1 || calendarMonth > 12) return false;
|
|
73
|
-
const fm = from.month;
|
|
74
|
-
const tm = to.month;
|
|
75
|
-
if (fm <= tm) return calendarMonth >= fm && calendarMonth <= tm;
|
|
76
|
-
return calendarMonth >= fm || calendarMonth <= tm;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Whether HOD submissions are still open for the active cycle on the reference date.
|
|
81
|
-
* Uses the day component of `evaluationEndMmDd` as the last submission day of each month in range.
|
|
82
|
-
*/
|
|
83
|
-
export function isEvaluationEligibilityWindowOpen(
|
|
84
|
-
fromMmDd: string,
|
|
85
|
-
toMmDd: string,
|
|
86
|
-
evaluationEndMmDd: string,
|
|
87
|
-
referenceDate: Date = new Date()
|
|
88
|
-
): boolean {
|
|
89
|
-
const month = referenceDate.getMonth() + 1;
|
|
90
|
-
const day = referenceDate.getDate();
|
|
91
|
-
if (!isCalendarMonthInEligibilityRange(fromMmDd, toMmDd, month)) return false;
|
|
92
|
-
const endParts = parseMmDdParts(evaluationEndMmDd);
|
|
93
|
-
if (!endParts) return false;
|
|
94
|
-
return day <= endParts.day;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function parseEligibilityDateRange(
|
|
98
|
-
fromInput: unknown,
|
|
99
|
-
toInput: unknown
|
|
100
|
-
): { from_month: string; to_month: string } | null {
|
|
101
|
-
const from_month = parseMonthDay(fromInput);
|
|
102
|
-
const to_month = parseMonthDay(toInput);
|
|
103
|
-
if (!from_month || !to_month) return null;
|
|
104
|
-
return { from_month, to_month };
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** @deprecated Use parseMonthDay for MM-DD strings. */
|
|
108
|
-
export function parseEvaluationEndDay(input: unknown): number | null {
|
|
109
|
-
const mmDd = parseMonthDay(input);
|
|
110
|
-
if (!mmDd) return null;
|
|
111
|
-
const parts = parseMmDdParts(mmDd);
|
|
112
|
-
return parts?.day ?? null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/** @deprecated Use parseEligibilityDateRange for MM-DD strings. */
|
|
116
|
-
export function parseMonthRange(
|
|
117
|
-
fromInput: unknown,
|
|
118
|
-
toInput: unknown
|
|
119
|
-
): { from_month: number; to_month: number } | null {
|
|
120
|
-
const range = parseEligibilityDateRange(fromInput, toInput);
|
|
121
|
-
if (!range) return null;
|
|
122
|
-
const from = parseMmDdParts(range.from_month);
|
|
123
|
-
const to = parseMmDdParts(range.to_month);
|
|
124
|
-
if (!from || !to) return null;
|
|
125
|
-
return { from_month: from.month, to_month: to.month };
|
|
126
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Evaluation exception cycle dates are stored as MM-DD strings (e.g. 01-01, 05-31, 04-12).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type MmDdInterval = { start: number; end: number };
|
|
6
|
+
|
|
7
|
+
/** Validate and normalize MM-DD (e.g. 1-1 → 01-01). */
|
|
8
|
+
export function parseMonthDay(value: unknown): string | null {
|
|
9
|
+
if (value == null || value === '') return null;
|
|
10
|
+
const s = String(value).trim();
|
|
11
|
+
const m = /^(\d{1,2})-(\d{1,2})$/.exec(s);
|
|
12
|
+
if (!m) return null;
|
|
13
|
+
const month = parseInt(m[1], 10);
|
|
14
|
+
const day = parseInt(m[2], 10);
|
|
15
|
+
if (month < 1 || month > 12 || day < 1 || day > 31) return null;
|
|
16
|
+
return `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function parseMmDdParts(mmDd: string): { month: number; day: number } | null {
|
|
20
|
+
const normalized = parseMonthDay(mmDd);
|
|
21
|
+
if (!normalized) return null;
|
|
22
|
+
const [month, day] = normalized.split('-').map(Number);
|
|
23
|
+
return { month, day };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Sortable key for MM-DD overlap checks (month * 100 + day). */
|
|
27
|
+
export function mmDdSortKey(mmDd: string): number {
|
|
28
|
+
const parts = parseMmDdParts(mmDd);
|
|
29
|
+
if (!parts) return 0;
|
|
30
|
+
return parts.month * 100 + parts.day;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function expandMmDdWindow(startMmDd: string, endMmDd: string): MmDdInterval[] {
|
|
34
|
+
const start = mmDdSortKey(startMmDd);
|
|
35
|
+
const end = mmDdSortKey(endMmDd);
|
|
36
|
+
if (start <= end) return [{ start, end }];
|
|
37
|
+
return [
|
|
38
|
+
{ start, end: 1231 },
|
|
39
|
+
{ start: 101, end },
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function linearIntervalsOverlap(a: MmDdInterval, b: MmDdInterval): boolean {
|
|
44
|
+
return a.start <= b.end && b.start <= a.end;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** True when two MM-DD windows share any calendar period. */
|
|
48
|
+
export function mmDdWindowsOverlap(
|
|
49
|
+
startA: string,
|
|
50
|
+
endA: string,
|
|
51
|
+
startB: string,
|
|
52
|
+
endB: string
|
|
53
|
+
): boolean {
|
|
54
|
+
const intervalsA = expandMmDdWindow(startA, endA);
|
|
55
|
+
const intervalsB = expandMmDdWindow(startB, endB);
|
|
56
|
+
for (const ia of intervalsA) {
|
|
57
|
+
for (const ib of intervalsB) {
|
|
58
|
+
if (linearIntervalsOverlap(ia, ib)) return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Whether calendar month (1–12) falls within the inclusive MM-DD window. */
|
|
65
|
+
export function isCalendarMonthInEligibilityRange(
|
|
66
|
+
fromMmDd: string,
|
|
67
|
+
toMmDd: string,
|
|
68
|
+
calendarMonth: number
|
|
69
|
+
): boolean {
|
|
70
|
+
const from = parseMmDdParts(fromMmDd);
|
|
71
|
+
const to = parseMmDdParts(toMmDd);
|
|
72
|
+
if (!from || !to || calendarMonth < 1 || calendarMonth > 12) return false;
|
|
73
|
+
const fm = from.month;
|
|
74
|
+
const tm = to.month;
|
|
75
|
+
if (fm <= tm) return calendarMonth >= fm && calendarMonth <= tm;
|
|
76
|
+
return calendarMonth >= fm || calendarMonth <= tm;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Whether HOD submissions are still open for the active cycle on the reference date.
|
|
81
|
+
* Uses the day component of `evaluationEndMmDd` as the last submission day of each month in range.
|
|
82
|
+
*/
|
|
83
|
+
export function isEvaluationEligibilityWindowOpen(
|
|
84
|
+
fromMmDd: string,
|
|
85
|
+
toMmDd: string,
|
|
86
|
+
evaluationEndMmDd: string,
|
|
87
|
+
referenceDate: Date = new Date()
|
|
88
|
+
): boolean {
|
|
89
|
+
const month = referenceDate.getMonth() + 1;
|
|
90
|
+
const day = referenceDate.getDate();
|
|
91
|
+
if (!isCalendarMonthInEligibilityRange(fromMmDd, toMmDd, month)) return false;
|
|
92
|
+
const endParts = parseMmDdParts(evaluationEndMmDd);
|
|
93
|
+
if (!endParts) return false;
|
|
94
|
+
return day <= endParts.day;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function parseEligibilityDateRange(
|
|
98
|
+
fromInput: unknown,
|
|
99
|
+
toInput: unknown
|
|
100
|
+
): { from_month: string; to_month: string } | null {
|
|
101
|
+
const from_month = parseMonthDay(fromInput);
|
|
102
|
+
const to_month = parseMonthDay(toInput);
|
|
103
|
+
if (!from_month || !to_month) return null;
|
|
104
|
+
return { from_month, to_month };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** @deprecated Use parseMonthDay for MM-DD strings. */
|
|
108
|
+
export function parseEvaluationEndDay(input: unknown): number | null {
|
|
109
|
+
const mmDd = parseMonthDay(input);
|
|
110
|
+
if (!mmDd) return null;
|
|
111
|
+
const parts = parseMmDdParts(mmDd);
|
|
112
|
+
return parts?.day ?? null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** @deprecated Use parseEligibilityDateRange for MM-DD strings. */
|
|
116
|
+
export function parseMonthRange(
|
|
117
|
+
fromInput: unknown,
|
|
118
|
+
toInput: unknown
|
|
119
|
+
): { from_month: number; to_month: number } | null {
|
|
120
|
+
const range = parseEligibilityDateRange(fromInput, toInput);
|
|
121
|
+
if (!range) return null;
|
|
122
|
+
const from = parseMmDdParts(range.from_month);
|
|
123
|
+
const to = parseMmDdParts(range.to_month);
|
|
124
|
+
if (!from || !to) return null;
|
|
125
|
+
return { from_month: from.month, to_month: to.month };
|
|
126
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -463,6 +463,7 @@ export {
|
|
|
463
463
|
normalizeEmployeeDraftSubmissions,
|
|
464
464
|
resolveMaxEmployeesPerRequest,
|
|
465
465
|
persistEmployeeEvaluationScores,
|
|
466
|
+
syncEmployeeEvaluationScores,
|
|
466
467
|
} from './helpers/employee-evaluation-request.utils';
|
|
467
468
|
export type {
|
|
468
469
|
EmployeeEvaluationSubmitAnswer,
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
export enum DiplomaticAcademyStatus {
|
|
5
|
-
SUBMITTED = "Submitted",
|
|
6
|
-
PENDING = "Pending",
|
|
7
|
-
ASSIGNED = "Assigned",
|
|
8
|
-
IN_PROGRESS = "In Progress",
|
|
9
|
-
APPROVED = "Approved",
|
|
10
|
-
REJECTED = "Rejected"
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@Entity({ name: 'diplomatic_academy_requests' })
|
|
14
|
-
export class DiplomaticAcademyRequests extends BaseModel {
|
|
15
|
-
|
|
16
|
-
// Common columns
|
|
17
|
-
@Column({ type: 'int', nullable: true })
|
|
18
|
-
req_user_department_id: number | null;
|
|
19
|
-
|
|
20
|
-
@Column({ type: 'int', nullable: true })
|
|
21
|
-
req_user_section_id: number | null;
|
|
22
|
-
|
|
23
|
-
@Column({ type: 'int', nullable: true })
|
|
24
|
-
service_id: number | null;
|
|
25
|
-
|
|
26
|
-
@Column({ type: 'int', nullable: true })
|
|
27
|
-
sub_service_id: number | null;
|
|
28
|
-
|
|
29
|
-
@Column({ type: 'int', nullable: false })
|
|
30
|
-
user_id: number;
|
|
31
|
-
|
|
32
|
-
// Diplomatic Academy specific columns
|
|
33
|
-
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
34
|
-
course_name: string;
|
|
35
|
-
|
|
36
|
-
@Column({ type: 'jsonb', nullable: true })
|
|
37
|
-
cost_details: {
|
|
38
|
-
material_price?: number;
|
|
39
|
-
transportation?: number;
|
|
40
|
-
accommodation?: number;
|
|
41
|
-
allowances?: number;
|
|
42
|
-
food?: number;
|
|
43
|
-
present?: number;
|
|
44
|
-
} | null;
|
|
45
|
-
|
|
46
|
-
@Column({ type: 'int', nullable: false })
|
|
47
|
-
estimated_participants: number;
|
|
48
|
-
|
|
49
|
-
@Column({ type: 'date', nullable: false })
|
|
50
|
-
timeline_date_from: Date;
|
|
51
|
-
|
|
52
|
-
@Column({ type: 'date', nullable: false })
|
|
53
|
-
timeline_date_to: Date;
|
|
54
|
-
|
|
55
|
-
@Column({ type: 'time', nullable: true })
|
|
56
|
-
timeline_time_from: string | null;
|
|
57
|
-
|
|
58
|
-
@Column({ type: 'time', nullable: true })
|
|
59
|
-
timeline_time_to: string | null;
|
|
60
|
-
|
|
61
|
-
@Column({ type: 'jsonb', nullable: false })
|
|
62
|
-
participants_details: Array<{
|
|
63
|
-
full_name: string;
|
|
64
|
-
passport: string;
|
|
65
|
-
age: number;
|
|
66
|
-
qualifications: string;
|
|
67
|
-
experience: string;
|
|
68
|
-
institution: string;
|
|
69
|
-
}>;
|
|
70
|
-
|
|
71
|
-
@Column({ type: 'enum', enum: DiplomaticAcademyStatus, default: DiplomaticAcademyStatus.PENDING, nullable: false })
|
|
72
|
-
status: DiplomaticAcademyStatus;
|
|
73
|
-
|
|
74
|
-
@Column({ type: 'int', nullable: true })
|
|
75
|
-
course_id: number | null;
|
|
76
|
-
|
|
77
|
-
@Column({ type: 'varchar', nullable: true })
|
|
78
|
-
workflow_execution_id: string | null;
|
|
79
|
-
|
|
80
|
-
}
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum DiplomaticAcademyStatus {
|
|
5
|
+
SUBMITTED = "Submitted",
|
|
6
|
+
PENDING = "Pending",
|
|
7
|
+
ASSIGNED = "Assigned",
|
|
8
|
+
IN_PROGRESS = "In Progress",
|
|
9
|
+
APPROVED = "Approved",
|
|
10
|
+
REJECTED = "Rejected"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Entity({ name: 'diplomatic_academy_requests' })
|
|
14
|
+
export class DiplomaticAcademyRequests extends BaseModel {
|
|
15
|
+
|
|
16
|
+
// Common columns
|
|
17
|
+
@Column({ type: 'int', nullable: true })
|
|
18
|
+
req_user_department_id: number | null;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'int', nullable: true })
|
|
21
|
+
req_user_section_id: number | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'int', nullable: true })
|
|
24
|
+
service_id: number | null;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'int', nullable: true })
|
|
27
|
+
sub_service_id: number | null;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'int', nullable: false })
|
|
30
|
+
user_id: number;
|
|
31
|
+
|
|
32
|
+
// Diplomatic Academy specific columns
|
|
33
|
+
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
34
|
+
course_name: string;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'jsonb', nullable: true })
|
|
37
|
+
cost_details: {
|
|
38
|
+
material_price?: number;
|
|
39
|
+
transportation?: number;
|
|
40
|
+
accommodation?: number;
|
|
41
|
+
allowances?: number;
|
|
42
|
+
food?: number;
|
|
43
|
+
present?: number;
|
|
44
|
+
} | null;
|
|
45
|
+
|
|
46
|
+
@Column({ type: 'int', nullable: false })
|
|
47
|
+
estimated_participants: number;
|
|
48
|
+
|
|
49
|
+
@Column({ type: 'date', nullable: false })
|
|
50
|
+
timeline_date_from: Date;
|
|
51
|
+
|
|
52
|
+
@Column({ type: 'date', nullable: false })
|
|
53
|
+
timeline_date_to: Date;
|
|
54
|
+
|
|
55
|
+
@Column({ type: 'time', nullable: true })
|
|
56
|
+
timeline_time_from: string | null;
|
|
57
|
+
|
|
58
|
+
@Column({ type: 'time', nullable: true })
|
|
59
|
+
timeline_time_to: string | null;
|
|
60
|
+
|
|
61
|
+
@Column({ type: 'jsonb', nullable: false })
|
|
62
|
+
participants_details: Array<{
|
|
63
|
+
full_name: string;
|
|
64
|
+
passport: string;
|
|
65
|
+
age: number;
|
|
66
|
+
qualifications: string;
|
|
67
|
+
experience: string;
|
|
68
|
+
institution: string;
|
|
69
|
+
}>;
|
|
70
|
+
|
|
71
|
+
@Column({ type: 'enum', enum: DiplomaticAcademyStatus, default: DiplomaticAcademyStatus.PENDING, nullable: false })
|
|
72
|
+
status: DiplomaticAcademyStatus;
|
|
73
|
+
|
|
74
|
+
@Column({ type: 'int', nullable: true })
|
|
75
|
+
course_id: number | null;
|
|
76
|
+
|
|
77
|
+
@Column({ type: 'varchar', nullable: true })
|
|
78
|
+
workflow_execution_id: string | null;
|
|
79
|
+
|
|
80
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { Column, Entity } from 'typeorm';
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'documentation_files' })
|
|
5
|
-
export class DocumentationFile extends BaseModel {
|
|
6
|
-
@Column({ type: 'int', nullable: true })
|
|
7
|
-
project_id: number | null;
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'int' })
|
|
10
|
-
folder_id: number;
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'text', nullable: true })
|
|
13
|
-
file_path: string;
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
16
|
-
filename: string;
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'bigint', nullable: true })
|
|
19
|
-
filesize: number;
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
22
|
-
filetype: string;
|
|
23
|
-
|
|
24
|
-
constructor(
|
|
25
|
-
project_id?: number | null,
|
|
26
|
-
folder_id?: number,
|
|
27
|
-
file_path?: string,
|
|
28
|
-
filename?: string,
|
|
29
|
-
filesize?: number,
|
|
30
|
-
filetype?: string
|
|
31
|
-
) {
|
|
32
|
-
super();
|
|
33
|
-
this.project_id = project_id ?? null;
|
|
34
|
-
this.folder_id = folder_id ?? 0;
|
|
35
|
-
this.file_path = file_path ?? '';
|
|
36
|
-
this.filename = filename ?? '';
|
|
37
|
-
this.filesize = filesize ?? 0;
|
|
38
|
-
this.filetype = filetype ?? '';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'documentation_files' })
|
|
5
|
+
export class DocumentationFile extends BaseModel {
|
|
6
|
+
@Column({ type: 'int', nullable: true })
|
|
7
|
+
project_id: number | null;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'int' })
|
|
10
|
+
folder_id: number;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'text', nullable: true })
|
|
13
|
+
file_path: string;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
16
|
+
filename: string;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'bigint', nullable: true })
|
|
19
|
+
filesize: number;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
22
|
+
filetype: string;
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
project_id?: number | null,
|
|
26
|
+
folder_id?: number,
|
|
27
|
+
file_path?: string,
|
|
28
|
+
filename?: string,
|
|
29
|
+
filesize?: number,
|
|
30
|
+
filetype?: string
|
|
31
|
+
) {
|
|
32
|
+
super();
|
|
33
|
+
this.project_id = project_id ?? null;
|
|
34
|
+
this.folder_id = folder_id ?? 0;
|
|
35
|
+
this.file_path = file_path ?? '';
|
|
36
|
+
this.filename = filename ?? '';
|
|
37
|
+
this.filesize = filesize ?? 0;
|
|
38
|
+
this.filetype = filetype ?? '';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
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
|
-
/**
|
|
25
|
-
* Last day submissions are allowed (MM-DD). Closing reminders use this date.
|
|
26
|
-
* When null, `end_date` is used for submission and reminders.
|
|
27
|
-
*/
|
|
28
|
-
@Column({ type: 'varchar', length: 10, nullable: true })
|
|
29
|
-
last_evaluation_date: string | null;
|
|
30
|
-
|
|
31
|
-
@Column({
|
|
32
|
-
type: 'enum',
|
|
33
|
-
enum: EmbassyEvaluationCycleStatus,
|
|
34
|
-
enumName: 'embassy_eval_cycle_status_enum',
|
|
35
|
-
default: EmbassyEvaluationCycleStatus.DRAFT,
|
|
36
|
-
nullable: false,
|
|
37
|
-
})
|
|
38
|
-
status: EmbassyEvaluationCycleStatus;
|
|
39
|
-
|
|
40
|
-
@Column({ type: 'int', nullable: true })
|
|
41
|
-
service_id: number | null;
|
|
42
|
-
|
|
43
|
-
@Column({ type: 'int', nullable: true })
|
|
44
|
-
sub_service_id: number | null;
|
|
45
|
-
}
|
|
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
|
+
/**
|
|
25
|
+
* Last day submissions are allowed (MM-DD). Closing reminders use this date.
|
|
26
|
+
* When null, `end_date` is used for submission and reminders.
|
|
27
|
+
*/
|
|
28
|
+
@Column({ type: 'varchar', length: 10, nullable: true })
|
|
29
|
+
last_evaluation_date: string | null;
|
|
30
|
+
|
|
31
|
+
@Column({
|
|
32
|
+
type: 'enum',
|
|
33
|
+
enum: EmbassyEvaluationCycleStatus,
|
|
34
|
+
enumName: 'embassy_eval_cycle_status_enum',
|
|
35
|
+
default: EmbassyEvaluationCycleStatus.DRAFT,
|
|
36
|
+
nullable: false,
|
|
37
|
+
})
|
|
38
|
+
status: EmbassyEvaluationCycleStatus;
|
|
39
|
+
|
|
40
|
+
@Column({ type: 'int', nullable: true })
|
|
41
|
+
service_id: number | null;
|
|
42
|
+
|
|
43
|
+
@Column({ type: 'int', nullable: true })
|
|
44
|
+
sub_service_id: number | null;
|
|
45
|
+
}
|