Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ibrahimgunduz34/62843a744fe80c03c5d8263f578bc535 to your computer and use it in GitHub Desktop.

Select an option

Save ibrahimgunduz34/62843a744fe80c03c5d8263f578bc535 to your computer and use it in GitHub Desktop.
@Override
public FundTransaction handle(FundSellingTransactionCreate command) {
Fund fund = fundDataPort.retrieve(command.getCode());
Portfolio portfolio = portfolioDataPort.get(command.getUser(), command.getPortfolioId());
// TODO read the reference currency from the account profile later.
CurrencyCode referenceCurrencyCode = CurrencyCode.USD;
CurrencyRetrieveRate currencyRetrieveRateCmd = buildCurrencyRetrieveRate(
fund, referenceCurrencyCode, command);
CurrencyRate referenceCurrencyRate = publish(CurrencyRate.class, currencyRetrieveRateCmd);
return fundTransactionDataPort.createSellingTransaction(portfolio, fund, referenceCurrencyRate, command);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment