/** Route helpers for unified execution records (script + server batch). */

export type ExecutionRecordKind = 'script' | 'server_batch'

export function executionRecordPath(id: number, kind: ExecutionRecordKind) {
  return { path: `/executions/${id}`, query: { kind } }
}

export function parseExecutionRecordKind(raw: unknown): ExecutionRecordKind {
  return raw === 'server_batch' ? 'server_batch' : 'script'
}

export function executionRecordKindLabel(kind: ExecutionRecordKind): string {
  return kind === 'server_batch' ? '服务器' : '脚本'
}
