interface ITimestamp {
  created_at: string;
  updated_at: string;
}

// Sample data interface
interface IUser extends ITimestamp {
  id: number;
  email: string;
  username: string;
  first_name: string;
  last_name: string;
  phone: string;
  avatar: any;
  is_login_enabled: boolean;
  active: boolean;
  roles: IRole[];
}

interface IResource extends ITimestamp {
  id: number;
  method_name: any;
  description: string;
  name: string;
  group_key: string;
  path: string;
  method: any;
  type: "controller" | "method";
  is_public: boolean;
  disabled: boolean;
  function_permisstion: any;
  children: IResource[];
  checked?: boolean;
}

interface IRole extends ITimestamp {
  id: number;
  role_name: string;
  role_key: string;
  inherits: string[];
  permissions: IPermission[];
  role_authors: IUser[];
  resources: IResource[];
}

interface IPermission extends ITimestamp {
  id: number;
  permission_code: string;
  description: string;
}

interface IResponse<R> {
  message: string;
  status_code: HttpStatusCode;
  data: R;
  timestamp: string;
}

interface IResponsePagination<T> extends IResponse<T> {
  pagination: {
    currentPage: number;
    startIndex: number;
    endIndex: number;
    pageSize: number;
    totalPages: number;
    totalItems: number;
  };
}

interface IProduct extends ITimestamp {
  images: string[];
  title: string;
  price: number;
  category: string;
  condition: string;
  brand?: string;
  description: string;
  tags: string[];
  sku: string;
  location: string;
  id: number;
  histories: IHistory[];
  status: boolean;
}

interface IHistory extends ITimestamp {
  id: number;
  error?: string;
  published: boolean;
  message?: string;
}
