Features: - Login screen with API integration (credentials endpoint) - SecureStore for token management - Patients list with health data display - Patient dashboard with stats and quick actions - AI Chat screen (voice_ask API integration) - Profile screen with logout - Full error handling and loading states - WellNuo brand colors and UI components API Integration: - Base URL: eluxnetworks.net/function/well-api/api - Auth: function=credentials - Chat: function=voice_ask 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
71 lines
1.1 KiB
TypeScript
71 lines
1.1 KiB
TypeScript
// User & Auth Types
|
|
export interface User {
|
|
user_id: number;
|
|
user_name: string;
|
|
max_role: number;
|
|
privileges: string;
|
|
}
|
|
|
|
export interface AuthResponse {
|
|
access_token: string;
|
|
privileges: string;
|
|
user_id: number;
|
|
max_role: number;
|
|
status: string;
|
|
}
|
|
|
|
export interface LoginCredentials {
|
|
username: string;
|
|
password: string;
|
|
}
|
|
|
|
// Patient Types
|
|
export interface Patient {
|
|
id: number;
|
|
name: string;
|
|
avatar?: string;
|
|
device_id?: string;
|
|
status: 'online' | 'offline';
|
|
relationship?: string;
|
|
last_activity?: string;
|
|
health_data?: HealthData;
|
|
}
|
|
|
|
export interface HealthData {
|
|
heart_rate?: number;
|
|
steps?: number;
|
|
sleep_hours?: number;
|
|
last_updated?: string;
|
|
}
|
|
|
|
// Chat Types
|
|
export interface Message {
|
|
id: string;
|
|
role: 'user' | 'assistant';
|
|
content: string;
|
|
timestamp: Date;
|
|
}
|
|
|
|
export interface ChatResponse {
|
|
ok: boolean;
|
|
response: {
|
|
Command: string;
|
|
body: string;
|
|
language: string;
|
|
};
|
|
status: string;
|
|
}
|
|
|
|
// API Types
|
|
export interface ApiError {
|
|
message: string;
|
|
code?: string;
|
|
status?: number;
|
|
}
|
|
|
|
export interface ApiResponse<T> {
|
|
data?: T;
|
|
error?: ApiError;
|
|
ok: boolean;
|
|
}
|