Initial commit

This commit is contained in:
2026-02-06 14:06:49 +08:00
commit 5fc7b33b3b
28 changed files with 5004 additions and 0 deletions

91
src/types/index.ts Normal file
View File

@@ -0,0 +1,91 @@
export interface User {
id: number;
username: string;
name: string;
email?: string;
role: string;
createdAt: string;
}
export interface Company {
id: number;
name: string;
status: 'active' | 'disabled';
createdAt: string;
serials?: Serial[];
}
export interface Serial {
id: number;
serialNumber: string;
companyId: number;
companyName: string;
status: 'active' | 'disabled';
validUntil: string;
createdAt: string;
}
export interface GenerateSerialRequest {
companyName: string;
serialOption: 'auto' | 'custom';
serialPrefix?: string;
quantity: number;
validOption: 'days' | 'date';
validDays?: number;
validUntil?: string;
}
export interface GenerateSerialResponse {
companyName: string;
serials: Array<{
serialNumber: string;
validUntil: string;
}>;
qrCode: string;
}
export interface AuthResponse {
token: string;
user: User;
}
export interface LoginRequest {
username: string;
password: string;
remember?: boolean;
}
export interface UpdateProfileRequest {
name?: string;
email?: string;
}
export interface ChangePasswordRequest {
currentPassword: string;
newPassword: string;
}
export interface ApiResponse<T> {
success: boolean;
data?: T;
error?: string;
}
export interface DashboardStats {
totalCompanies: number;
totalSerials: number;
activeSerials: number;
inactiveSerials: number;
monthlyData: Array<{
month: string;
companies: number;
serials: number;
}>;
recentCompanies: Company[];
recentSerials: Serial[];
}
export interface CompanyFilter {
search?: string;
status?: 'all' | 'active' | 'expired';
}