import type { Role } from './auth';

export interface User {
  id: string;
  tenantId: string;
  email: string;
  nombre: string;
  role: Role;
  active: boolean;
  lastLogin: Date | null;
  createdAt: Date;
}

export interface CreateUserRequest {
  email: string;
  nombre: string;
  role: Role;
  password: string;
}

export interface UpdateUserRequest {
  nombre?: string;
  role?: Role;
  active?: boolean;
}

export interface UserInvite {
  email: string;
  nombre: string;
  role: 'contador' | 'visor' | 'auxiliar' | 'supervisor' | 'cliente';
  supervisorUserId?: string;
}

export interface UserListItem {
  id: string;
  email: string;
  nombre: string;
  role: Role;
  active: boolean;
  lastLogin: string | null;
  createdAt: string;
  tenantId?: string;
  tenantName?: string;
}

export interface UserUpdate {
  nombre?: string;
  role?: Role;
  active?: boolean;
  tenantId?: string;
}

export interface AuditLog {
  id: number;
  userId: string;
  userName: string;
  action: string;
  details: string;
  ip: string;
  createdAt: string;
}
