--- /dev/null
+package hu.user.mcvodsync.db;
+
+import lombok.*;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+@Getter
+@Setter
+@Entity
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+public class PlaylistSync implements Serializable {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ Long id;
+
+ private String playlist;
+
+ @Column(nullable = false)
+ private Date imported;
+
+ @Enumerated(EnumType.STRING)
+ @Column(nullable = false)
+ private SyncType syncType;
+
+ private Date exportedSuccess;
+
+ private Date exportedError;
+}
--- /dev/null
+package hu.user.mcvodsync.service.xls;
+
+import lombok.Builder;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.commons.lang3.time.DurationFormatUtils;
+
+import java.time.Duration;
+import java.time.Instant;
+
+@Getter
+@Setter
+@Builder
+public class ImportSummary {
+ private Instant started;
+
+ private Instant finished;
+
+ private long all;
+
+ private long success;
+
+ private long error;
+
+ private long inserted;
+
+ private long updated;
+
+ private long deleted;
+
+ public String toString() {
+ Duration executionDuration = Duration.between(started, finished);
+ String duration = DurationFormatUtils.formatDuration(executionDuration.toMillis(), "H:mm:ss", true);
+ return String.format("Execution started at %s, finished at %s.", started, finished) +
+ System.lineSeparator() +
+ String.format("Process execution took %s on %d rows", duration, all) +
+ System.lineSeparator() +
+ String.format("Success count is %d, error count is %d", success, error) +
+ System.lineSeparator() +
+ String.format("Insert count is %d, update count is %d, delete count is %d", inserted, updated, deleted);
+ }
+
+ public void incError() {
+ error++;
+ }
+
+ public void incSuccess() {
+ success++;
+ }
+
+ public void incInserted() {
+ inserted++;
+ }
+
+ public void incUpdated() {
+ updated++;
+ }
+
+ public void incDeleted() {
+ inserted++;
+ }
+
+ public void incAll() {
+ all++;
+ }
+}