diff --git a/BankingAppCore/src/main/java/com/simplytest/core/accounts/AccountRealEstate.java b/BankingAppCore/src/main/java/com/simplytest/core/accounts/AccountRealEstate.java index b411d84..74e3e07 100644 --- a/BankingAppCore/src/main/java/com/simplytest/core/accounts/AccountRealEstate.java +++ b/BankingAppCore/src/main/java/com/simplytest/core/accounts/AccountRealEstate.java @@ -20,14 +20,14 @@ protected AccountRealEstate() super(); } - public AccountRealEstate(double repaymentRate, double amount) + public AccountRealEstate(double repaymentRate, double creditAmount) { super(); this.repaymentRate = repaymentRate; - this.creditAmount = amount; + this.creditAmount = creditAmount; - setBalance(-amount); + setBalance(-creditAmount); } public double getMonthlyAmount() diff --git a/BankingAppCore/src/main/java/com/simplytest/core/contracts/Contract.java b/BankingAppCore/src/main/java/com/simplytest/core/contracts/Contract.java index 080bab9..b84c6be 100644 --- a/BankingAppCore/src/main/java/com/simplytest/core/contracts/Contract.java +++ b/BankingAppCore/src/main/java/com/simplytest/core/contracts/Contract.java @@ -125,9 +125,9 @@ public Pair openAccount(AccountType type) } public Pair openRealEstateAccount(double repaymentRate, - double amount) + double creditAmount) { - var rtn = new AccountRealEstate(repaymentRate, amount); + var rtn = new AccountRealEstate(repaymentRate, creditAmount); rtn.calculateMonthlyRate(); var id = this.id.create(); diff --git a/BankingAppServer/src/main/java/com/simplytest/server/BankingServer.java b/BankingAppServer/src/main/java/com/simplytest/server/BankingServer.java index e9308dc..b658f24 100644 --- a/BankingAppServer/src/main/java/com/simplytest/server/BankingServer.java +++ b/BankingAppServer/src/main/java/com/simplytest/server/BankingServer.java @@ -2,6 +2,7 @@ import java.util.Calendar; +import com.simplytest.server.apiData.RealEstateAccount; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -66,6 +67,11 @@ public void initializeDemo() controller.addAccount(result.value().JWT(), AccountType.FixedRateAccount); controller.registerContract(createDemoUser("Amanda", "123"), 0.0, response); + + var max = createDemoUser("Max", "demo"); + var contractMax = controller.registerContract(max, 0.0, response); + controller.addAccount(contractMax.value().JWT(), AccountType.OnCallAccount); + controller.addRealEstateAccount(contractMax.value().JWT(), new RealEstateAccount(5, 1000)); } public static void main(String[] args)