import { wireHTTP } from '#pikku/pikku-types.gen.js'
import { addCandidateDocuments, deleteCandidateDocument, getCandidate, getCandidateById, startFlow, updateCandidate, updateCandidateDocument } from './candidate.functions.js'
import { getCandidateResults } from './candidate-results.functions.js'

wireHTTP({
  method: 'post',
  route: '/candidate',
  func: startFlow,
  auth: false,
})

wireHTTP({
  method: 'get',
  route: '/candidate',
  func: getCandidate,
})

wireHTTP({
  method: 'get',
  route: '/candidate/:candidateId',
  func: getCandidateById,
})

wireHTTP({
  method: 'patch',
  route: '/candidate/:candidateId',
  func: updateCandidate,
})

wireHTTP({
  method: 'post',
  route: '/candidate/:candidateId/document',
  func: addCandidateDocuments,
})

wireHTTP({
  method: 'patch',
  route: '/candidate/:candidateId/document/:documentId',
  func: updateCandidateDocument,
})

wireHTTP({
  method: 'delete',
  route: '/candidate/:candidateId/document/:documentId',
  func: deleteCandidateDocument,
})

wireHTTP({
  method: 'get',
  route: '/candidate/:candidateId/results',
  func: getCandidateResults,
})


