// Managed-user DTOs (mirrors ERPCore's Dtos/Users/UserDtos.cs).
import { EntityStatus } from "@/types/common"

export interface ManagedUser {
  userId: number
  username: string
  displayName: string
  email: string | null
  status: EntityStatus
  roleId: number | null
  roleCode: string | null
  roleName: string | null
}

export interface CreateUserRequest {
  username: string
  fullName: string
  roleId: number
  userTypeId: string
  email: string
  nic?: string | null
  mobileNumber?: string | null
  /** Left empty to auto-generate — AuthHex emails it to `email`. */
  password?: string | null
  /** Explicit, human-confirmed link to an existing unlinked Employee found via email-lookup. */
  linkEmployeeId?: number | null
}

export interface UpdateUserRoleRequest {
  roleId: number
}

/** AuthHex UserType lookup, for the create-user form's select (no local shadow — read-only). */
export interface UserTypeOption {
  userTypeId: string
  code: string | null
  description: string | null
}
