Move types to lib directory for better organization

- Move types/location.ts to lib/types.ts
- Update all imports from @/types/location to @/lib/types
- Remove empty types/ directory
- Better aligns with Next.js conventions

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-01 08:56:31 +00:00
parent 40f882e4bf
commit 7aab1ab789
5 changed files with 4 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { Device } from '@/types/location';
import { Device } from '@/lib/types';
export const DEVICES: Record<string, Device> = {
'10': { id: '10', name: 'Device A', color: '#e74c3c' },

30
lib/types.ts Normal file
View File

@@ -0,0 +1,30 @@
export interface Location {
id?: number;
latitude: number | string; // NocoDB returns string
longitude: number | string; // NocoDB returns string
timestamp: string;
user_id: number | string; // NocoDB returns string "0" for MQTT devices
first_name: string | null;
last_name: string | null;
username: string | null;
marker_label: string | null;
display_time: string | null;
chat_id: number | string; // Also string in API response
battery?: number | null;
speed?: number | null;
created_at?: string;
}
export interface LocationResponse {
success: boolean;
current: Location | null;
history: Location[];
total_points: number;
last_updated: string;
}
export interface Device {
id: string;
name: string;
color: string;
}