import { Cookies } from "quasar";

const OWNER_USER_TYPE_ID = 3;

export const isOwnerUser = (user) => {
  const description = String(
    user?.user_type?.description ?? user?.type ?? "",
  ).toLowerCase();
  const userTypeId = Number(user?.user_type_id ?? user?.user_type?.value);

  return description === "owner" || userTypeId === OWNER_USER_TYPE_ID;
};

export const clearAuthSession = () => {
  Cookies.remove("access_token");
  Cookies.remove("refresh_token");
};
