Пример #1
0
        public void AcceptOffer(int offerId, string employeeId)
        {
            var offer = _offerRepository.FindOfferById(offerId);

            if (offer == null)
            {
                throw new ObjectNotFoundException($"Offer with id={offerId} not found");
            }

            var employee = _employeeRepository.FindEmployeeById(employeeId);

            if (employee == null)
            {
                throw new ObjectNotFoundException($"Employee profile with id={employeeId} not found");
            }


            offer.OfferStatus  = OfferStatus.Accepted;
            offer.Job.Employee = employee;
            offer.Job.Status   = ProjectStatus.Closed;

            _offerRepository.Update(offer);
        }