finshing architecture for project now we have all layers to build profitionl project app,components ,hooks ,lib,services,styel ,types
This commit is contained in:
16
types/auth.ts
Normal file
16
types/auth.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export interface AuthUser {
|
||||
id?: string;
|
||||
name?: string;
|
||||
userName?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
role?: string;
|
||||
permissions?: string[];
|
||||
roleId?: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
token: string;
|
||||
user: AuthUser;
|
||||
}
|
||||
24
types/client.ts
Normal file
24
types/client.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export interface ClientAddress {
|
||||
_id: string;
|
||||
label: string;
|
||||
branchName: string | null;
|
||||
contactPerson: { name: string; phone: string };
|
||||
details: {
|
||||
city: string;
|
||||
district?: string;
|
||||
street: string;
|
||||
buildingNo?: string;
|
||||
unitNo?: string;
|
||||
zipCode?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type OrderStatus = "CREATED" | "IN_TRANSIT" | "DELIVERED" | "CANCELLED";
|
||||
|
||||
export interface Order {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
status: OrderStatus;
|
||||
totalAmount: number;
|
||||
description: string;
|
||||
}
|
||||
41
types/dashboard.ts
Normal file
41
types/dashboard.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
export interface DashboardStats {
|
||||
clients: number;
|
||||
orders: number;
|
||||
trips: number;
|
||||
cars: number;
|
||||
drivers: number;
|
||||
}
|
||||
|
||||
export interface AlertItem {
|
||||
message: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface ActiveTrip {
|
||||
id: string;
|
||||
tripNumber: string;
|
||||
title: string;
|
||||
progress: number;
|
||||
}
|
||||
|
||||
export interface AccountSecurity {
|
||||
lastLogin: string | null;
|
||||
requestMeta: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
export interface DashboardSummary {
|
||||
stats: DashboardStats;
|
||||
alerts: {
|
||||
expiringCars: AlertItem[];
|
||||
expiringDrivers: AlertItem[];
|
||||
upcomingMaint: AlertItem[];
|
||||
};
|
||||
activeTrips: ActiveTrip[];
|
||||
accountSecurity: AccountSecurity;
|
||||
}
|
||||
|
||||
export interface DashboardSummaryResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
data: DashboardSummary;
|
||||
}
|
||||
Reference in New Issue
Block a user