import { Router } from "express"
import { addAsync } from "@awaitjs/express"
import { isGitHubAppInstalled } from "../endpoints/is-github-app-installed.js"
import { setupGithubActions } from "../endpoints/setup-github-actions.js"
import { closePr } from "../endpoints/close-pr.js"
import { ROUTES } from "../constants/index.js"

const router = addAsync(Router()) as any

// GitHub integration endpoints
router.getAsync(ROUTES.IS_GITHUB_APP_INSTALLED, isGitHubAppInstalled)
router.postAsync(ROUTES.SETUP_GITHUB_ACTIONS, setupGithubActions)
router.postAsync(ROUTES.CLOSE_PR, closePr)

export default router
