@@ -957,13 +957,14 @@ router.get(
957957 )
958958 . where ( 'assessment_requirement_evidence.assessment_requirement_id' , '=' , assessmentReq . id )
959959 . selectAll ( )
960- . execute ( ) ) as any [ ] ;
960+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic query result requires type assertion
961+ . execute ( ) ) as Record < string , unknown > [ ] ;
961962
962- const evidenceIds = evidence . map ( ( e : any ) => e . id ) ;
963+ const evidenceIds = evidence . map ( ( e : Record < string , unknown > ) => e . id as string ) ;
963964 const tagsByEvidence = await fetchTagsForEntities ( db , 'evidence_tag' , 'evidence_id' , evidenceIds ) ;
964- const evidenceWithTags = evidence . map ( ( e : any ) => ( {
965+ const evidenceWithTags = evidence . map ( ( e : Record < string , unknown > ) => ( {
965966 ...e ,
966- tags : tagsByEvidence [ e . id ] || [ ] ,
967+ tags : tagsByEvidence [ e . id as string ] || [ ] ,
967968 } ) ) ;
968969
969970 res . json ( {
@@ -1019,15 +1020,20 @@ router.get(
10191020 'author.display_name as author_name' ,
10201021 'assessment_requirement.requirement_id' ,
10211022 ] as const )
1022- . execute ( ) ) as any [ ] ;
1023+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic query result requires type assertion
1024+ . execute ( ) ) as Record < string , unknown > [ ] ;
10231025
10241026 // Deduplicate evidence (one item can be linked to multiple requirements)
1025- const evidenceMap = new Map < string , any > ( ) ;
1027+ const evidenceMap = new Map < string , Record < string , unknown > > ( ) ;
10261028 for ( const e of evidence ) {
1027- if ( ! evidenceMap . has ( e . id ) ) {
1028- evidenceMap . set ( e . id , { ...e , requirement_ids : [ e . requirement_id ] } ) ;
1029+ const eId = e . id as string ;
1030+ if ( ! evidenceMap . has ( eId ) ) {
1031+ evidenceMap . set ( eId , { ...e , requirement_ids : [ e . requirement_id ] } ) ;
10291032 } else {
1030- evidenceMap . get ( e . id ) . requirement_ids . push ( e . requirement_id ) ;
1033+ const eRecord = evidenceMap . get ( eId ) ;
1034+ if ( eRecord ) {
1035+ ( eRecord . requirement_ids as unknown [ ] ) . push ( e . requirement_id ) ;
1036+ }
10311037 }
10321038 }
10331039 const uniqueEvidence = Array . from ( evidenceMap . values ( ) ) ;
@@ -1088,10 +1094,11 @@ router.get(
10881094 . where ( 'attestation_id' , 'in' , attestationIds )
10891095 . selectAll ( )
10901096 . orderBy ( 'created_at' , 'asc' )
1091- . execute ( ) ) as any [ ] ;
1097+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic query result requires type assertion
1098+ . execute ( ) ) as Record < string , unknown > [ ] ;
10921099
10931100 // For each claim, get evidence counts
1094- const claimIds = claims . map ( c => c . id ) ;
1101+ const claimIds = claims . map ( c => c . id as string ) ;
10951102
10961103 let evidenceCounts = new Map < string , number > ( ) ;
10971104 let counterEvidenceCounts = new Map < string , number > ( ) ;
@@ -1177,17 +1184,19 @@ router.get(
11771184 }
11781185
11791186 const claimsWithCounts = claims . map ( c => {
1180- const targetEntity = c . target_entity_id
1181- ? targetEntityNames . get ( c . target_entity_id )
1187+ const cId = c . id as string ;
1188+ const cTargetEntityId = c . target_entity_id as string | null ;
1189+ const targetEntity = cTargetEntityId
1190+ ? targetEntityNames . get ( cTargetEntityId )
11821191 : null ;
11831192 return {
11841193 ...c ,
11851194 target_entity_name : targetEntity ?. name || null ,
11861195 target_entity_type : targetEntity ?. entity_type || null ,
1187- evidence_count : evidenceCounts . get ( c . id ) || 0 ,
1188- counter_evidence_count : counterEvidenceCounts . get ( c . id ) || 0 ,
1189- mitigation_count : mitigationCounts . get ( c . id ) || 0 ,
1190- external_references : externalRefsByClaimId . get ( c . id ) || [ ] ,
1196+ evidence_count : evidenceCounts . get ( cId ) || 0 ,
1197+ counter_evidence_count : counterEvidenceCounts . get ( cId ) || 0 ,
1198+ mitigation_count : mitigationCounts . get ( cId ) || 0 ,
1199+ external_references : externalRefsByClaimId . get ( cId ) || [ ] ,
11911200 } ;
11921201 } ) ;
11931202
@@ -1230,8 +1239,10 @@ router.get(
12301239 'app_user.display_name' ,
12311240 'app_user.role' ,
12321241 ] )
1233- . execute ( ) ) as any [ ] ;
1242+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic query result requires type assertion
1243+ . execute ( ) ) as Record < string , unknown > [ ] ;
12341244
1245+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic query result requires type assertion
12351246 const assessees = ( await db
12361247 . selectFrom ( 'assessment_assessee' )
12371248 . innerJoin ( 'app_user' , ( join ) =>
@@ -1244,14 +1255,15 @@ router.get(
12441255 'app_user.display_name' ,
12451256 'app_user.role' ,
12461257 ] )
1247- . execute ( ) ) as any [ ] ;
1258+ . execute ( ) ) as Record < string , unknown > [ ] ;
12481259
12491260 // Deduplicate (a user could be both assessor and assessee)
12501261 const seen = new Set < string > ( ) ;
1251- const participants : any [ ] = [ ] ;
1262+ const participants : Record < string , unknown > [ ] = [ ] ;
12521263 for ( const u of [ ...assessors , ...assessees ] ) {
1253- if ( ! seen . has ( u . id ) ) {
1254- seen . add ( u . id ) ;
1264+ const uId = u . id as string ;
1265+ if ( ! seen . has ( uId ) ) {
1266+ seen . add ( uId ) ;
12551267 participants . push ( u ) ;
12561268 }
12571269 }
@@ -1303,7 +1315,8 @@ router.get(
13031315 'app_user.username as author_username' ,
13041316 ] )
13051317 . orderBy ( 'work_note.created_at' , 'desc' )
1306- . execute ( ) ) as any [ ] ;
1318+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic query result requires type assertion
1319+ . execute ( ) ) as Record < string , unknown > [ ] ;
13071320
13081321 res . json ( { data : notes } ) ;
13091322 } catch ( error ) {
0 commit comments