File tree Expand file tree Collapse file tree 8 files changed +865
-3
lines changed
components/admin/userProfile Expand file tree Collapse file tree 8 files changed +865
-3
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * API Client for match endpoints
3+ */
4+
5+ import baseAPIClient from './baseAPIClient' ;
6+
7+ export interface MatchCreateRequest {
8+ participantId : string ;
9+ volunteerIds : string [ ] ;
10+ matchStatus ?: string ;
11+ }
12+
13+ export interface MatchResponse {
14+ id : number ;
15+ participantId : string ;
16+ volunteerId : string ;
17+ matchStatus : string ;
18+ chosenTimeBlockId ?: number | null ;
19+ createdAt : string ;
20+ updatedAt ?: string | null ;
21+ }
22+
23+ export interface MatchCreateResponse {
24+ matches : MatchResponse [ ] ;
25+ }
26+
27+ export const matchAPIClient = {
28+ /**
29+ * Create matches between a participant and volunteers
30+ * @param request Match creation request
31+ * @returns Created matches
32+ */
33+ createMatches : async ( request : MatchCreateRequest ) : Promise < MatchCreateResponse > => {
34+ const response = await baseAPIClient . post < MatchCreateResponse > ( '/matches/' , request ) ;
35+ return response . data ;
36+ } ,
37+ } ;
38+
Original file line number Diff line number Diff line change 1+ /**
2+ * API Client for matching endpoints
3+ */
4+
5+ import baseAPIClient from './baseAPIClient' ;
6+
7+ export interface AdminMatchCandidate {
8+ volunteerId : string ;
9+ firstName : string | null ;
10+ lastName : string | null ;
11+ email : string ;
12+ timezone : string | null ;
13+ age : number | null ;
14+ diagnosis : string | null ;
15+ treatments : string [ ] ;
16+ experiences : string [ ] ;
17+ matchScore : number ;
18+ }
19+
20+ export interface AdminMatchesResponse {
21+ matches : AdminMatchCandidate [ ] ;
22+ }
23+
24+ export const matchingAPIClient = {
25+ /**
26+ * Get potential volunteer matches for a participant (admin only)
27+ * @param participantId Participant user ID
28+ * @returns List of volunteer matches with full details and scores
29+ */
30+ getAdminMatches : async ( participantId : string ) : Promise < AdminMatchesResponse > => {
31+ const response = await baseAPIClient . get < AdminMatchesResponse > ( `/matching/admin/${ participantId } ` ) ;
32+ return response . data ;
33+ } ,
34+ } ;
35+
Original file line number Diff line number Diff line change 1+ /**
2+ * API Client for ranking endpoints
3+ */
4+
5+ import baseAPIClient from './baseAPIClient' ;
6+
7+ export interface RankingPreference {
8+ kind : 'quality' | 'treatment' | 'experience' ;
9+ id : number ;
10+ scope : 'self' | 'loved_one' ;
11+ rank : number ;
12+ name : string ;
13+ }
14+
15+ export const rankingAPIClient = {
16+ /**
17+ * Get ranking preferences for a user (admin only)
18+ * @param userId User ID
19+ * @param target Target role ('patient' or 'caregiver')
20+ * @returns List of ranking preferences
21+ */
22+ getPreferences : async ( userId : string , target : 'patient' | 'caregiver' ) : Promise < RankingPreference [ ] > => {
23+ const response = await baseAPIClient . get < RankingPreference [ ] > ( `/ranking/preferences/${ userId } ` , {
24+ params : { target } ,
25+ } ) ;
26+ return response . data ;
27+ } ,
28+ } ;
29+
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export interface BackendTask {
1111 endDate : string | null ; // ISO datetime string
1212 createdAt : string ;
1313 updatedAt : string ;
14+ description : string | null ;
1415}
1516
1617export interface TaskListResponse {
You can’t perform that action at this time.
0 commit comments