test_class.declarator: PERCENT_OFFSET = offset(0.000000000001d)
test_class.modifier: private static final
test_class.original_string: private static final Offset<Double> PERCENT_OFFSET = offset(0.000000000001d);
test_class.type: Offset<Double>
test_class.var_name: PERCENT_OFFSET
test_class.declarator: portofolioService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private PortofolioService portofolioService;
test_class.type: PortofolioService
test_class.var_name: portofolioService
test_class.declarator: portofolioRepo
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private PortofolioRepository portofolioRepo;
test_class.type: PortofolioRepository
test_class.var_name: portofolioRepo
test_class.file: trading-common/src/test/java/fr/ymanvieu/trading/common/portofolio/PortofolioServiceTest.java
test_class.identifier: PortofolioServiceTest
test_case.body: @Test
  	public void testGetAvailableSymbols_Toto() {
  		String login = "toto";
  
  		List<Symbol> symbols = portofolioService.getAvailableSymbols(login);
  
  		assertThat(symbols).extracting("code").containsExactly("RR", "UBI", USD);
  	}
test_case.class_method_signature: PortofolioServiceTest.testGetAvailableSymbols_Toto()
test_case.full_signature: @Test public void testGetAvailableSymbols_Toto()
test_case.identifier: testGetAvailableSymbols_Toto
test_case.invocations: getAvailableSymbols containsExactly extracting assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetAvailableSymbols_Toto()
focal_class.declarator: userRepo
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private UserRepository userRepo;
focal_class.type: UserRepository
focal_class.var_name: userRepo
focal_class.declarator: portofolioRepo
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private PortofolioRepository portofolioRepo;
focal_class.type: PortofolioRepository
focal_class.var_name: portofolioRepo
focal_class.declarator: symbolRepo
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private SymbolRepository symbolRepo;
focal_class.type: SymbolRepository
focal_class.var_name: symbolRepo
focal_class.declarator: rateService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private RateService rateService;
focal_class.type: RateService
focal_class.var_name: rateService
focal_class.declarator: symbolMapper
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private SymbolMapper symbolMapper;
focal_class.type: SymbolMapper
focal_class.var_name: symbolMapper
focal_class.file: trading-common/src/main/java/fr/ymanvieu/trading/common/portofolio/PortofolioService.java
focal_class.identifier: PortofolioService
focal_class.class_method_signature: PortofolioService.createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_class.full_signature: public Portofolio createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_class.identifier: createPortofolio
focal_class.modifiers: public
focal_class.parameters: (String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_class.return: Portofolio
focal_class.signature: Portofolio createPortofolio(String login, String baseCurrencyCode, int baseCurrencyAmount)
focal_class.class_method_signature: PortofolioService.getBaseCurrency(String login)
focal_class.full_signature: public AssetInfo getBaseCurrency(String login)
focal_class.identifier: getBaseCurrency
focal_class.modifiers: public
focal_class.parameters: (String login)
focal_class.return: AssetInfo
focal_class.signature: AssetInfo getBaseCurrency(String login)
focal_class.class_method_signature: PortofolioService.getPortofolio(String login)
focal_class.full_signature: public Portofolio getPortofolio(String login)
focal_class.identifier: getPortofolio
focal_class.modifiers: public
focal_class.parameters: (String login)
focal_class.return: Portofolio
focal_class.signature: Portofolio getPortofolio(String login)
focal_class.class_method_signature: PortofolioService.getAsset(AssetEntity ae)
focal_class.full_signature: protected AssetInfo getAsset(AssetEntity ae)
focal_class.identifier: getAsset
focal_class.modifiers: protected
focal_class.parameters: (AssetEntity ae)
focal_class.return: AssetInfo
focal_class.signature: AssetInfo getAsset(AssetEntity ae)
focal_class.class_method_signature: PortofolioService.getOrderInfo(String login, String symbolCode, double quantity)
focal_class.full_signature: public OrderInfo getOrderInfo(String login, String symbolCode, double quantity)
focal_class.identifier: getOrderInfo
focal_class.modifiers: public
focal_class.parameters: (String login, String symbolCode, double quantity)
focal_class.return: OrderInfo
focal_class.signature: OrderInfo getOrderInfo(String login, String symbolCode, double quantity)
focal_class.class_method_signature: PortofolioService.getAvailableSymbols(String login)
focal_class.full_signature: public List<Symbol> getAvailableSymbols(String login)
focal_class.identifier: getAvailableSymbols
focal_class.modifiers: public
focal_class.parameters: (String login)
focal_class.return: List<Symbol>
focal_class.signature: List<Symbol> getAvailableSymbols(String login)
focal_class.class_method_signature: PortofolioService.buy(String login, String code, double quantity)
focal_class.full_signature: public Order buy(String login, String code, double quantity)
focal_class.identifier: buy
focal_class.modifiers: public
focal_class.parameters: (String login, String code, double quantity)
focal_class.return: Order
focal_class.signature: Order buy(String login, String code, double quantity)
focal_class.class_method_signature: PortofolioService.sell(String login, String code, double quantity)
focal_class.full_signature: public Order sell(String login, String code, double quantity)
focal_class.identifier: sell
focal_class.modifiers: public
focal_class.parameters: (String login, String code, double quantity)
focal_class.return: Order
focal_class.signature: Order sell(String login, String code, double quantity)
focal_method.body: public List<Symbol> getAvailableSymbols(String login) {
  
  		PortofolioEntity portofolio = portofolioRepo.findByUserUsername(login);
  
  		List<SymbolEntity> ownedCurrencies = portofolio.getCurrencies();
  		List<SymbolEntity> ownedAssets = portofolio.getAssets().stream().map(a -> a.getSymbol()).collect(toList());
  
  		BooleanExpression exp = symbolEntity.notIn(ownedAssets) //
  				.and(symbolEntity.notIn(ownedCurrencies)) //
  				.and(symbolEntity.currency.in(ownedCurrencies) //
  						.and(symbolEntity.code.in(select(pairEntity.source.code).from(pairEntity))) //
  						.or(symbolEntity.currency.isNull()));
  
  		return symbolMapper.mapToSymbols(symbolRepo.findAll(exp, symbolEntity.code.asc()));
  	}
focal_method.class_method_signature: PortofolioService.getAvailableSymbols(String login)
focal_method.full_signature: public List<Symbol> getAvailableSymbols(String login)
focal_method.identifier: getAvailableSymbols
focal_method.invocations: findByUserUsername getCurrencies collect map stream getAssets getSymbol toList and and notIn notIn or and in in from select isNull mapToSymbols findAll asc
focal_method.modifiers: public
focal_method.parameters: (String login)
focal_method.return: List<Symbol>
focal_method.signature: List<Symbol> getAvailableSymbols(String login)