예제 #1
0
        public IActionResult AddNewClinker(AddNewClinkerCommand newClinker)
        {
            var existingClinker = _repository.GetIdByClinkerName(newClinker.FirstName, newClinker.LastName, newClinker.PrisonTermEndDate);

            if (existingClinker == null)
            {
                var createdClinker = _repository.AddNewClinker(newClinker);
                return(Created("", createdClinker));
            }
            else
            {
                return(BadRequest("Clinker already exists."));
            }
        }