@platform-modules/foreign-ministry 1.3.350 → 1.3.351

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 (81) hide show
  1. package/.env +4 -4
  2. package/dist/auth/authenticate-jwt-session.d.ts +19 -0
  3. package/dist/auth/authenticate-jwt-session.js +35 -0
  4. package/dist/auth/jwt-token.helper.d.ts +18 -0
  5. package/dist/auth/jwt-token.helper.js +58 -0
  6. package/dist/auth/user-session-validation.d.ts +42 -0
  7. package/dist/auth/user-session-validation.js +95 -0
  8. package/dist/data-source.js +2 -0
  9. package/dist/i18n/workflow-chat-i18n.d.ts +5 -0
  10. package/dist/i18n/workflow-chat-i18n.js +21 -0
  11. package/dist/i18n/workflow-chat-i18n.json +320 -0
  12. package/dist/i18n/workflow-chat-message.builder.d.ts +325 -0
  13. package/dist/i18n/workflow-chat-message.builder.js +924 -0
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.js +1 -0
  16. package/dist/models/ChatbotQnsAnsMappingModel.d.ts +8 -0
  17. package/dist/models/ChatbotQnsAnsMappingModel.js +40 -0
  18. package/dist/models/SlaApprovalsViewModel.js +54 -47
  19. package/dist/models/SlaMyRequestsViewModel.js +52 -52
  20. package/package.json +1 -1
  21. package/scripts/check-column-types.js +38 -38
  22. package/scripts/check-service-tables.js +42 -42
  23. package/scripts/sync-sla-reports-sql.js +92 -92
  24. package/sql/create_chatbot_qns_ans_mapping.sql +25 -0
  25. package/sql/sla-reports-sync.manifest.json +9 -9
  26. package/sql/sla_reports_admin_procedures.sql +322 -304
  27. package/sql/sla_reports_approvals_workbook.sql +430 -383
  28. package/sql/sla_reports_procedures.sql +886 -886
  29. package/sql/sla_requests_status_to_varchar.sql +28 -28
  30. package/sql/vw_sla_approvals.sql +115 -108
  31. package/sql/vw_sla_my_requests.sql +55 -55
  32. package/src/data-source.ts +688 -686
  33. package/src/helpers/evaluation-eligibility.utils.ts +126 -126
  34. package/src/index.ts +1 -0
  35. package/src/models/ChatbotQnsAnsMappingModel.ts +21 -0
  36. package/src/models/DiplomaticAcademyRequestModel.ts +80 -80
  37. package/src/models/DocumentationFileModel.ts +40 -40
  38. package/src/models/EmbassyEvaluationCycleModel.ts +45 -45
  39. package/src/models/EmbassyEvaluationRequestModel.ts +59 -59
  40. package/src/models/EmployeeEvaluationAnswerModel.ts +26 -26
  41. package/src/models/EvaluationEligibilitySettingModel.ts +51 -51
  42. package/src/models/EvaluationFormModel.ts +44 -44
  43. package/src/models/LanguageCourseRequestModel.ts +67 -67
  44. package/src/models/LeaveApprovalsModel.ts +66 -66
  45. package/src/models/LeaveConfigModel.ts +71 -71
  46. package/src/models/MissionTravelApprovalModel.ts +101 -101
  47. package/src/models/MissionTravelAttachmentModel.ts +56 -56
  48. package/src/models/MissionTravelChatModel.ts +52 -52
  49. package/src/models/MissionTravelPersonModel.ts +105 -105
  50. package/src/models/MissionTravelWorkflowModel.ts +54 -54
  51. package/src/models/ProjectContactsModel.ts +51 -51
  52. package/src/models/ProjectFaqModel.ts +36 -36
  53. package/src/models/ProjectInvoicesModel.ts +41 -41
  54. package/src/models/ProjectModel.ts +75 -75
  55. package/src/models/ProjectTasksModel.ts +75 -75
  56. package/src/models/ServiceSlaApprovalModel.ts +63 -63
  57. package/src/models/ServicesNotificationConfigsModel.ts +55 -55
  58. package/src/models/SlaApprovalsViewModel.ts +142 -135
  59. package/src/models/SlaMyRequestsViewModel.ts +172 -172
  60. package/src/models/SlaRequestModel.ts +57 -57
  61. package/src/sla-report-views.ts +3 -3
  62. package/dist/helpers/sla-request-status.helper.d.ts +0 -3
  63. package/dist/helpers/sla-request-status.helper.js +0 -36
  64. package/dist/models/EmbassyEvaluationDepartmentSettingModel.d.ts +0 -14
  65. package/dist/models/EmbassyEvaluationDepartmentSettingModel.js +0 -56
  66. package/dist/models/EvaluationMastersModel.d.ts +0 -16
  67. package/dist/models/EvaluationMastersModel.js +0 -67
  68. package/dist/models/EvaluationQuestionMasterModel.d.ts +0 -10
  69. package/dist/models/EvaluationQuestionMasterModel.js +0 -42
  70. package/dist/models/EvaluationSectionMasterModel.d.ts +0 -7
  71. package/dist/models/EvaluationSectionMasterModel.js +0 -36
  72. package/dist/models/EvaluationWorkflowModel.d.ts +0 -60
  73. package/dist/models/EvaluationWorkflowModel.js +0 -215
  74. package/dist/models/IneligibleForEvaluationModel.d.ts +0 -8
  75. package/dist/models/IneligibleForEvaluationModel.js +0 -44
  76. package/dist/models/MissionTravelClassConfigModel.d.ts +0 -10
  77. package/dist/models/MissionTravelClassConfigModel.js +0 -50
  78. package/dist/models/MissionTravelPerdiemModel.d.ts +0 -10
  79. package/dist/models/MissionTravelPerdiemModel.js +0 -54
  80. package/dist/models/UuidAuditModel.d.ts +0 -9
  81. package/dist/models/UuidAuditModel.js +0 -41
@@ -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
@@ -98,6 +98,7 @@ export * from './models/UpdateAttendanceWorkflowModel';
98
98
  export * from './models/SlaRequestModel';
99
99
  export * from './models/ServiceSlaApprovalModel';
100
100
  export * from './models/SlaConfigModel';
101
+ export * from './models/ChatbotQnsAnsMappingModel';
101
102
  export * from './models/GeneralServiceRequestsModel';
102
103
  export * from './models/GeneralServiceApprovalsModel';
103
104
  export * from './models/GeneralServiceWorkFlowModel';
@@ -0,0 +1,21 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ @Entity({ name: "chatbot_qns_ans_mapping" })
5
+ export class ChatbotQnsAnsMapping extends BaseModel {
6
+ @Column({ type: "int", nullable: false })
7
+ service_id: number;
8
+
9
+ @Column({ type: "int", nullable: false })
10
+ sub_service_id: number;
11
+
12
+ @Column({ type: "jsonb", nullable: false })
13
+ question: Record<string, unknown> | unknown[];
14
+
15
+ @Column({ type: "jsonb", nullable: false })
16
+ answer: Record<string, unknown> | unknown[];
17
+
18
+ constructor() {
19
+ super();
20
+ }
21
+ }
@@ -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
+ }