Files
goodgo-platform/apps/web/lib/profile-api.ts
Ho Ngoc Hai 238c27c47a feat(web): add Agent Profile, KYC, Subscription & Payment dashboard pages
Implement four new dashboard pages with full UI:
- /dashboard/profile: view/edit profile, agent details, KYC status
- /dashboard/kyc: multi-step KYC document submission flow
- /dashboard/subscription: plan comparison, quota usage, billing history
- /dashboard/payments: transaction history with filters and pagination

Also adds API client modules (profile-api, subscription-api, payment-api)
and updates dashboard navigation with new page links.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-08 16:33:50 +07:00

35 lines
840 B
TypeScript

import { apiClient } from './api-client';
import type { UserProfile } from './auth-api';
export interface AgentProfile {
id: string;
email: string | null;
phone: string;
fullName: string;
avatarUrl: string | null;
role: string;
kycStatus: string;
isActive: boolean;
createdAt: string;
licenseNumber: string | null;
agency: string | null;
qualityScore: number | null;
serviceAreas: string[];
isVerified: boolean;
}
export interface UpdateProfilePayload {
fullName?: string;
email?: string;
phone?: string;
}
export const profileApi = {
getProfile: () => apiClient.get<UserProfile>('/auth/profile'),
getAgentProfile: () => apiClient.get<AgentProfile | null>('/auth/profile/agent'),
updateProfile: (data: UpdateProfilePayload) =>
apiClient.patch<{ message: string }>('/auth/profile', data),
};