export interface UserDirectoryReference {
  id: number;
  name?: string;
}

export interface UserDirectoryTeam {
  id: number;
  name: string;
  alias: string;
}

export interface UserDirectoryAssignment {
  id: number;
  firstName: string;
  lastName: string;
  active: boolean;
  team: UserDirectoryTeam;
  teamRole: UserDirectoryReference | null;
}

export interface UserDirectorySummary {
  id: number;
  firstName: string | null;
  lastName: string | null;
  status: UserDirectoryReference | null;
  assignments: UserDirectoryAssignment[];
}

export interface AdminUserDirectorySummary extends UserDirectorySummary {
  email: string | null;
  role: UserDirectoryReference | null;
}

export type UserDirectoryRecord = UserDirectorySummary | AdminUserDirectorySummary;

export interface UserDirectoryPage {
  data: UserDirectoryRecord[];
  page: number;
  limit: number;
  total: number;
  hasNextPage: boolean;
}

export interface UserDirectoryFilters {
  page?: number;
  limit?: number;
  search?: string;
}

export interface AdminUserProfileRequest {
  firstName?: string;
  lastName?: string;
}

export type AdminUserRoleId = 1 | 2;
export type AdminUserStatusId = 1 | 2;

export interface AdminUserRoleRequest {
  role: AdminUserRoleId;
}

export interface AdminUserStatusRequest {
  status: AdminUserStatusId;
}

export type AdminPlayerAssignmentFilter = 'all' | 'assigned' | 'unassigned';

export interface AdminPlayerFilters {
  search?: string;
  teamId?: number;
  assignment?: AdminPlayerAssignmentFilter;
  page?: number;
  limit?: number;
}

export interface AdminPlayerTeam {
  id: number;
  name: string;
  alias: string;
}

export interface AdminPlayerCurrentUser {
  id: number;
  firstName: string | null;
  lastName: string | null;
  status: UserDirectoryReference | null;
}

export interface AdminPlayerSummary {
  id: number;
  firstName: string;
  lastName: string;
  active: boolean;
  team: AdminPlayerTeam;
  currentUser: AdminPlayerCurrentUser | null;
}

export interface AdminPlayerPage {
  data: AdminPlayerSummary[];
  page: number;
  limit: number;
  total: number;
  hasNextPage: boolean;
}

export interface UserTeamReference {
  id: number;
  name: string;
}

export interface UserTeamMembership {
  id: number;
  firstName: string;
  lastName: string;
  team: UserTeamReference;
}
