@@ -27,22 +27,11 @@ type MemberDailyActivity = {
2727 } ;
2828} ;
2929
30- interface ActivityTotalDocument {
31- org : string ;
32- date : Date ;
33- assignee : mongoose . Types . ObjectId ;
34- assignee_id : number ;
35- assignee_login : string ;
36- total_active_time_ms ?: number ;
37- last_activity_at ?: Date ;
38- last_activity_editor ?: string ;
39- }
40-
4130interface MemberDocument {
4231 _id : mongoose . Types . ObjectId ;
4332 id : number ;
4433 login : string ;
45- [ key : string ] : any ; // For other properties
34+ // [key: string]: any; // For other properties
4635}
4736
4837class SeatsService {
@@ -129,7 +118,7 @@ class SeatsService {
129118 }
130119
131120 // Build query with date range filtering if provided
132- const query : mongoose . FilterQuery < any > = {
121+ const query : mongoose . FilterQuery < SeatType > = {
133122 assignee : member . _id
134123 } ;
135124
@@ -184,7 +173,7 @@ class SeatsService {
184173
185174 if ( ! member ) {
186175 // Try case-insensitive search as a fallback
187- const regex = new RegExp ( `^${ identifierString . replace ( / [ - \ /\\ ^ $ * + ? . ( ) | [ \] { } ] / g, '\\$&' ) } $` , 'i' ) ;
176+ const regex = new RegExp ( `^${ identifierString . replace ( / [ - / \\ ^ $ * + ? . ( ) | [ \] { } ] / g, '\\$&' ) } $` , 'i' ) ;
188177 const memberCaseInsensitive = await Member . findOne ( {
189178 login : regex
190179 } ) . lean ( ) as MemberDocument | null ;
@@ -203,22 +192,17 @@ class SeatsService {
203192 // Now TypeScript knows member has these properties
204193 numericId = member . id ;
205194 }
206- } catch ( memberLookupError : unknown ) {
207- // Properly type the error
195+ } catch {
208196 return [ ] ; // Return empty array on error
209197 }
210198 } else {
211199 numericId = Number ( identifier ) ;
212- //console.log(`Using numeric ID directly: ${numericId}`);
213200 }
214201
215- // Build query
216- const query : Record < string , any > = { assignee_id : numericId } ;
202+ const query : mongoose . FilterQuery < SeatType > = { assignee_id : numericId } ;
217203
218- // Add filters
219204 if ( params . org ) {
220205 query . org = params . org ;
221- // console.log(`Added org filter: ${params.org}`);
222206 }
223207
224208 if ( params . since || params . until ) {
0 commit comments