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
72 lines (66 loc) · 1.33 KB
/
types.ts
File metadata and controls
72 lines (66 loc) · 1.33 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
import { ReactNode } from "react";
export interface StockHistoryEntry {
date: string;
change: number;
newStock: number;
reason: string; // e.g., 'Initial Stock', 'Sale: ORD-XXXX', 'Manual Edit', 'Stock Merge'
}
export interface Part {
_id: string;
partNumber: string;
name: string;
vehicle: {
make: string;
model: string;
yearStart: number | null;
yearEnd: number | null;
};
category: string;
brand: string;
supplierId?: string;
costPrice: number;
sellPrice: number;
currency: string;
barcode: string;
stockOnHand: number;
reorderPoint: number;
location: string;
images?: string[];
notes?: string;
isActive: boolean;
stockHistory?: StockHistoryEntry[];
lastSoldAt?: string;
createdAt: string;
updatedAt: string;
}
export interface CartItem extends Part {
quantity: number;
discount: number; // KES amount
}
export interface Order {
id: string;
date: string;
items: CartItem[];
subtotal: number;
tax: number;
total: number;
customer?: { // Optional customer info
name: string;
phone?: string;
};
}
export interface Expense {
_id: string;
date: string;
category: string;
description: string;
amount: number;
createdAt: string;
updatedAt: string;
}
export interface User {
_id: string;
username: string;
role: 'Admin' | 'Staff';
token: string;
}