public async Task <ActionResult <StatusResource> > UpdateStatus(int id, [FromBody] SaveStatusResource saveStatusResource)
        {
            var validator        = new SaveStatusResourceValidator();
            var validationResult = await validator.ValidateAsync(saveStatusResource);

            if (!validationResult.IsValid)
            {
                return(BadRequest(validationResult.Errors)); // this needs refining, but for demo it is ok
            }
            var statusToBeUpdated = await _statusService.GetStatusById(id);

            if (statusToBeUpdated == null)
            {
                return(NotFound());
            }

            var status = _mapper.Map <SaveStatusResource, Status>(saveStatusResource);

            await _statusService.UpdateStatus(statusToBeUpdated, status);

            var updatedStatus = await _statusService.GetStatusById(id);

            var updatedStatusResource = _mapper.Map <Status, StatusResource>(updatedStatus);

            return(Ok(updatedStatusResource));
        }
        public async Task <ActionResult <StatusResource> > CreateStatus([FromBody] SaveStatusResource saveStatusResource)
        {
            var validator        = new SaveStatusResourceValidator();
            var validationResult = await validator.ValidateAsync(saveStatusResource);

            if (!validationResult.IsValid)
            {
                return(BadRequest(validationResult.Errors)); // this needs refining, but for demo it is ok
            }
            var statusToCreate = _mapper.Map <SaveStatusResource, Status>(saveStatusResource);

            var newStatus = await _statusService.CreateStatus(statusToCreate);

            var status = await _statusService.GetStatusById(newStatus.Id);

            var statusResource = _mapper.Map <Status, StatusResource>(status);

            return(Ok(statusResource));
        }