Commit d4b0c7b4 authored by Christos Tranoris's avatar Christos Tranoris
Browse files

fixes for offsetdates

parent 55b713e8
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -5,3 +5,4 @@
/.classpath
/.classpath
/.settings
/.settings
*.iml
*.iml
/.factorypath
+10 −1
Original line number Original line Diff line number Diff line
@@ -33,7 +33,6 @@ public class DayOfMonthRecurrence {
  @Column(name = "domr_schema_location")
  @Column(name = "domr_schema_location")
  private String schemaLocation;
  private String schemaLocation;


  @JsonProperty("dates")
  @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
  @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
  private OffsetDateTime dates;
  private OffsetDateTime dates;


@@ -120,6 +119,16 @@ public class DayOfMonthRecurrence {
  @Valid 
  @Valid 
  @Schema(name = "dates", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @Schema(name = "dates", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("dates")
  @JsonProperty("dates")
  public String getDatesString() {
    return dates.toString();
  }

  public void setDates(String dates) {
    if ( dates!= null ) {
      this.dates = OffsetDateTime.parse( dates );
  }
  }
  
  public OffsetDateTime getDates() {
  public OffsetDateTime getDates() {
    return dates;
    return dates;
  }
  }
+11 −2
Original line number Original line Diff line number Diff line
@@ -33,7 +33,6 @@ public class DayOfWeekRecurrence {
  @Column(name = "dowr_schema_location")
  @Column(name = "dowr_schema_location")
  private String schemaLocation;
  private String schemaLocation;


  @JsonProperty("dates")
  @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
  @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
  private OffsetDateTime dates;
  private OffsetDateTime dates;


@@ -119,11 +118,21 @@ public class DayOfWeekRecurrence {
  */
  */
  @Valid 
  @Valid 
  @Schema(name = "dates", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @Schema(name = "dates", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("dates")
  public OffsetDateTime getDates() {
  public OffsetDateTime getDates() {
    return dates;
    return dates;
  }
  }
  
  
  @JsonProperty("dates")
  public String getDatesString() {
    return dates.toString();
  }

  public void setDates(String dates) {
    if ( dates!= null ) {
      this.dates = OffsetDateTime.parse( dates );
  }
  }
  
  public void setDates(OffsetDateTime dates) {
  public void setDates(OffsetDateTime dates) {
    this.dates = dates;
    this.dates = dates;
  }
  }
+13 −2
Original line number Original line Diff line number Diff line
@@ -73,7 +73,7 @@ public class Event {
  @JsonProperty("eventId")
  @JsonProperty("eventId")
  protected String eventId= UUID.randomUUID().toString();
  protected String eventId= UUID.randomUUID().toString();


  @JsonProperty("eventTime")
 
  @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
  @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
  protected OffsetDateTime eventTime = OffsetDateTime.now(ZoneOffset.UTC);
  protected OffsetDateTime eventTime = OffsetDateTime.now(ZoneOffset.UTC);


@@ -441,15 +441,26 @@ public class Event {
  */
  */
  @Valid 
  @Valid 
  @Schema(name = "eventTime", description = "Time of the event occurrence.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @Schema(name = "eventTime", description = "Time of the event occurrence.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("eventTime")
  public OffsetDateTime getEventTime() {
  public OffsetDateTime getEventTime() {
    return eventTime;
    return eventTime;
  }
  }
  
  
  @JsonProperty("eventTime")
  public String getEventTimeString() {
      return eventTime.toString();
  }
  

  public void setEventTime(OffsetDateTime eventTime) {
  public void setEventTime(OffsetDateTime eventTime) {
    this.eventTime = eventTime;
    this.eventTime = eventTime;
  }
  }
  
  
  public void setEventTime(String eventTime) {
    if ( eventTime!= null ) {
        this.eventTime = OffsetDateTime.parse( eventTime );         
    }
}

  public Event eventType(String eventType) {
  public Event eventType(String eventType) {
    this.eventType = eventType;
    this.eventType = eventType;
    return this;
    return this;
+1 −0
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@ import java.util.Objects;
 */
 */


@JsonIgnoreProperties(
@JsonIgnoreProperties(
    ignoreUnknown = true,
  value = "@type", // ignore manually set @type, it will be automatically generated by Jackson during serialization
  value = "@type", // ignore manually set @type, it will be automatically generated by Jackson during serialization
  allowSetters = true // allows the @type to be set during deserialization
  allowSetters = true // allows the @type to be set during deserialization
)
)
Loading