public async Task <long?> DepositAsync(IncreaseBalance command) { var card = await _repository.GetOrCreate(command.CardId); if (card.IsRemoved) { return(default);
public async Task <IActionResult> Deposit([FromRoute] Guid cardId, DepositFormModel model) { var id = new CardId(cardId); var money = new Money(model.Amount, model.Currency); var command = new IncreaseBalance(id, money); var version = await _cardService.DepositAsync(command); return(Ok(version)); }