export interface Permission {
  id: number;
  title: string;
  description: string;
  created_at: string;
  updated_at: string;
}

export interface Role {
  id: number;
  title: string;
  description: string;
  permissions: Permission[];
  created_at: string;
  updated_at: string;
}

export interface AdminUser {
  id: number;
  username: string;
  first_name: string;
  last_name: string;
  status: "active" | "inactive";
  created_at: string;
  updated_at: string;
}

// Complete AdminUserInfo from swagger (with roles and permissions)
export interface AdminUserInfo {
  id: number;
  username: string;
  first_name: string;
  last_name: string;
  status: "active" | "deactive";
  permissions: Permission[];
  roles: Role[];
  created_at: string;
  updated_at: string;
}

// Admin User Management Types
export interface CreateAdminUserRequest {
  first_name: string;
  last_name: string;
  username: string;
  password: string;
  status: string;
  permissions?: number[];
  roles?: number[];
}

export interface UpdateAdminUserRequest {
  id: number;
  first_name: string;
  last_name: string;
  username: string;
  password?: string;
  status: string;
  permissions?: number[];
  roles?: number[];
}

export interface AdminUsersListResponse {
  users: AdminUserInfo[];
}

export interface AdminUserDetailResponse {
  user: AdminUserInfo;
}

export interface DeleteAdminUserResponse {
  message: string;
}

export interface Tokens {
  access_token: string;
  refresh_token: string;
}

export interface LoginResponse {
  admin_user: AdminUser;
  permissions: Permission[];
  tokens: Tokens;
}

export interface LoginRequest {
  username: string;
  password: string;
}

export interface AuthState {
  isAuthenticated: boolean;
  isLoading: boolean;
  user: AdminUser | null;
  permissions: Permission[];
  allPermissions: Permission[];
  token: string | null;
  refreshToken: string | null;
}
