export interface LoginCredentials { email: string; password: string; } export interface RegisterData { email: string; password: string; name: string; phone?: string; } export interface UserInfo { id: string; email: string; name: string; phone?: string; role: UserRole; createdAt: string; updatedAt: string; } export enum UserRole { ADMIN = 'admin', USER = 'user', MERCHANT = 'merchant' } export interface JWTPayload { userId: string; email: string; role: UserRole; iat: number; exp: number; } export interface AuthState { isAuthenticated: boolean; user: UserInfo | null; token: string | null; isLoading: boolean; } export interface AuthContextType extends AuthState { login: (credentials: LoginCredentials) => Promise; register: (data: RegisterData) => Promise; logout: () => void; refreshToken: () => Promise; hasRole: (role: UserRole) => boolean; hasPermission: (permission: string) => boolean; } // Type aliases for React Query hooks export type User = UserInfo; export interface UserPermission { id: string; name: string; description?: string; resource: string; action: string; }