build issues resolved

This commit is contained in:
laxmanhalaki 2026-05-21 22:40:15 +05:30
parent c9c03f8761
commit 061dc8e260
9 changed files with 31 additions and 26 deletions

View File

@ -222,7 +222,7 @@ export const getAllUsers = async (req: Request, res: Response) => {
ROLES.CCO,
ROLES.CEO
];
const isNationalRole = finalRoleCodes.some(r => nationalRoles.includes(r));
const isNationalRole = finalRoleCodes.some(r => (nationalRoles as readonly string[]).includes(r));
if (!isNationalRole && locationId) {
const district: any = await db.District.findByPk(locationId as string, {

View File

@ -1,5 +1,5 @@
import { Request, Response } from 'express';
import db from '../../database/models';
import db from '../../database/models/index.js';
import jwt from 'jsonwebtoken';
// Mock secret for now, should be in env

View File

@ -839,11 +839,11 @@ const applyConstitutionalDocumentDecision = async (
...currentDocuments[documentIndex],
status: targetStatus,
verifiedOn: new Date().toISOString(),
verifiedBy: req.user.fullName || req.user.name || 'System',
verifiedBy: req.user.fullName || 'System',
...(targetStatus === 'Rejected'
? {
rejectedOn: new Date().toISOString(),
rejectedBy: req.user.fullName || req.user.name || 'System',
rejectedBy: req.user.fullName || 'System',
rejectionReason: String(remarks).trim(),
rejectionRemarks: String(remarks).trim()
}
@ -856,7 +856,7 @@ const applyConstitutionalDocumentDecision = async (
{
stage: request.currentStage,
timestamp: new Date(),
user: req.user.fullName || req.user.name || 'System',
user: req.user.fullName || 'System',
action: actionText,
remarks:
targetStatus === 'Verified'

View File

@ -486,7 +486,7 @@ export const getRequests = async (req: AuthRequest, res: Response) => {
ROLES.CCO,
ROLES.CEO
];
if (userRoleCode && nationalRoles.includes(userRoleCode)) {
if (userRoleCode && (nationalRoles as readonly string[]).includes(userRoleCode)) {
return true;
}

View File

@ -374,7 +374,8 @@ export const getFnFSettlements = async (req: Request, res: Response) => {
export const getFnFById = async (req: Request, res: Response) => {
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
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) => {
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 { status, remarks, documentId, supportingDocument, amount, type } = body;
const clearance = await FffClearance.findOne({ where: { id: clearanceId, fnfId: id } });

View File

@ -561,7 +561,7 @@ export const updateTerminationStatus = async (req: AuthRequest, res: Response, n
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));
if (!isComplete) {
@ -629,7 +629,7 @@ export const updateTerminationStatus = async (req: AuthRequest, res: Response, n
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));
if (!isComplete) {

View File

@ -62,7 +62,7 @@ export async function getAllAutoAssignmentStatuses(): Promise<Record<AutoAssignm
const configMap = new Map(configs.map((c: any) => [c.key, c.value]));
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;
}
} catch (error) {

View File

@ -28,11 +28,13 @@
]
},
"include": [
"**/*.ts"
"src/**/*.ts"
],
"exclude": [
"node_modules",
"dist",
"tests"
"tests",
"src/__tests__",
"src/diag_*.ts"
]
}