import { Permission } from "./auth";

export * from "./auth";

// Permission Management Types
export interface CreatePermissionRequest {
  title: string;
  description: string;
}

export interface UpdatePermissionRequest {
  id: number;
  title: string;
  description: string;
}

export interface CreatePermissionResponse {
  permission: Permission;
}

export interface UpdatePermissionResponse {
  permission: Permission;
}

export interface GetPermissionByIDResponse {
  permission: Permission;
}

export interface GetAllPermissionsResponse {
  permissions: Permission[];
}

export interface DeletePermissionResponse {
  message: string;
}

// Re-export Permission from auth for convenience
export type { Permission } from "./auth";

export interface User {
  id: string;
  name: string;
  email: string;
  role: string;
  permissions: number[];
  avatar?: string;
  status: "active" | "inactive";
  createdAt: string;
  lastLogin?: string;
}

export interface AuthState {
  isAuthenticated: boolean;
  user: User | null;
  permissions: number[];
  token: string | null;
}

export interface DashboardStats {
  totalUsers: number;
  totalRevenue: number;
  totalOrders: number;
  totalProducts: number;
  monthlyGrowth: number;
  weeklyGrowth: number;
}

export interface ChartData {
  name: string;
  value: number;
  date?: string;
}

export interface TableColumn {
  key: string;
  label: string;
  sortable?: boolean;
  render?: (value: any, row: any) => any;
  align?: "left" | "right" | "center";
}

export interface TableData {
  [key: string]: any;
}

export interface MenuItem {
  id: string;
  label: string;
  icon: any;
  path: string;
  permission?: number;
  children?: MenuItem[];
}

export interface Theme {
  mode: "light" | "dark";
}

export interface Notification {
  id: string;
  title: string;
  message: string;
  type: "success" | "error" | "warning" | "info";
  timestamp: string;
  read: boolean;
}
