import { User, UserStatus } from '@prisma/client'

// Customer user fixture
export const customerUser: User = {
  id: 'customer-user-001',
  email: 'customer@example.com',
  passwordHash: '$2a$10$hashedpassword',
  name: 'Test Customer',
  company: 'Test Company',
  status: UserStatus.ACTIVE,
  emailVerified: new Date('2024-01-01T00:00:00Z'),
  createdAt: new Date('2024-01-01T00:00:00Z'),
  updatedAt: new Date('2024-01-01T00:00:00Z'),
  twoFactorEnabled: false,
  twoFactorSecretEnc: null,
  twoFactorVerifiedAt: null,
  backupCodesEnc: null,
}

// Second customer for testing lists
export const customerUser2: User = {
  id: 'customer-user-002',
  email: 'another@example.com',
  passwordHash: '$2a$10$hashedpassword',
  name: 'Another Customer',
  company: 'Another Company',
  status: UserStatus.ACTIVE,
  emailVerified: new Date('2024-02-01T00:00:00Z'),
  createdAt: new Date('2024-02-01T00:00:00Z'),
  updatedAt: new Date('2024-02-01T00:00:00Z'),
  twoFactorEnabled: false,
  twoFactorSecretEnc: null,
  twoFactorVerifiedAt: null,
  backupCodesEnc: null,
}

// Pending verification user
export const pendingUser: User = {
  id: 'customer-user-003',
  email: 'pending@example.com',
  passwordHash: '$2a$10$hashedpassword',
  name: 'Pending User',
  company: null,
  status: UserStatus.PENDING_VERIFICATION,
  emailVerified: null,
  createdAt: new Date('2024-03-01T00:00:00Z'),
  updatedAt: new Date('2024-03-01T00:00:00Z'),
  twoFactorEnabled: false,
  twoFactorSecretEnc: null,
  twoFactorVerifiedAt: null,
  backupCodesEnc: null,
}

// All users
export const allUsers: User[] = [customerUser, customerUser2, pendingUser]

// Factory function for creating custom users
export function createUser(overrides: Partial<User> = {}): User {
  return {
    id: `user-${Date.now()}`,
    email: `user-${Date.now()}@example.com`,
    passwordHash: '$2a$10$hashedpassword',
    name: 'Test User',
    company: null,
    status: UserStatus.ACTIVE,
    emailVerified: null,
    createdAt: new Date(),
    updatedAt: new Date(),
    twoFactorEnabled: false,
    twoFactorSecretEnc: null,
    twoFactorVerifiedAt: null,
    backupCodesEnc: null,
    ...overrides,
  }
}
