Skip to content

Commit

Permalink
fix: Always use system time for createdAt in events [DHIS2-18252]
Browse files Browse the repository at this point in the history
  • Loading branch information
enricocolasante committed Oct 18, 2024
1 parent e13f862 commit fe7eac0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private ValuesHolder getAuditAndDateParameters(EventDataValue eventDataValue, Da

if (isNewDataValue(eventDataValue, dv)) {
eventDataValue = new EventDataValue();
eventDataValue.setCreated(getFromOrNewDate(dv, DataValue::getCreatedAt));
eventDataValue.setCreated(new Date());
eventDataValue.setLastUpdated(getFromOrNewDate(dv, DataValue::getUpdatedAt));
persistedValue = dv.getValue();
auditType = AuditType.CREATE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ private ProgramStageInstance from(
for (DataValue dataValue : event.getDataValues()) {
EventDataValue eventDataValue = new EventDataValue();
eventDataValue.setValue(dataValue.getValue());
eventDataValue.setCreated(DateUtils.fromInstant(dataValue.getCreatedAt()));
eventDataValue.setLastUpdated(new Date());
eventDataValue.setProvidedElsewhere(dataValue.isProvidedElsewhere());
// ensure dataElement is referred to by UID as multiple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
},
{
"updatedAt": "2019-03-04T15:12:59.209",
"createdAt": "2019-03-04T15:01:29.793",
"dataElement": "z3Z4TD3oBCP",
"value": "true",
"providedElsewhere": false
Expand Down

0 comments on commit fe7eac0

Please sign in to comment.