import type { IResponse } from "@/types/response.types";

export type RoleDetail = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  name: string;
  restaurant: string | null;
};

export type AdminRole = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  admin: string;
  role: RoleDetail;
  restaurant: string;
};

export type Admin = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  firstName: string;
  lastName: string;
  phone: string;
  roles: AdminRole[];
};

export type GetAdminsParams = {
  page?: number;
  limit?: number;
  search?: string;
};

export type GetAdminsResponse = IResponse<Admin[]>;

export type GetAdminByIdResponse = IResponse<Admin>;

export type CreateAdminType = {
  phone: string;
  firstName: string;
  lastName: string;
  roleId: string;
};
