build issues resolved
This commit is contained in:
parent
c9c03f8761
commit
061dc8e260
@ -1,14 +1,14 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Royal Enfield Onboarding</title>
|
<title>Royal Enfield Onboarding</title>
|
||||||
<script type="module" crossorigin src="/assets/index-ny6fNePT.js"></script>
|
<script type="module" crossorigin src="/assets/index-ny6fNePT.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index--4WsqmvE.css">
|
<link rel="stylesheet" crossorigin href="/assets/index--4WsqmvE.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -222,7 +222,7 @@ export const getAllUsers = async (req: Request, res: Response) => {
|
|||||||
ROLES.CCO,
|
ROLES.CCO,
|
||||||
ROLES.CEO
|
ROLES.CEO
|
||||||
];
|
];
|
||||||
const isNationalRole = finalRoleCodes.some(r => nationalRoles.includes(r));
|
const isNationalRole = finalRoleCodes.some(r => (nationalRoles as readonly string[]).includes(r));
|
||||||
|
|
||||||
if (!isNationalRole && locationId) {
|
if (!isNationalRole && locationId) {
|
||||||
const district: any = await db.District.findByPk(locationId as string, {
|
const district: any = await db.District.findByPk(locationId as string, {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import db from '../../database/models';
|
import db from '../../database/models/index.js';
|
||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
|
|
||||||
// Mock secret for now, should be in env
|
// Mock secret for now, should be in env
|
||||||
|
|||||||
@ -839,11 +839,11 @@ const applyConstitutionalDocumentDecision = async (
|
|||||||
...currentDocuments[documentIndex],
|
...currentDocuments[documentIndex],
|
||||||
status: targetStatus,
|
status: targetStatus,
|
||||||
verifiedOn: new Date().toISOString(),
|
verifiedOn: new Date().toISOString(),
|
||||||
verifiedBy: req.user.fullName || req.user.name || 'System',
|
verifiedBy: req.user.fullName || 'System',
|
||||||
...(targetStatus === 'Rejected'
|
...(targetStatus === 'Rejected'
|
||||||
? {
|
? {
|
||||||
rejectedOn: new Date().toISOString(),
|
rejectedOn: new Date().toISOString(),
|
||||||
rejectedBy: req.user.fullName || req.user.name || 'System',
|
rejectedBy: req.user.fullName || 'System',
|
||||||
rejectionReason: String(remarks).trim(),
|
rejectionReason: String(remarks).trim(),
|
||||||
rejectionRemarks: String(remarks).trim()
|
rejectionRemarks: String(remarks).trim()
|
||||||
}
|
}
|
||||||
@ -856,7 +856,7 @@ const applyConstitutionalDocumentDecision = async (
|
|||||||
{
|
{
|
||||||
stage: request.currentStage,
|
stage: request.currentStage,
|
||||||
timestamp: new Date(),
|
timestamp: new Date(),
|
||||||
user: req.user.fullName || req.user.name || 'System',
|
user: req.user.fullName || 'System',
|
||||||
action: actionText,
|
action: actionText,
|
||||||
remarks:
|
remarks:
|
||||||
targetStatus === 'Verified'
|
targetStatus === 'Verified'
|
||||||
|
|||||||
@ -486,7 +486,7 @@ export const getRequests = async (req: AuthRequest, res: Response) => {
|
|||||||
ROLES.CCO,
|
ROLES.CCO,
|
||||||
ROLES.CEO
|
ROLES.CEO
|
||||||
];
|
];
|
||||||
if (userRoleCode && nationalRoles.includes(userRoleCode)) {
|
if (userRoleCode && (nationalRoles as readonly string[]).includes(userRoleCode)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -374,8 +374,9 @@ export const getFnFSettlements = async (req: Request, res: Response) => {
|
|||||||
|
|
||||||
export const getFnFById = async (req: Request, res: Response) => {
|
export const getFnFById = async (req: Request, res: Response) => {
|
||||||
try {
|
try {
|
||||||
const { id } = req.params;
|
const rawId = req.params.id;
|
||||||
|
const id = Array.isArray(rawId) ? rawId[0] : rawId;
|
||||||
|
|
||||||
// Resolve UUID if human-readable ID (FNF-*) is passed
|
// Resolve UUID if human-readable ID (FNF-*) is passed
|
||||||
const { resolvedId } = await resolveEntityUuidByType(db as any, id, 'fnf');
|
const { resolvedId } = await resolveEntityUuidByType(db as any, id, 'fnf');
|
||||||
|
|
||||||
@ -700,7 +701,9 @@ const calculateFnFLogic = async (id: string, userId: string | null = null) => {
|
|||||||
|
|
||||||
export const updateClearance = async (req: AuthRequest, res: Response) => {
|
export const updateClearance = async (req: AuthRequest, res: Response) => {
|
||||||
try {
|
try {
|
||||||
const { id, clearanceId } = req.params;
|
const rawId = req.params.id;
|
||||||
|
const id = Array.isArray(rawId) ? rawId[0] : rawId;
|
||||||
|
const { clearanceId } = req.params;
|
||||||
const body = (req.body || {}) as Record<string, any>;
|
const body = (req.body || {}) as Record<string, any>;
|
||||||
const { status, remarks, documentId, supportingDocument, amount, type } = body;
|
const { status, remarks, documentId, supportingDocument, amount, type } = body;
|
||||||
const clearance = await FffClearance.findOne({ where: { id: clearanceId, fnfId: id } });
|
const clearance = await FffClearance.findOne({ where: { id: clearanceId, fnfId: id } });
|
||||||
|
|||||||
@ -561,7 +561,7 @@ export const updateTerminationStatus = async (req: AuthRequest, res: Response, n
|
|||||||
transaction
|
transaction
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvedRoles = partialLogs.map(log => (log as any).details?.roleCode);
|
const approvedRoles = partialLogs.map((log: { details?: { roleCode?: string } }) => log.details?.roleCode);
|
||||||
const isComplete = requiredRoles.every(role => approvedRoles.includes(role));
|
const isComplete = requiredRoles.every(role => approvedRoles.includes(role));
|
||||||
|
|
||||||
if (!isComplete) {
|
if (!isComplete) {
|
||||||
@ -629,7 +629,7 @@ export const updateTerminationStatus = async (req: AuthRequest, res: Response, n
|
|||||||
transaction
|
transaction
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvedRoles = partialLogs.map(log => (log as any).details?.roleCode);
|
const approvedRoles = partialLogs.map((log: { details?: { roleCode?: string } }) => log.details?.roleCode);
|
||||||
const isComplete = requiredRoles.every(role => approvedRoles.includes(role));
|
const isComplete = requiredRoles.every(role => approvedRoles.includes(role));
|
||||||
|
|
||||||
if (!isComplete) {
|
if (!isComplete) {
|
||||||
|
|||||||
@ -62,7 +62,7 @@ export async function getAllAutoAssignmentStatuses(): Promise<Record<AutoAssignm
|
|||||||
const configMap = new Map(configs.map((c: any) => [c.key, c.value]));
|
const configMap = new Map(configs.map((c: any) => [c.key, c.value]));
|
||||||
|
|
||||||
for (const [module, key] of Object.entries(MODULE_CONFIG_KEYS)) {
|
for (const [module, key] of Object.entries(MODULE_CONFIG_KEYS)) {
|
||||||
const value = configMap.get(key) || {};
|
const value = (configMap.get(key) || {}) as { enabled?: boolean };
|
||||||
result[module] = typeof value.enabled === 'boolean' ? value.enabled : true;
|
result[module] = typeof value.enabled === 'boolean' ? value.enabled : true;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -28,11 +28,13 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts"
|
"src/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"dist",
|
"dist",
|
||||||
"tests"
|
"tests",
|
||||||
|
"src/__tests__",
|
||||||
|
"src/diag_*.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user