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>
This commit is contained in:
34
apps/web/lib/profile-api.ts
Normal file
34
apps/web/lib/profile-api.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
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),
|
||||
};
|
||||
Reference in New Issue
Block a user