import type { AdminRoleRow } from "@/types/api/index";

export const PLATFORM_SUPER_ADMIN_SLUG = "super_admin";
export const PLATFORM_SITE_ADMIN_SLUG = "site_admin";
export const PLATFORM_SITE_FINANCE_SLUG = "site_finance";
export const PLATFORM_SITE_CS_SLUG = "site_cs";
export const PLATFORM_AGENT_SLUG = "agent";

export function isPlatformFixedRole(role: Pick<AdminRoleRow, "slug">): boolean {
  return (
    role.slug === PLATFORM_SUPER_ADMIN_SLUG
    || role.slug === PLATFORM_SITE_ADMIN_SLUG
    || role.slug === PLATFORM_SITE_FINANCE_SLUG
    || role.slug === PLATFORM_SITE_CS_SLUG
    || role.slug === PLATFORM_AGENT_SLUG
  );
}

export function isPlatformSuperAdminRole(role: Pick<AdminRoleRow, "slug">): boolean {
  return role.slug === PLATFORM_SUPER_ADMIN_SLUG;
}
