-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
95 lines (85 loc) · 1.7 KB
/
types.ts
File metadata and controls
95 lines (85 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
export enum TransportType {
CAR = 'CAR',
TRAIN = 'TRAIN',
FLIGHT = 'FLIGHT',
RIDESHARE = 'RIDESHARE',
BUS = 'BUS',
TRANSIT = 'TRANSIT',
BIKE = 'BIKE'
}
export enum TripScope {
LOCAL = 'LOCAL',
LONG_DISTANCE = 'LONG_DISTANCE'
}
export interface CostBreakdownItem {
label: string;
amount: number;
}
export interface GroundingSource {
title: string;
uri: string;
}
export interface RouteOption {
id: string;
type: TransportType;
durationMinutes: number;
totalCost: number;
currency: string;
costBreakdown: CostBreakdownItem[];
bookingUrl?: string;
recommendationType?: 'FASTEST' | 'CHEAPEST' | 'BEST_VALUE';
recommendationReason?: string;
groundingSources?: GroundingSource[];
}
export interface TripInput {
origin: string;
destination: string;
date: string;
time: string;
travelers: number;
scope: TripScope;
currency: string;
}
export const CURRENCY_SYMBOLS: Record<string, string> = {
INR: '₹',
USD: '$',
EUR: '€',
GBP: '£',
JPY: '¥',
AUD: 'A$',
CAD: 'C$'
};
// Database Types
export interface UserProfile {
id: string;
email: string;
created_at: string;
updated_at: string;
default_currency: string;
}
export interface SavedRoute {
id: string;
user_id: string;
origin: string;
destination: string;
transport_type: TransportType;
duration_minutes: number;
total_cost: number;
currency: string;
cost_breakdown: CostBreakdownItem[];
booking_url?: string;
notes?: string;
created_at: string;
}
export interface SearchHistory {
id: string;
user_id: string;
origin: string;
destination: string;
date: string;
time: string;
travelers: number;
scope: TripScope;
currency: string;
created_at: string;
}