export type AdminUserScope = 'marketplace' | 'office';
export type AdminUserStatus = 'active' | 'invited' | 'suspended';
export type AdminInvitationStatus = 'pending' | 'accepted' | 'expired' | 'revoked';

/** Users-admin display/permissions shape - unrelated to core/auth/models/permission.model.ts's AdminRole (the real JWT/auth role union). */
export interface AdminUserRoleRecord {
  id: string;
  name: string;
  permissions: string[];
  builtIn: boolean;
}

export interface AdminUser {
  id: string;
  name: string;
  telegramUsername: string;
  email: string;
  scope: AdminUserScope;
  roleId: string;
  status: AdminUserStatus;
  lastLoginAt: string | null;
  createdAt: string;
}

export interface AdminInvitation {
  id: string;
  email: string;
  roleId: string;
  scope: AdminUserScope;
  status: AdminInvitationStatus;
  invitedAt: string;
  expiresAt: string;
}

export interface AdminSession {
  id: string;
  userId: string;
  device: string;
  ip: string;
  lastActiveAt: string;
  current: boolean;
}

export interface AdminUserAuditEntry {
  eventKey: 'roleChanged' | 'statusChanged';
  roleId?: string;
  status?: AdminUserStatus;
  actor: string;
  timestamp: string;
}
