diff --git a/src/main/java/com/application/munera/services/ViewsService.java b/src/main/java/com/application/munera/services/ViewsService.java index cb16f65..bc375bf 100644 --- a/src/main/java/com/application/munera/services/ViewsService.java +++ b/src/main/java/com/application/munera/services/ViewsService.java @@ -65,7 +65,6 @@ public class ViewsService { case CREDIT -> isPaid ? BadgeMessage.PAID_TO_ME : BadgeMessage.OWED_TO_ME; case DEBIT -> isPaid ? BadgeMessage.PAID_BY_ME : BadgeMessage.OWED_BY_ME; case NONE -> isPaid ? BadgeMessage.PAID : BadgeMessage.NOT_PAID; - default -> BadgeMessage.UNKNOWN; }; } } diff --git a/src/main/java/com/application/munera/views/expenses/ExpensesView.java b/src/main/java/com/application/munera/views/expenses/ExpensesView.java index fd48fd3..99b3126 100644 --- a/src/main/java/com/application/munera/views/expenses/ExpensesView.java +++ b/src/main/java/com/application/munera/views/expenses/ExpensesView.java @@ -134,14 +134,12 @@ public class ExpensesView extends Div implements BeforeEnterObserver { } }); - // Configure Form - binder = new BeanValidationBinder<>(Expense.class); // Bind fields. This is where you'd define e.g. validation rules + binder = new BeanValidationBinder<>(Expense.class); binder.bindInstanceFields(this); binder.forField(name) .asRequired("Name is required") .bind(Expense::getName, Expense::setName); - binder.forField(cost) .asRequired("Cost is required") .withConverter(new StringToBigDecimalConverter("Invalid cost")) @@ -150,7 +148,6 @@ public class ExpensesView extends Div implements BeforeEnterObserver { binder.forField(category) .asRequired("Category is required") .bind(Expense::getCategory, Expense::setCategory); - binder.forField(date) .asRequired("Date is required") .bind(Expense::getDate, Expense::setDate);