@platform-modules/foreign-ministry 1.3.355 → 1.3.359
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/auth/authenticate-jwt-session.d.ts +19 -0
- package/dist/auth/authenticate-jwt-session.js +35 -0
- package/dist/auth/jwt-token.helper.d.ts +18 -0
- package/dist/auth/jwt-token.helper.js +58 -0
- package/dist/auth/user-session-validation.d.ts +42 -0
- package/dist/auth/user-session-validation.js +95 -0
- package/dist/helpers/employee-evaluation-request.utils.d.ts +12 -0
- package/dist/helpers/employee-evaluation-request.utils.js +85 -0
- package/dist/i18n/workflow-chat-i18n.d.ts +5 -0
- package/dist/i18n/workflow-chat-i18n.js +21 -0
- package/dist/i18n/workflow-chat-i18n.json +320 -0
- package/dist/i18n/workflow-chat-message.builder.d.ts +325 -0
- package/dist/i18n/workflow-chat-message.builder.js +924 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -3
- package/dist/models/InitiatorEmployeeNominationRequestModel.d.ts +2 -1
- package/dist/models/InitiatorEmployeeNominationRequestModel.js +3 -3
- package/dist/models/ProjectTasksModel.d.ts +1 -1
- package/dist/models/ProjectTasksModel.js +1 -1
- package/dist/models/SlaApprovalsViewModel.js +54 -54
- package/dist/models/SlaMyRequestsViewModel.js +57 -57
- 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/initiator_employee_nomination_initiator_id.sql +12 -0
- 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 -60
- 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/InitiatorEmployeeNominationRequestModel.ts +3 -2
- 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 -192
- package/src/models/SlaRequestModel.ts +57 -57
- package/src/sla-report-views.ts +3 -3
- package/dist/helpers/sla-request-status.helper.d.ts +0 -3
- package/dist/helpers/sla-request-status.helper.js +0 -36
- package/dist/models/EmbassyEvaluationDepartmentSettingModel.d.ts +0 -14
- package/dist/models/EmbassyEvaluationDepartmentSettingModel.js +0 -56
- package/dist/models/EvaluationMastersModel.d.ts +0 -16
- package/dist/models/EvaluationMastersModel.js +0 -67
- package/dist/models/EvaluationQuestionMasterModel.d.ts +0 -10
- package/dist/models/EvaluationQuestionMasterModel.js +0 -42
- package/dist/models/EvaluationSectionMasterModel.d.ts +0 -7
- package/dist/models/EvaluationSectionMasterModel.js +0 -36
- package/dist/models/EvaluationWorkflowModel.d.ts +0 -60
- package/dist/models/EvaluationWorkflowModel.js +0 -215
- package/dist/models/IneligibleForEvaluationModel.d.ts +0 -8
- package/dist/models/IneligibleForEvaluationModel.js +0 -44
- package/dist/models/MissionTravelClassConfigModel.d.ts +0 -10
- package/dist/models/MissionTravelClassConfigModel.js +0 -50
- package/dist/models/MissionTravelPerdiemModel.d.ts +0 -10
- package/dist/models/MissionTravelPerdiemModel.js +0 -54
- package/dist/models/UuidAuditModel.d.ts +0 -9
- package/dist/models/UuidAuditModel.js +0 -41
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Applies SLA report views + stored procedures to PostgreSQL (idempotent CREATE OR REPLACE).
|
|
3
|
-
*
|
|
4
|
-
* Env from shared_models/.env only:
|
|
5
|
-
* DB_HOST / TYPEORM_HOST
|
|
6
|
-
* DB_PORT / TYPEORM_PORT
|
|
7
|
-
* DB_USER / TYPEORM_USERNAME
|
|
8
|
-
* DB_PASS / TYPEORM_PASSWORD
|
|
9
|
-
* DB_NAME / TYPEORM_DATABASE
|
|
10
|
-
*
|
|
11
|
-
* Usage:
|
|
12
|
-
* node scripts/sync-sla-reports-sql.js
|
|
13
|
-
* npm run sync:sla-sql (from shared_models)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const fs = require('fs');
|
|
17
|
-
const path = require('path');
|
|
18
|
-
const { Client } = require('pg');
|
|
19
|
-
|
|
20
|
-
function loadEnvFiles() {
|
|
21
|
-
const dotenv = require('dotenv');
|
|
22
|
-
const packageRoot = path.resolve(__dirname, '..');
|
|
23
|
-
const packageEnv = path.join(packageRoot, '.env');
|
|
24
|
-
|
|
25
|
-
if (!fs.existsSync(packageEnv)) {
|
|
26
|
-
throw new Error(`Missing env file: ${packageEnv}`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
dotenv.config({ path: packageEnv, override: true });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function getDbConfig() {
|
|
33
|
-
const host = (process.env.DB_HOST || process.env.TYPEORM_HOST || '').trim();
|
|
34
|
-
const port = parseInt(process.env.DB_PORT || process.env.TYPEORM_PORT || '5432', 10);
|
|
35
|
-
const user = (process.env.DB_USER || process.env.TYPEORM_USERNAME || '').trim();
|
|
36
|
-
const password = process.env.DB_PASS || process.env.TYPEORM_PASSWORD || '';
|
|
37
|
-
const database = (process.env.DB_NAME || process.env.TYPEORM_DATABASE || '').trim();
|
|
38
|
-
|
|
39
|
-
if (!host || !user || !database) {
|
|
40
|
-
throw new Error(
|
|
41
|
-
'Missing DB config. Set DB_HOST, DB_USER, DB_NAME (and DB_PASS) in shared_models/.env'
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return { host, port, user, password, database };
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async function main() {
|
|
49
|
-
const skipSync = process.argv.includes('--skip');
|
|
50
|
-
if (skipSync || process.env.SKIP_SLA_SQL_SYNC === 'true') {
|
|
51
|
-
console.log('[sync-sla-reports-sql] skipped (SKIP_SLA_SQL_SYNC or --skip)');
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
loadEnvFiles();
|
|
56
|
-
const config = getDbConfig();
|
|
57
|
-
const sqlDir = path.join(__dirname, '..', 'sql');
|
|
58
|
-
const manifestPath = path.join(sqlDir, 'sla-reports-sync.manifest.json');
|
|
59
|
-
|
|
60
|
-
if (!fs.existsSync(manifestPath)) {
|
|
61
|
-
throw new Error(`Manifest not found: ${manifestPath}`);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const files = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
65
|
-
if (!Array.isArray(files) || files.length === 0) {
|
|
66
|
-
throw new Error('sla-reports-sync.manifest.json must be a non-empty array');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const client = new Client(config);
|
|
70
|
-
await client.connect();
|
|
71
|
-
console.log(`[sync-sla-reports-sql] connected to ${config.host}/${config.database}`);
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
for (const file of files) {
|
|
75
|
-
const filePath = path.join(sqlDir, file);
|
|
76
|
-
if (!fs.existsSync(filePath)) {
|
|
77
|
-
throw new Error(`SQL file missing: ${filePath}`);
|
|
78
|
-
}
|
|
79
|
-
const sql = fs.readFileSync(filePath, 'utf8');
|
|
80
|
-
await client.query(sql);
|
|
81
|
-
console.log(`[sync-sla-reports-sql] applied ${file}`);
|
|
82
|
-
}
|
|
83
|
-
console.log('[sync-sla-reports-sql] done');
|
|
84
|
-
} finally {
|
|
85
|
-
await client.end();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
main().catch((err) => {
|
|
90
|
-
console.error('[sync-sla-reports-sql] failed:', err.message);
|
|
91
|
-
process.exit(1);
|
|
92
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* Applies SLA report views + stored procedures to PostgreSQL (idempotent CREATE OR REPLACE).
|
|
3
|
+
*
|
|
4
|
+
* Env from shared_models/.env only:
|
|
5
|
+
* DB_HOST / TYPEORM_HOST
|
|
6
|
+
* DB_PORT / TYPEORM_PORT
|
|
7
|
+
* DB_USER / TYPEORM_USERNAME
|
|
8
|
+
* DB_PASS / TYPEORM_PASSWORD
|
|
9
|
+
* DB_NAME / TYPEORM_DATABASE
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* node scripts/sync-sla-reports-sql.js
|
|
13
|
+
* npm run sync:sla-sql (from shared_models)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const { Client } = require('pg');
|
|
19
|
+
|
|
20
|
+
function loadEnvFiles() {
|
|
21
|
+
const dotenv = require('dotenv');
|
|
22
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
23
|
+
const packageEnv = path.join(packageRoot, '.env');
|
|
24
|
+
|
|
25
|
+
if (!fs.existsSync(packageEnv)) {
|
|
26
|
+
throw new Error(`Missing env file: ${packageEnv}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
dotenv.config({ path: packageEnv, override: true });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getDbConfig() {
|
|
33
|
+
const host = (process.env.DB_HOST || process.env.TYPEORM_HOST || '').trim();
|
|
34
|
+
const port = parseInt(process.env.DB_PORT || process.env.TYPEORM_PORT || '5432', 10);
|
|
35
|
+
const user = (process.env.DB_USER || process.env.TYPEORM_USERNAME || '').trim();
|
|
36
|
+
const password = process.env.DB_PASS || process.env.TYPEORM_PASSWORD || '';
|
|
37
|
+
const database = (process.env.DB_NAME || process.env.TYPEORM_DATABASE || '').trim();
|
|
38
|
+
|
|
39
|
+
if (!host || !user || !database) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
'Missing DB config. Set DB_HOST, DB_USER, DB_NAME (and DB_PASS) in shared_models/.env'
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return { host, port, user, password, database };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function main() {
|
|
49
|
+
const skipSync = process.argv.includes('--skip');
|
|
50
|
+
if (skipSync || process.env.SKIP_SLA_SQL_SYNC === 'true') {
|
|
51
|
+
console.log('[sync-sla-reports-sql] skipped (SKIP_SLA_SQL_SYNC or --skip)');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
loadEnvFiles();
|
|
56
|
+
const config = getDbConfig();
|
|
57
|
+
const sqlDir = path.join(__dirname, '..', 'sql');
|
|
58
|
+
const manifestPath = path.join(sqlDir, 'sla-reports-sync.manifest.json');
|
|
59
|
+
|
|
60
|
+
if (!fs.existsSync(manifestPath)) {
|
|
61
|
+
throw new Error(`Manifest not found: ${manifestPath}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const files = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
65
|
+
if (!Array.isArray(files) || files.length === 0) {
|
|
66
|
+
throw new Error('sla-reports-sync.manifest.json must be a non-empty array');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const client = new Client(config);
|
|
70
|
+
await client.connect();
|
|
71
|
+
console.log(`[sync-sla-reports-sql] connected to ${config.host}/${config.database}`);
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
for (const file of files) {
|
|
75
|
+
const filePath = path.join(sqlDir, file);
|
|
76
|
+
if (!fs.existsSync(filePath)) {
|
|
77
|
+
throw new Error(`SQL file missing: ${filePath}`);
|
|
78
|
+
}
|
|
79
|
+
const sql = fs.readFileSync(filePath, 'utf8');
|
|
80
|
+
await client.query(sql);
|
|
81
|
+
console.log(`[sync-sla-reports-sql] applied ${file}`);
|
|
82
|
+
}
|
|
83
|
+
console.log('[sync-sla-reports-sql] done');
|
|
84
|
+
} finally {
|
|
85
|
+
await client.end();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
main().catch((err) => {
|
|
90
|
+
console.error('[sync-sla-reports-sql] failed:', err.message);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- Replace job_number with initiator_id (users.id) on initiator employee nomination requests.
|
|
2
|
+
ALTER TABLE initiator_employee_nomination_requests
|
|
3
|
+
ADD COLUMN IF NOT EXISTS initiator_id INT;
|
|
4
|
+
|
|
5
|
+
UPDATE initiator_employee_nomination_requests
|
|
6
|
+
SET initiator_id = NULLIF(regexp_replace(COALESCE(job_number, ''), '\D', '', 'g'), '')::INT
|
|
7
|
+
WHERE initiator_id IS NULL
|
|
8
|
+
AND job_number IS NOT NULL
|
|
9
|
+
AND job_number ~ '^\d+$';
|
|
10
|
+
|
|
11
|
+
ALTER TABLE initiator_employee_nomination_requests
|
|
12
|
+
DROP COLUMN IF EXISTS job_number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
[
|
|
2
|
-
"sla_requests_status_to_varchar.sql",
|
|
3
|
-
"sla_requests_status_data_fix.sql",
|
|
4
|
-
"vw_sla_my_requests.sql",
|
|
5
|
-
"vw_sla_approvals.sql",
|
|
6
|
-
"sla_reports_procedures.sql",
|
|
7
|
-
"sla_reports_approvals_workbook.sql",
|
|
8
|
-
"sla_reports_admin_procedures.sql"
|
|
9
|
-
]
|
|
1
|
+
[
|
|
2
|
+
"sla_requests_status_to_varchar.sql",
|
|
3
|
+
"sla_requests_status_data_fix.sql",
|
|
4
|
+
"vw_sla_my_requests.sql",
|
|
5
|
+
"vw_sla_approvals.sql",
|
|
6
|
+
"sla_reports_procedures.sql",
|
|
7
|
+
"sla_reports_approvals_workbook.sql",
|
|
8
|
+
"sla_reports_admin_procedures.sql"
|
|
9
|
+
]
|