export interface DiffHunk {
  header: string;
  oldStart: number;
  oldCount: number;
  newStart: number;
  newCount: number;
  lines: DiffLine[];
}

export interface DiffLine {
  type: "added" | "removed" | "context";
  content: string;
  oldLineNumber: number | null;
  newLineNumber: number | null;
}

export type FileChangeType = 'added' | 'modified' | 'deleted' | 'renamed';

export interface FileDiff {
  oldPath: string;
  newPath: string;
  hunks: DiffHunk[];
  additions: number;
  deletions: number;
  changeType: FileChangeType;
}

export interface ReviewComment {
  id: string;
  filePath: string;
  lineNumber: number; // new-side line number (or old-side for deletions)
  lineType: "added" | "removed" | "context";
  body: string;
  author: string;
  createdAt: string;
  resolved: boolean;
  parentCommentId?: string | null;
}

export type ReviewStatus = "pending" | "approved" | "changes_requested";

export interface CommitInfo {
  hash: string;
  shortHash: string;
  message: string;
  author: string;
  date: string;
  filesChanged: number;
  insertions: number;
  deletions: number;
}

export interface ReviewSummary {
  id: string;
  title: string;
  description: string;
  author: string;
  status: ReviewStatus;
  comments: ReviewComment[];
  files: FileDiff[];
  createdAt: string;
  sourceBranch: string;
  targetBranch: string;
}
