generated from google-gemini/aistudio-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
182 lines (163 loc) · 4.13 KB
/
types.ts
File metadata and controls
182 lines (163 loc) · 4.13 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
export interface Product {
id: string;
name: string;
description: string;
price: number;
image: string;
category: 'Phone' | 'Laptop' | 'Tablet' | 'Watch' | 'Audio' | 'Gaming';
condition: 'Grade A' | 'Grade B' | 'Grade C' | 'Refurbished';
location: string;
sellerId: string;
sellerName: string;
sellerTrustScore: number; // 0-100
isVerified: boolean;
stock: number;
sku?: string;
status: 'active' | 'draft' | 'archived';
views?: number;
verificationId?: string;
aiPricingSuggestion?: {
price: number;
confidence: number;
};
demandLevel?: 'High' | 'Medium' | 'Low';
estimatedDaysToSell?: number;
}
export interface TrustScanResult {
deviceModel: string;
conditionGrade: 'A' | 'B' | 'C' | 'D';
confidenceScore: number; // 0-100
marketValue: number;
verificationNotes: string;
visualAnalysis: {
screen: 'Clean' | 'Scratched' | 'Cracked';
body: 'Mint' | 'Dented' | 'Worn';
camera: 'Clear' | 'Obstructed';
};
isEligibleForListing: boolean;
}
export interface Message {
id: string;
sender: 'buyer' | 'seller';
text: string;
timestamp: number;
isOffer?: boolean;
offerAmount?: number;
}
export type UserRole = 'guest' | 'buyer' | 'seller';
export type ViewState =
| 'landing'
| 'market'
| 'trust-scan'
| 'cart'
| 'profile'
| 'wallet'
| 'notifications'
| 'dashboard-overview'
| 'dashboard-inventory'
| 'dashboard-orders';
export type OrderStatus = 'escrow_locked' | 'processing' | 'shipped' | 'delivered' | 'funds_released' | 'pickup_scheduled' | 'in_transit_to_hub' | 'at_hub_verification' | 'verified' | 'out_for_delivery';
export interface Order {
id: string;
items: { product: Product, price: number, isSwap?: boolean }[];
totalAmount: number;
date: string;
status: OrderStatus;
trackingSteps: TrackingStep[];
trustVerificationId?: string;
estimatedArrival?: string;
verificationReport?: string;
}
export interface TrackingStep {
status: string;
label: string;
timestamp?: string;
completed: boolean;
location?: string;
}
// --- AI SERVICE TYPES ---
export interface MarketPulseData {
valueScore: number; // 0-100 (Is this a good deal?)
fairPriceRange: { min: number, max: number };
priceTrend: 'rising' | 'falling' | 'stable';
demandLevel: 'high' | 'medium' | 'low';
insight: string;
}
export interface DealSenseReply {
text: string;
accepted: boolean;
counterOffer?: number;
toneUsed: string;
}
export interface AiDeliveryQuote {
carrier: string;
service: string;
cost: number;
estimatedDays: string;
trustRating: string; // "High Trust"
reasoning?: string;
}
export interface SecurityLog {
id: string;
event: string;
timestamp: string;
status: 'success' | 'warning' | 'failed';
ip?: string;
device?: string;
}
export interface ToastNotification {
id: string;
type: 'success' | 'error' | 'info';
message: string;
read?: boolean;
title?: string;
time?: string;
}
export interface Transaction {
id: string;
type: 'credit' | 'debit' | 'escrow_lock' | 'escrow_release';
amount: number;
description: string;
date: string;
status: 'success' | 'pending' | 'failed';
reference?: string;
}
export interface SwapAssessment {
marketValue: number;
tradeInValue: number;
topUpAmount: number;
breakdown: {
screen: string;
body: string;
battery: string;
};
verificationStatus: 'verified' | 'adjusted' | 'pending';
reasoning: string;
}
export interface AiSellerInsight {
headline: string;
content: string;
actionableTip: string;
}
export interface Promotion {
id: string;
code: string;
discountType: 'percentage' | 'fixed';
value: number;
usageCount: number;
status: 'active' | 'expired' | 'scheduled';
}
export interface StoreProfile {
storeName: string;
description: string;
logoUrl: string;
bannerUrl: string;
contactEmail: string;
pickupAddress: string;
sellerTrustGrade: 'A' | 'B' | 'C';
}
export interface AiPricingAdvice {
recommendedPrice: number;
priceRange: { min: number, max: number };
confidence: number;
}