Skip to content

Commit

Permalink
Merge pull request finos#4979 from deutschebank/db-contrib/waltz-4966…
Browse files Browse the repository at this point in the history
…_audit_log_change_decom_date

Db contrib/waltz 4966 audit log change decom date
  • Loading branch information
davidwatkins73 authored Jul 2, 2020
2 parents c80bc93 + d178fc6 commit 6dfe9e4
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package com.khartec.waltz.service.measurable_rating_planned_decommission;

import com.khartec.waltz.common.DateTimeUtilities;
import com.khartec.waltz.common.exception.UpdateFailedException;
import com.khartec.waltz.data.measurable_rating_planned_decommission.MeasurableRatingPlannedDecommissionDao;
import com.khartec.waltz.data.measurable_rating_replacement.MeasurableRatingReplacementDao;
Expand Down Expand Up @@ -90,13 +91,16 @@ public MeasurableRatingPlannedDecommission save(EntityReference entityReference,
measurableId));
} else {
MeasurableRatingPlannedDecommission plannedDecommission = measurableRatingPlannedDecommissionDao.getByEntityAndMeasurable(entityReference, measurableId);
String logMessage = operation.v1.equals(Operation.UPDATE)
? String.format("Updated planned decommission date: from %s to %s",
DateTimeUtilities.toLocalDate(dateChange.oldVal()),
plannedDecommission.plannedDecommissionDate())
: String.format("Added planned decommission date:%s", plannedDecommission.plannedDecommissionDate());

changeLogService.writeChangeLogEntries(
plannedDecommission,
userName,
format("%s planned decommission date: %s",
operation.v1.equals(Operation.ADD) ? "Added" : "Updated",
plannedDecommission.plannedDecommissionDate()),
logMessage,
operation.v1);

return plannedDecommission;
Expand Down

0 comments on commit 6dfe9e4

Please sign in to comment.