/**
 * Raw event SQL row fixtures for DataSource.query() mocks.
 */

export interface RawEventRow {
  sessionId: string;
  userId: string | null;
  eventType: string;
  pageUrl: string | null;
  timestamp: string;
  metadata: Record<string, unknown> | null;
}

export function createRawEventRow(
  overrides: Partial<RawEventRow> = {},
): RawEventRow {
  return {
    sessionId: 'sess-001',
    userId: 'user-001',
    eventType: 'pageview',
    pageUrl: '/',
    timestamp: '2026-01-15T10:00:00Z',
    metadata: null,
    ...overrides,
  };
}

export function createRawEventBatch(count: number): RawEventRow[] {
  return Array.from({ length: count }, (_, i) =>
    createRawEventRow({
      sessionId: `sess-${String(i + 1).padStart(3, '0')}`,
      userId: `user-${String(i + 1).padStart(3, '0')}`,
      timestamp: new Date(Date.now() - i * 60000).toISOString(),
    }),
  );
}
