Start integrating the onboarding flow with backend 1

This commit is contained in:
Urtzi Alfaro
2025-09-03 18:29:56 +02:00
parent a55d48e635
commit a11fdfba24
31 changed files with 1202 additions and 1142 deletions

View File

@@ -1,29 +1,25 @@
// Authentication related types
// Authentication related types - Updated to match backend exactly
export interface User {
id: string;
email: string;
full_name: string;
full_name: string; // Backend uses full_name, not name
is_active: boolean;
is_verified: boolean;
created_at: string;
created_at: string; // ISO format datetime string
last_login?: string;
phone?: string;
language?: string;
timezone?: string;
tenant_id?: string;
role?: UserRole;
avatar_url?: string;
role?: string; // Backend uses string, not enum
}
export interface UserRegistration {
email: string;
password: string;
full_name: string;
tenant_name?: string;
role?: UserRole;
phone?: string;
language?: string;
timezone?: string;
tenant_name?: string; // Optional in backend
role?: string; // Backend uses string, defaults to "user"
}
export interface UserLogin {
@@ -35,8 +31,8 @@ export interface UserLogin {
export interface TokenResponse {
access_token: string;
refresh_token?: string;
token_type: string;
expires_in: number;
token_type: string; // defaults to "bearer"
expires_in: number; // seconds, defaults to 3600
user?: User;
}
@@ -94,7 +90,7 @@ export interface RegisterFormData {
password: string;
confirmPassword: string;
full_name: string;
tenant_name: string;
tenant_name?: string; // Optional to match backend
phone?: string;
acceptTerms: boolean;
}
@@ -182,13 +178,11 @@ export interface OAuthProvider {
enabled: boolean;
}
// Enums
// Enums - Simplified to match backend
export enum UserRole {
USER = 'user',
ADMIN = 'admin',
MANAGER = 'manager',
OWNER = 'owner',
VIEWER = 'viewer',
}
export enum AuthProvider {