Skip to content

Commit

Permalink
merge: feat: default customer with RealEstate account added
Browse files Browse the repository at this point in the history
  • Loading branch information
axheim committed Jan 6, 2024
1 parent 5399e90 commit 4430d78
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ public Pair<Id, IAccount> openAccount(AccountType type)
}

public Pair<Id, IAccount> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4430d78

Please sign in to comment.