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>
35 lines
840 B
TypeScript
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),
|
|
};
|