<commit_before>﻿using System.Net;
using System.Threading.Tasks;
using System.Web.Http;
using Esfa.Vacancy.Register.Api.Attributes;
using Esfa.Vacancy.Register.Api.Orchestrators;
using SFA.DAS.NLog.Logger;
using Swashbuckle.Swagger.Annotations;

namespace Esfa.Vacancy.Register.Api.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    [RoutePrefix("api/vacancies")]
    public class VacanciesController : ApiController
    {
        private readonly ILog _log;
        private readonly IVacancyOrchestrator _vacancyOrchestrator;

        public VacanciesController(ILog log, IVacancyOrchestrator vacancyOrchestrator)
        {
            _log = log;
            _vacancyOrchestrator = vacancyOrchestrator;
        }

        /// <summary>
        /// Check if a vacancy exists
        /// </summary>
        /// <param name="id"></param>
        [SwaggerOperation("Head")]
        [SwaggerResponse(HttpStatusCode.NoContent)]
        [SwaggerResponse(HttpStatusCode.NotFound)]
        [ExceptionHandling]
        public async Task Head(int id)
        {
            await Get(id);
        }

        /// <summary>
        /// Get a vacancy by the public vacancy reference identifier
        /// </summary>
        /// <param name="id">The public vacancy reference identifier</param>
        /// <returns>A vacancy for an apprenticeship or a traineeship</returns>
        [SwaggerOperation("Get")]
        [SwaggerResponse(HttpStatusCode.OK, "OK", typeof(Vacancy.Api.Types.Vacancy))]
        [SwaggerResponse(HttpStatusCode.NotFound)]
        [ExceptionHandling]
        public async Task<IHttpActionResult> Get(int id)
        {
            var vacancy = await _vacancyOrchestrator.GetVacancyDetailsAsync(id);

            return Ok(vacancy);
        }
    }
}<commit_msg>RA-1171 Changed parameter name from Id to VacancyReference<commit_after>﻿using System.Net;
using System.Threading.Tasks;
using System.Web.Http;
using Esfa.Vacancy.Register.Api.Attributes;
using Esfa.Vacancy.Register.Api.Orchestrators;
using SFA.DAS.NLog.Logger;
using Swashbuckle.Swagger.Annotations;

namespace Esfa.Vacancy.Register.Api.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    public class VacanciesController : ApiController
    {
        private readonly ILog _log;
        private readonly IVacancyOrchestrator _vacancyOrchestrator;

        public VacanciesController(ILog log, IVacancyOrchestrator vacancyOrchestrator)
        {
            _log = log;
            _vacancyOrchestrator = vacancyOrchestrator;
        }

        /// <summary>
        /// Check if a vacancy exists
        /// </summary>
        /// <param name="id"></param>
        [SwaggerOperation("Head")]
        [SwaggerResponse(HttpStatusCode.NoContent)]
        [SwaggerResponse(HttpStatusCode.NotFound)]
        [ExceptionHandling]
        public async Task Head(int id)
        {
            await Get(id);
        }

        /// <summary>
        /// Get a vacancy by the public vacancy reference identifier
        /// </summary>
        /// <param name="id">The public vacancy reference identifier</param>
        /// <returns>A vacancy for an apprenticeship or a traineeship</returns>
        [SwaggerOperation("Get")]
        [SwaggerResponse(HttpStatusCode.OK, "OK", typeof(Vacancy.Api.Types.Vacancy))]
        [SwaggerResponse(HttpStatusCode.NotFound)]
        [ExceptionHandling]
        [Route("api/vacancies/{vacancyReference}")]
        public async Task<IHttpActionResult> Get(int vacancyReference)
        {
            var vacancy = await _vacancyOrchestrator.GetVacancyDetailsAsync(vacancyReference);

            return Ok(vacancy);
        }
    }
}
{'fraction_non_alphanumeric': 0.10727969348659004, 'fraction_numerical': 0.0010946907498631637, 'mean_word_length': 2.480952380952381, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1462762', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1039, 'n_words': 211}