private function buildRebalancerAction(ObjectManager $manager, User $client, $isHousehold = true)
 {
     $job1 = $this->getReference('job1');
     $clientPortfolioValue = $manager->getRepository('WealthbotClientBundle:ClientPortfolioValue')->getLastValueByClient($client);
     $rebalancerAction = new RebalancerAction();
     $rebalancerAction->setJob($job1);
     $rebalancerAction->setClientPortfolioValue($clientPortfolioValue);
     $rebalancerAction->setStartedAt(new \DateTime());
     if (!$isHousehold) {
         $clientAccountValue = $manager->getRepository('WealthbotClientBundle:ClientAccountValue')->getLastByDate($client);
         $rebalancerAction->setClientAccountValue($clientAccountValue);
         // setSystemClientAccount($systemAccounts->first());
     }
     return $rebalancerAction;
 }
 /**
  * @param Job $job
  * @param ClientPortfolio $clientPortfolio
  * @param SystemAccount $systemAccount
  * @return RebalancerAction
  */
 private function createRebalancerAction(Job $job, ClientPortfolioValue $clientPortfolioValue, ClientAccountValue $clientAccountValue = null)
 {
     $rebalancerAction = new RebalancerAction();
     $rebalancerAction->setJob($job);
     $rebalancerAction->setClientPortfolioValue($clientPortfolioValue);
     $rebalancerAction->setClientAccountValue($clientAccountValue);
     //rebalance proccess
     //HOLD
     //        $rebalancerAction->setFinishedAt(new \DateTime());
     return $rebalancerAction;
 }