Skip to content

Commit

Permalink
계좌 식별자 필드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
gunkim committed May 18, 2024
1 parent a48de33 commit 25f2aed
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package io.github.gunkim.banking.domain;

public class Account {
private final AccountId id;
private Money balance;

public Account(Money balance) {
public Account(AccountId id, Money balance) {
this.id = id;
this.balance = balance;
}

public Account(Money balance) {
this(AccountId.createRandom(), balance);
}

public Money deposit(Money amount) {
this.balance = this.balance.plus(amount);

Expand Down

0 comments on commit 25f2aed

Please sign in to comment.