Improve the frontend modals

This commit is contained in:
Urtzi Alfaro
2025-10-27 16:33:26 +01:00
parent 61376b7a9f
commit 858d985c92
143 changed files with 9289 additions and 2306 deletions

View File

@@ -77,16 +77,16 @@ export class AuthService {
}
// ===================================================================
// ATOMIC: User Profile
// Backend: services/auth/app/api/users.py
// User Profile (authenticated)
// Backend: services/auth/app/api/auth_operations.py
// ===================================================================
async getProfile(): Promise<UserResponse> {
return apiClient.get<UserResponse>('/users/me');
return apiClient.get<UserResponse>(`${this.baseUrl}/me`);
}
async updateProfile(updateData: UserUpdate): Promise<UserResponse> {
return apiClient.put<UserResponse>('/users/me', updateData);
return apiClient.put<UserResponse>(`${this.baseUrl}/me`, updateData);
}
// ===================================================================
@@ -104,6 +104,106 @@ export class AuthService {
});
}
// ===================================================================
// Account Management (self-service)
// Backend: services/auth/app/api/account_deletion.py
// ===================================================================
async deleteAccount(confirmEmail: string, password: string, reason?: string): Promise<{ message: string; deletion_date: string }> {
return apiClient.delete(`${this.baseUrl}/me/account`, {
data: {
confirm_email: confirmEmail,
password: password,
reason: reason || ''
}
});
}
async getAccountDeletionInfo(): Promise<any> {
return apiClient.get(`${this.baseUrl}/me/account/deletion-info`);
}
// ===================================================================
// GDPR Consent Management
// Backend: services/auth/app/api/consent.py
// ===================================================================
async recordConsent(consentData: {
terms_accepted: boolean;
privacy_accepted: boolean;
marketing_consent?: boolean;
analytics_consent?: boolean;
consent_method: string;
consent_version?: string;
}): Promise<any> {
return apiClient.post(`${this.baseUrl}/me/consent`, consentData);
}
async getCurrentConsent(): Promise<any> {
return apiClient.get(`${this.baseUrl}/me/consent/current`);
}
async getConsentHistory(): Promise<any[]> {
return apiClient.get(`${this.baseUrl}/me/consent/history`);
}
async updateConsent(consentData: {
terms_accepted: boolean;
privacy_accepted: boolean;
marketing_consent?: boolean;
analytics_consent?: boolean;
consent_method: string;
consent_version?: string;
}): Promise<any> {
return apiClient.put(`${this.baseUrl}/me/consent`, consentData);
}
async withdrawConsent(): Promise<{ message: string; withdrawn_count: number }> {
return apiClient.post(`${this.baseUrl}/me/consent/withdraw`);
}
// ===================================================================
// Data Export (GDPR)
// Backend: services/auth/app/api/data_export.py
// ===================================================================
async exportMyData(): Promise<any> {
return apiClient.get(`${this.baseUrl}/me/export`);
}
async getExportSummary(): Promise<any> {
return apiClient.get(`${this.baseUrl}/me/export/summary`);
}
// ===================================================================
// Onboarding Progress
// Backend: services/auth/app/api/onboarding_progress.py
// ===================================================================
async getOnboardingProgress(): Promise<any> {
return apiClient.get(`${this.baseUrl}/me/onboarding/progress`);
}
async updateOnboardingStep(stepName: string, completed: boolean, data?: any): Promise<any> {
return apiClient.put(`${this.baseUrl}/me/onboarding/step`, {
step_name: stepName,
completed: completed,
data: data
});
}
async getNextOnboardingStep(): Promise<{ step: string }> {
return apiClient.get(`${this.baseUrl}/me/onboarding/next-step`);
}
async canAccessOnboardingStep(stepName: string): Promise<{ can_access: boolean }> {
return apiClient.get(`${this.baseUrl}/me/onboarding/can-access/${stepName}`);
}
async completeOnboarding(): Promise<{ success: boolean; message: string }> {
return apiClient.post(`${this.baseUrl}/me/onboarding/complete`);
}
// ===================================================================
// Health Check
// ===================================================================