Initial commit
This commit is contained in:
91
src/types/index.ts
Normal file
91
src/types/index.ts
Normal 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';
|
||||
}
|
||||
Reference in New Issue
Block a user