public async Task DeliveredPackage(int id) { var package = await _dbContext.Packages.FirstOrDefaultAsync(x => x.Id == id); package.Status = PackageStatus.Delivered.ToString(); await _dbContext.SaveChangesAsync(); if (package.CourierId != null) { var link = _reviewService.CreateReviewLink(package.CourierId); await _reviewService.CreateReviewLink(package.CourierId, link, package.CustomerEmail); _reviewService.SendReviewLink(package.CustomerEmail, link); } }