import type { GitGraphCommit, GitRepository } from '../../shared/types'

export const gitRepositoryFixture = {
  path: '.',
  name: 'cradle-app',
  absolutePath: '/Users/alex/Developer/cradle-app',
  branch: 'main',
  tracking: 'origin/main',
  ahead: 3,
  behind: 1,
  isDetached: false,
  files: [],
} satisfies GitRepository

export const gitPluginRepositoryFixture = {
  path: 'packages/plugin-sdk',
  name: 'plugin-sdk',
  absolutePath: '/Users/alex/Developer/cradle-app/packages/plugin-sdk',
  branch: 'release/plugin-runtime',
  tracking: 'origin/release/plugin-runtime',
  ahead: 0,
  behind: 2,
  isDetached: false,
  files: [],
} satisfies GitRepository

export const gitDocsRepositoryFixture = {
  path: 'apps/docs',
  name: 'docs',
  absolutePath: '/Users/alex/Developer/cradle-app/apps/docs',
  branch: 'docs/component-architecture',
  tracking: null,
  ahead: 5,
  behind: 0,
  isDetached: false,
  files: [],
} satisfies GitRepository

export const gitRepositoriesFixture: GitRepository[] = [
  gitRepositoryFixture,
  gitPluginRepositoryFixture,
  gitDocsRepositoryFixture,
]

export const gitGraphCommitsFixture: GitGraphCommit[] = [
  {
    sha: 'f000000000000000000000000000000000000009',
    shortSha: 'f000000',
    parents: [
      'e000000000000000000000000000000000000008',
      'c000000000000000000000000000000000000006',
    ],
    refs: ['HEAD -> main', 'origin/main'],
    subject: 'Merge component architecture stories',
    authorName: 'Alex Chen',
    authorEmail: 'alex@cradle.local',
    gravatarHash: '',
    date: '2026-07-22T09:42:00.000Z',
    timestamp: Date.parse('2026-07-22T09:42:00.000Z'),
  },
  {
    sha: 'e000000000000000000000000000000000000008',
    shortSha: 'e000000',
    parents: ['d000000000000000000000000000000000000007'],
    refs: [],
    subject: 'refactor(web): isolate workspace detail views',
    authorName: 'Mina Park',
    authorEmail: 'mina@cradle.local',
    gravatarHash: '',
    date: '2026-07-22T08:18:00.000Z',
    timestamp: Date.parse('2026-07-22T08:18:00.000Z'),
  },
  {
    sha: 'd000000000000000000000000000000000000007',
    shortSha: 'd000000',
    parents: ['b000000000000000000000000000000000000005'],
    refs: [],
    subject: 'refactor(web): isolate global search views',
    authorName: 'Alex Chen',
    authorEmail: 'alex@cradle.local',
    gravatarHash: '',
    date: '2026-07-21T16:34:00.000Z',
    timestamp: Date.parse('2026-07-21T16:34:00.000Z'),
  },
  {
    sha: 'c000000000000000000000000000000000000006',
    shortSha: 'c000000',
    parents: ['b000000000000000000000000000000000000005'],
    refs: ['feature/git-history-view'],
    subject: 'feat(web): add fixture-driven git history',
    authorName: 'Jordan Lee',
    authorEmail: 'jordan@cradle.local',
    gravatarHash: '',
    date: '2026-07-21T13:02:00.000Z',
    timestamp: Date.parse('2026-07-21T13:02:00.000Z'),
  },
  {
    sha: 'b000000000000000000000000000000000000005',
    shortSha: 'b000000',
    parents: ['a000000000000000000000000000000000000004'],
    refs: ['tag: v0.9.0'],
    subject: 'chore: prepare desktop preview release',
    authorName: 'Sam Rivera',
    authorEmail: 'sam@cradle.local',
    gravatarHash: '',
    date: '2026-07-19T11:27:00.000Z',
    timestamp: Date.parse('2026-07-19T11:27:00.000Z'),
  },
  {
    sha: 'a000000000000000000000000000000000000004',
    shortSha: 'a000000',
    parents: ['9000000000000000000000000000000000000003'],
    refs: [],
    subject: 'fix(web): preserve panel scroll position',
    authorName: 'Mina Park',
    authorEmail: 'mina@cradle.local',
    gravatarHash: '',
    date: '2026-07-18T07:55:00.000Z',
    timestamp: Date.parse('2026-07-18T07:55:00.000Z'),
  },
  {
    sha: '9000000000000000000000000000000000000003',
    shortSha: '9000000',
    parents: ['8000000000000000000000000000000000000002'],
    refs: [],
    subject: 'feat(web): add workspace workflow rule editor',
    authorName: 'Jordan Lee',
    authorEmail: 'jordan@cradle.local',
    gravatarHash: '',
    date: '2026-07-16T15:09:00.000Z',
    timestamp: Date.parse('2026-07-16T15:09:00.000Z'),
  },
  {
    sha: '8000000000000000000000000000000000000002',
    shortSha: '8000000',
    parents: ['7000000000000000000000000000000000000001'],
    refs: [],
    subject: 'refactor(web): separate route ownership from rendering',
    authorName: 'Alex Chen',
    authorEmail: 'alex@cradle.local',
    gravatarHash: '',
    date: '2026-07-15T10:43:00.000Z',
    timestamp: Date.parse('2026-07-15T10:43:00.000Z'),
  },
  {
    sha: '7000000000000000000000000000000000000001',
    shortSha: '7000000',
    parents: [],
    refs: [],
    subject: 'Initial repository structure',
    authorName: 'Cradle Team',
    authorEmail: 'team@cradle.local',
    gravatarHash: '',
    date: '2026-07-01T05:20:00.000Z',
    timestamp: Date.parse('2026-07-01T05:20:00.000Z'),
  },
]
