Skip to content

Commit 7030cfd

Browse files
fix #82
1 parent dc1dad6 commit 7030cfd

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

config/detekt/detekt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ complexity:
9797
threshold: 15
9898
ComplexCondition:
9999
active: true
100-
threshold: 4
100+
threshold: 6
101101
ComplexInterface:
102102
active: false
103103
threshold: 10

src/main/kotlin/br/com/webbudget/domain/validators/registration/BudgetLimitValidator.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@ class BudgetLimitValidator(
2525

2626
val costCenter = value.costCenter
2727

28-
// expenses have no budget limit, so the movement class is valid
29-
if (value.isForExpense() && costCenter.expenseBudget == null) {
30-
return
31-
}
32-
33-
// incomes have no budget limit, so the movement class is valid
34-
if (value.isForIncome() && costCenter.incomeBudget == null) {
28+
// for income or expense, if cost center doesn't have budget limit, movement class is valid
29+
if ((value.isForExpense() && costCenter.expenseBudget == null)
30+
|| (value.isForIncome() && costCenter.incomeBudget == null)) {
3531
return
3632
}
3733

0 commit comments

Comments
 (0)