From 0ae56c1282f426733aa70cc38d7bf6a6f4961782 Mon Sep 17 00:00:00 2001 From: Jeffrey Bakker Date: Sun, 13 Aug 2017 15:42:31 +0200 Subject: [PATCH] fix that a new card costs 7.50 --- src/main/java/honours/ing/banq/card/CardServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/honours/ing/banq/card/CardServiceImpl.java b/src/main/java/honours/ing/banq/card/CardServiceImpl.java index edb93e3..b6373ab 100644 --- a/src/main/java/honours/ing/banq/card/CardServiceImpl.java +++ b/src/main/java/honours/ing/banq/card/CardServiceImpl.java @@ -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) @@ -24,6 +27,9 @@ public class CardServiceImpl implements CardService { @Autowired private AuthService auth; + @Autowired + private TransactionService transactionService; + // Repositories @Autowired private CardRepository repository; @@ -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); } }