diff --git a/src/main/java/com/redhat/labs/omp/model/CreationDetails.java b/src/main/java/com/redhat/labs/omp/model/CreationDetails.java index 8cc8297e..36f0a76e 100644 --- a/src/main/java/com/redhat/labs/omp/model/CreationDetails.java +++ b/src/main/java/com/redhat/labs/omp/model/CreationDetails.java @@ -1,7 +1,5 @@ package com.redhat.labs.omp.model; -import java.time.LocalDateTime; - import javax.json.bind.annotation.JsonbProperty; import lombok.AllArgsConstructor; @@ -20,6 +18,6 @@ public class CreationDetails { @JsonbProperty("created_by_email") private String createdByEmail; @JsonbProperty("created_on") - private LocalDateTime createdOn; + private String createdOn; } diff --git a/src/main/java/com/redhat/labs/omp/model/Launch.java b/src/main/java/com/redhat/labs/omp/model/Launch.java index 5aa6894c..a3ef83bc 100644 --- a/src/main/java/com/redhat/labs/omp/model/Launch.java +++ b/src/main/java/com/redhat/labs/omp/model/Launch.java @@ -1,7 +1,5 @@ package com.redhat.labs.omp.model; -import java.time.LocalDateTime; - import javax.json.bind.annotation.JsonbProperty; import lombok.AllArgsConstructor; @@ -16,7 +14,7 @@ public class Launch { @JsonbProperty("launched_date_time") - private LocalDateTime launchedDateTime; + private String launchedDateTime; @JsonbProperty("launched_by") private String launchedBy; diff --git a/src/main/java/com/redhat/labs/omp/service/EngagementService.java b/src/main/java/com/redhat/labs/omp/service/EngagementService.java index 0b7f98a3..b0c26793 100644 --- a/src/main/java/com/redhat/labs/omp/service/EngagementService.java +++ b/src/main/java/com/redhat/labs/omp/service/EngagementService.java @@ -1,6 +1,7 @@ package com.redhat.labs.omp.service; -import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; import java.util.Collection; import java.util.List; import java.util.Optional; @@ -271,7 +272,7 @@ public Engagement launch(Engagement engagement) { } // create new launch data for engagement - engagement.setLaunch(Launch.builder().launchedDateTime(LocalDateTime.now()) + engagement.setLaunch(Launch.builder().launchedDateTime(ZonedDateTime.now(ZoneId.of("Z")).toString()) .launchedBy(engagement.getLastUpdateByName()).build()); // update db diff --git a/src/main/java/com/redhat/labs/omp/service/GitSyncService.java b/src/main/java/com/redhat/labs/omp/service/GitSyncService.java index abceff71..4392899c 100644 --- a/src/main/java/com/redhat/labs/omp/service/GitSyncService.java +++ b/src/main/java/com/redhat/labs/omp/service/GitSyncService.java @@ -1,6 +1,7 @@ package com.redhat.labs.omp.service; -import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; import java.util.List; import javax.enterprise.context.ApplicationScoped; @@ -61,8 +62,7 @@ void consumeDbRefreshRequestedEvent(BackendEvent event) { }).subscribe().with(item -> { // create refresh event - BackendEvent refreshDbEvent = BackendEvent.createDatabaseRefreshEvent(item, - event.isForceUpdate()); + BackendEvent refreshDbEvent = BackendEvent.createDatabaseRefreshEvent(item, event.isForceUpdate()); // send event to bus for processing eventBus.sendAndForget(refreshDbEvent.getEventType().getEventBusAddress(), refreshDbEvent); }, failure -> { @@ -174,7 +174,8 @@ private void setCreationDetails(Engagement engagement) { // set creation details CreationDetails creationDetails = CreationDetails.builder().createdByUser(engagement.getLastUpdateByName()) - .createdByEmail(engagement.getLastUpdateByEmail()).createdOn(LocalDateTime.now()).build(); + .createdByEmail(engagement.getLastUpdateByEmail()) + .createdOn(ZonedDateTime.now(ZoneId.of("Z")).toString()).build(); engagement.setCreationDetails(creationDetails); }