/**
 * Mock data for tests
 */

// Mock user data
export const mockUser = {
  id: '1',
  username: 'testuser',
  email: 'test@example.com',
  firstName: 'Test',
  lastName: 'User',
  isVerified: true,
  role: 'user' as const,
};

export const mockUnverifiedUser = {
  ...mockUser,
  id: '2',
  email: 'unverified@example.com',
  isVerified: false,
};

// Mock item data
export const mockItem = {
  id: '1',
  name: 'Test Item',
  description: 'A test item for rental',
  pricePerDay: 25,
  replacementCost: 500,
  condition: 'excellent' as const,
  isAvailable: true,
  images: ['image1.jpg'],
  ownerId: '2',
  city: 'Test City',
  state: 'California',
  createdAt: new Date().toISOString(),
  updatedAt: new Date().toISOString(),
};

// Mock rental data
export const mockRental = {
  id: '1',
  itemId: '1',
  renterId: '1',
  ownerId: '2',
  startDateTime: new Date().toISOString(),
  endDateTime: new Date(Date.now() + 86400000).toISOString(),
  totalAmount: 25,
  status: 'pending' as const,
  paymentStatus: 'pending' as const,
  createdAt: new Date().toISOString(),
  updatedAt: new Date().toISOString(),
};

// Mock API response helpers
export const createMockResponse = <T>(data: T, status = 200) => ({
  data,
  status,
  statusText: 'OK',
  headers: {},
  config: {},
});

export const createMockError = (message: string, status: number, code?: string) => {
  const error = new Error(message) as any;
  error.response = {
    status,
    data: { message, code },
  };
  return error;
};
