import { wireHTTP } from '#pikku/pikku-types.gen.js'
import { getCandidateResult } from '../jobs/candidate-results.functions.js'
import { getBackOfficeCandidates, getBackOfficeCandidate, getBackOfficeSignedCandidateDocument, updateBackOfficeCandidate, updateBackOfficeCandidateDocument, updateBackOfficeCandidateEducation, updateBackOfficeCandidateLicense, updateBackOfficeCandidateLanguage, updateBackOfficeCandidateExperience } from './candidate.function.js'

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

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

wireHTTP({
  method: 'get',
  route: '/backoffice/candidate/:candidateId/document/:documentId',
  func: getBackOfficeSignedCandidateDocument,
})

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

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

wireHTTP({
  method: 'patch',
  route: '/backoffice/candidate/:candidateId/education',
  func: updateBackOfficeCandidateEducation,
})

wireHTTP({
  method: 'patch',
  route: '/backoffice/candidate/:candidateId/license',
  func: updateBackOfficeCandidateLicense,
})

wireHTTP({
  method: 'patch',
  route: '/backoffice/candidate/:candidateId/language',
  func: updateBackOfficeCandidateLanguage,
})

wireHTTP({
  method: 'patch',
  route: '/backoffice/candidate/:candidateId/experience',
  func: updateBackOfficeCandidateExperience,
})

wireHTTP({
  method: 'get',
  route: '/backoffice/candidate/:candidateId/result',
  func: getCandidateResult,
})
