// Role / Nav / Permission DTOs (mirrors ERPCore's Dtos/Rbac/*.cs exactly).
import { EntityStatus } from "@/types/common"

export interface Role {
  roleId: number
  code: string
  name: string
  isSystemRole: boolean
  status: EntityStatus
  createdAt: string
  updatedAt: string | null
}

export interface CreateRoleRequest {
  code: string
  name: string
}

export interface UpdateRoleRequest {
  code: string
  name: string
}

export interface SubNavItem {
  subNavItemId: number
  code: string
  label: string
  icon: string | null
  href: string | null
  sortOrder: number
}

export interface NavItem {
  navItemId: number
  code: string
  label: string
  icon: string | null
  href: string | null
  sortOrder: number
  children: SubNavItem[]
}

export interface RolePermissions {
  roleId: number
  navItemIds: number[]
  subNavItemIds: number[]
}

export interface AssignRolePermissionsRequest {
  navItemIds: number[]
  subNavItemIds: number[]
}

export interface MeResponse {
  roleCode: string | null
  roleName: string | null
  navCodes: string[]
}
