WellNuo/types/index.ts
Sergei 48384f07c5 Full project sync - app updates and profile screens
Changes:
- Updated app.json, eas.json configurations
- Modified login, chat, profile, dashboard screens
- Added profile subpages (about, edit, help, language,
  notifications, privacy, subscription, support, terms)
- Updated BeneficiaryContext
- Updated API service and types
- Updated discussion questions scheme
- Added .history to gitignore

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 16:26:13 -08:00

111 lines
2.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;
}
// Beneficiary Types (elderly people being monitored)
export interface Beneficiary {
id: number;
name: string;
avatar?: string;
device_id?: string;
status: 'online' | 'offline';
relationship?: string;
last_activity?: string;
sensor_data?: SensorData;
// Extended data from dashboard_single API
address?: string;
timezone?: string;
wellness_score?: number;
wellness_descriptor?: string;
last_location?: string;
temperature?: number;
units?: string;
sleep_hours?: number;
bedroom_temperature?: number;
before_last_location?: string;
last_detected_time?: string;
}
// Dashboard API response
export interface DashboardSingleResponse {
result_list: PatientDashboardData[];
status: string;
}
export interface PatientDashboardData {
user_id: number;
name: string;
address: string;
time_zone: string;
picture: string;
deployment_id: string;
wellness_score_percent: number;
wellness_descriptor: string;
wellness_descriptor_color: string;
last_location: string;
last_detected_time: string;
before_last_location: string;
temperature: number;
bedroom_temperature: number;
sleep_hours: number;
units: string;
location_list: string[];
}
export interface SensorData {
motion_detected?: boolean;
last_motion?: string;
door_status?: 'open' | 'closed';
temperature?: number;
humidity?: 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;
}