Skip to content

Commit

Permalink
Merge pull request #51 from jeffreybakker/fix/extenion_3
Browse files Browse the repository at this point in the history
fix that a new card costs 7.50
  • Loading branch information
jeffreybakker authored Aug 13, 2017
2 parents 659ae0d + 0ae56c1 commit 53b3f71
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/honours/ing/banq/card/CardServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
import honours.ing.banq.auth.InvalidPINError;
import honours.ing.banq.auth.NotAuthorizedError;
import honours.ing.banq.customer.Customer;
import honours.ing.banq.transaction.TransactionService;
import honours.ing.banq.util.IBANUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;

@Service
@AutoJsonRpcServiceImpl
@Transactional(readOnly = true)
Expand All @@ -24,6 +27,9 @@ public class CardServiceImpl implements CardService {
@Autowired
private AuthService auth;

@Autowired
private TransactionService transactionService;

// Repositories
@Autowired
private CardRepository repository;
Expand Down Expand Up @@ -66,6 +72,9 @@ public NewCardBean invalidateCard(String authToken, String iBAN, String pinCard,
repository.save(old);
repository.save(res);

transactionService.forceTransactionAccount(
res.getAccount().getCheckingAccount(), new BigDecimal("-7.50"), "New PIN card");

return new NewCardBean(res);
}
}

0 comments on commit 53b3f71

Please sign in to comment.