defmodule MvWeb.PagePaths do
  @moduledoc """
  Central path strings for UI authorization and sidebar menu.

  Keep in sync with `MvWeb.Router`. Used by Sidebar and `can_access_page?/2`
  so route changes (prefix, rename) are updated in one place.
  """

  # Sidebar top-level menu paths
  @members "/members"
  @membership_fee_types "/membership_fee_types"
  @statistics "/statistics"

  # Administration submenu paths (all must match router)
  @users "/users"
  @groups "/groups"
  @admin_roles "/admin/roles"
  @membership_fee_settings "/membership_fee_settings"
  @settings "/settings"

  @admin_page_paths [
    @users,
    @groups,
    @admin_roles,
    @membership_fee_settings,
    @settings
  ]

  @doc "Path for Members index (sidebar and page permission check)."
  def members, do: @members

  @doc "Path for Membership Fee Types index (sidebar and page permission check)."
  def membership_fee_types, do: @membership_fee_types

  @doc "Path for Statistics page (sidebar and page permission check)."
  def statistics, do: @statistics

  @doc "Paths for Administration menu; show group if user can access any of these."
  def admin_menu_paths, do: @admin_page_paths

  def users, do: @users
  def groups, do: @groups
  def admin_roles, do: @admin_roles
  def membership_fee_settings, do: @membership_fee_settings
  def settings, do: @settings
end
