Добавил замену и удаление строк операций с проверкой на null
This commit is contained in:
1 parent
c734a3fa05
commit
d264ed6583
6 files changed
+77
-27
No files matched your search
@@ -7,10 +7,26 @@ public class LedgerEntry {
|
||||
private final LocalDate date;
|
||||
private final Long operationId;
|
||||
private final Account account;
|
||||
private Category category;
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user