Skip to content

Commit

Permalink
[TASK] Added logging to rent expense actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisBurger committed Mar 31, 2024
1 parent 12a34d1 commit 7b63d58
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class ObjectRentExpenseService : AbstractService() {
obj.expenses.add(exp);
this.entityManager.persist(obj);
this.entityManager.flush();
this.log.writeLog("Added rent expense ($expense€, $type, $name) to object with ID ${obj.id}");
return exp;
}

Expand All @@ -69,6 +70,7 @@ class ObjectRentExpenseService : AbstractService() {
exp.type = type ?: exp.type;
this.entityManager.persist(exp);
this.entityManager.flush();
this.log.writeLog("Updated rent expense with ID ${exp.id}");
return exp;
}

Expand All @@ -85,6 +87,7 @@ class ObjectRentExpenseService : AbstractService() {
this.entityManager.persist(obj.realEstateObject);
this.entityManager.remove(obj);
this.entityManager.flush();
this.log.writeLog("Deleted rent expense with ID ${obj.id}");
}
}

Expand All @@ -107,6 +110,7 @@ class ObjectRentExpenseService : AbstractService() {
obj.credit?.nextCreditRate = AutoBookingUtils.getNextAutoPayIntervalDate(AutoPayInterval.MONTHLY);
this.entityManager.persist(obj.credit!!);
this.entityManager.flush();
this.log.writeLog("Updated auto booking by rent expenses on object with ID ${obj.id}");
return obj;
}
}

0 comments on commit 7b63d58

Please sign in to comment.