@@ -15,8 +15,11 @@ import * as paymentsService from './services/payments';
1515import * as messagesService from './services/messages' ;
1616import * as chatbotService from './services/chatbot' ;
1717import * as platformStatsService from './services/platformStats' ;
18+ import * as clinicalHoursService from './services/clinicalHours' ;
19+ import * as evaluationsService from './services/evaluations' ;
20+ import * as documentsService from './services/documents' ;
1821
19- // Import Convex compatibility transformers
22+ // Import legacy compatibility transformers
2023import {
2124 toConvexUser ,
2225 toConvexUsers ,
@@ -321,20 +324,70 @@ async function resolveChatbotQuery(supabase: SupabaseClientType, method: string,
321324 }
322325}
323326
324- // Stub resolvers for services not yet implemented
327+ // Service resolvers for Clinical Hours, Evaluations, Documents
325328async function resolveClinicalHoursQuery ( supabase : SupabaseClientType , method : string , args : any ) {
326- console . warn ( `Clinical hours method not yet implemented: ${ method } ` ) ;
327- return method === 'list' || method === 'getByUserId' ? [ ] : null ;
329+ switch ( method ) {
330+ case 'createHoursEntry' :
331+ return clinicalHoursService . createHoursEntry ( supabase , args . userId , args ) ;
332+ case 'updateHoursEntry' :
333+ return clinicalHoursService . updateHoursEntry ( supabase , args . userId , args ) ;
334+ case 'deleteHoursEntry' :
335+ return clinicalHoursService . deleteHoursEntry ( supabase , args . userId , args . entryId ) ;
336+ case 'getStudentHours' :
337+ return clinicalHoursService . getStudentHours ( supabase , args . userId , args ) ;
338+ case 'getStudentHoursSummary' :
339+ return clinicalHoursService . getStudentHoursSummary ( supabase , args . userId ) ;
340+ case 'getWeeklyHoursBreakdown' :
341+ return clinicalHoursService . getWeeklyHoursBreakdown ( supabase , args . userId , args . weeksBack ) ;
342+ case 'getDashboardStats' :
343+ return clinicalHoursService . getDashboardStats ( supabase , args . userId ) ;
344+ case 'exportHours' :
345+ return clinicalHoursService . exportHours ( supabase , args . userId , args ) ;
346+ case 'getRotationAnalytics' :
347+ return clinicalHoursService . getRotationAnalytics ( supabase , args . userId ) ;
348+ default :
349+ throw new Error ( `Unknown clinical hours method: ${ method } ` ) ;
350+ }
328351}
329352
330353async function resolveDocumentsQuery ( supabase : SupabaseClientType , method : string , args : any ) {
331- console . warn ( `Documents method not yet implemented: ${ method } ` ) ;
332- return method === 'list' || method === 'getByUserId' || method === 'getAllDocuments' ? [ ] : null ;
354+ switch ( method ) {
355+ case 'getAllDocuments' :
356+ return documentsService . getAllDocuments ( supabase , args . userId ) ;
357+ case 'getDocumentsByType' :
358+ return documentsService . getDocumentsByType ( supabase , args . userId , args . documentType ) ;
359+ case 'uploadDocument' :
360+ return documentsService . uploadDocument ( supabase , args . userId , args ) ;
361+ case 'deleteDocument' :
362+ return documentsService . deleteDocument ( supabase , args . userId , args . documentId ) ;
363+ case 'getDocumentStats' :
364+ return documentsService . getDocumentStats ( supabase , args . userId ) ;
365+ case 'verifyDocument' :
366+ return documentsService . verifyDocument ( supabase , args ) ;
367+ case 'getExpiringDocuments' :
368+ return documentsService . getExpiringDocuments ( supabase , args . userId , args . daysAhead ) ;
369+ default :
370+ throw new Error ( `Unknown documents method: ${ method } ` ) ;
371+ }
333372}
334373
335374async function resolveEvaluationsQuery ( supabase : SupabaseClientType , method : string , args : any ) {
336- console . warn ( `Evaluations method not yet implemented: ${ method } ` ) ;
337- return method === 'list' || method === 'getByUserId' ? [ ] : null ;
375+ switch ( method ) {
376+ case 'getPreceptorEvaluations' :
377+ return evaluationsService . getPreceptorEvaluations ( supabase , args . userId ) ;
378+ case 'getStudentEvaluations' :
379+ return evaluationsService . getStudentEvaluations ( supabase , args . userId ) ;
380+ case 'getEvaluationStats' :
381+ return evaluationsService . getEvaluationStats ( supabase , args . userId ) ;
382+ case 'createEvaluation' :
383+ return evaluationsService . createEvaluation ( supabase , args . userId , args ) ;
384+ case 'completeEvaluation' :
385+ return evaluationsService . completeEvaluation ( supabase , args . userId , args ) ;
386+ case 'deleteEvaluation' :
387+ return evaluationsService . deleteEvaluation ( supabase , args . userId , args . evaluationId ) ;
388+ default :
389+ throw new Error ( `Unknown evaluations method: ${ method } ` ) ;
390+ }
338391}
339392
340393async function resolveAdminQuery ( supabase : SupabaseClientType , method : string , args : any ) {
0 commit comments