Добавил тесты проведения, повторного проведения и изменения сумм операций
This commit is contained in:
1 parent
d264ed6583
commit
8af851a49a
18 files changed
+303
-35
No files matched your search
@@ -0,0 +1,52 @@
|
||||
package model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class LedgerEntry {
|
||||
private final LocalDate date;
|
||||
private final Long operationId;
|
||||
private final Account account;
|
||||
private final Category category;
|
||||
private final BigDecimal deltaAmount;
|
||||
|
||||
public LedgerEntry(LocalDate date, Long operationId, Account account, Category category, BigDecimal deltaAmount) {
|
||||
if (date == null) {
|
||||
throw new IllegalArgumentException("Не указана дата движения");
|
||||
}
|
||||
|
||||
if (operationId == null) {
|
||||
throw new IllegalArgumentException("Не указан ID операции");
|
||||
}
|
||||
|
||||
if (account == null) {
|
||||
throw new IllegalArgumentException("Не указан счёт движения");
|
||||
}
|
||||
|
||||
if (deltaAmount == null) {
|
||||
throw new IllegalArgumentException("Не указана сумма движения");
|
||||
}
|
||||
|
||||
this.date = date;
|
||||
this.operationId = operationId;
|
||||
this.account = account;
|
||||
this.category = category;
|
||||
this.deltaAmount = deltaAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getDeltaAmount() {
|
||||
return deltaAmount;
|
||||
}
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public Account getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public Long getOperationId() {
|
||||
return operationId;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user