-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MORE2-5 set participants start datetime on registration
- Loading branch information
Thomas Kurz
committed
Nov 17, 2023
1 parent
9fa9913
commit 81d0963
Showing
16 changed files
with
280 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
src/main/java/io/redlink/more/data/model/SimpleParticipant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package io.redlink.more.data.model; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record SimpleParticipant( | ||
int id, | ||
String alias | ||
String alias, | ||
LocalDateTime start | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/main/java/io/redlink/more/data/model/scheduler/Duration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package io.redlink.more.data.model.scheduler; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
|
||
public class Duration { | ||
|
||
private Integer value; | ||
|
||
/** | ||
* unit of time to offset | ||
*/ | ||
public enum Unit { | ||
MINUTE("MINUTE"), | ||
|
||
HOUR("HOUR"), | ||
|
||
DAY("DAY"); | ||
|
||
private String value; | ||
|
||
Unit(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
|
||
@JsonCreator | ||
public static Unit fromValue(String value) { | ||
for (Unit b : Unit.values()) { | ||
if (b.value.equals(value)) { | ||
return b; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unexpected value '" + value + "'"); | ||
} | ||
} | ||
|
||
private Unit unit; | ||
|
||
public Duration() { | ||
} | ||
|
||
public Integer getValue() { | ||
return value; | ||
} | ||
|
||
public Duration setValue(Integer value) { | ||
this.value = value; | ||
return this; | ||
} | ||
|
||
public Unit getUnit() { | ||
return unit; | ||
} | ||
|
||
public Duration setUnit(Unit unit) { | ||
this.unit = unit; | ||
return this; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Duration{" + | ||
"offset=" + value + | ||
", unit=" + unit + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dlink/more/data/model/RecurrenceRule.java → .../data/model/scheduler/RecurrenceRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/io/redlink/more/data/model/scheduler/RelativeDate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.redlink.more.data.model.scheduler; | ||
|
||
public class RelativeDate { | ||
|
||
private Duration offset; | ||
private String time; | ||
|
||
public RelativeDate() { | ||
} | ||
|
||
public Duration getOffset() { | ||
return offset; | ||
} | ||
|
||
public RelativeDate setOffset(Duration offset) { | ||
this.offset = offset; | ||
return this; | ||
} | ||
|
||
public String getTime() { | ||
return time; | ||
} | ||
|
||
public RelativeDate setTime(String time) { | ||
this.time = time; | ||
return this; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/main/java/io/redlink/more/data/model/scheduler/RelativeEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package io.redlink.more.data.model.scheduler; | ||
|
||
public class RelativeEvent implements ScheduleEvent { | ||
|
||
public static final String TYPE = "RelativeEvent"; | ||
|
||
private String type; | ||
|
||
private RelativeDate dtstart; | ||
|
||
private RelativeDate dtend; | ||
|
||
private RelativeRecurrenceRule rrrule; | ||
|
||
public RelativeEvent() { | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return TYPE; | ||
} | ||
|
||
public RelativeEvent setType(String type) { | ||
this.type = type; | ||
return this; | ||
} | ||
|
||
public RelativeDate getDtstart() { | ||
return dtstart; | ||
} | ||
|
||
public RelativeEvent setDtstart(RelativeDate dtstart) { | ||
this.dtstart = dtstart; | ||
return this; | ||
} | ||
|
||
public RelativeDate getDtend() { | ||
return dtend; | ||
} | ||
|
||
public RelativeEvent setDtend(RelativeDate dtend) { | ||
this.dtend = dtend; | ||
return this; | ||
} | ||
|
||
public RelativeRecurrenceRule getRrrule() { | ||
return rrrule; | ||
} | ||
|
||
public RelativeEvent setRrrule(RelativeRecurrenceRule rrrule) { | ||
this.rrrule = rrrule; | ||
return this; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/io/redlink/more/data/model/scheduler/RelativeRecurrenceRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.redlink.more.data.model.scheduler; | ||
|
||
public class RelativeRecurrenceRule { | ||
|
||
private Duration frequency; | ||
|
||
private Duration endAfter; | ||
|
||
public RelativeRecurrenceRule() { | ||
} | ||
|
||
public Duration getFrequency() { | ||
return frequency; | ||
} | ||
|
||
public RelativeRecurrenceRule setFrequency(Duration frequency) { | ||
this.frequency = frequency; | ||
return this; | ||
} | ||
|
||
public Duration getEndAfter() { | ||
return endAfter; | ||
} | ||
|
||
public RelativeRecurrenceRule setEndAfter(Duration endAfter) { | ||
this.endAfter = endAfter; | ||
return this; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/io/redlink/more/data/model/scheduler/ScheduleEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.redlink.more.data.model.scheduler; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonSubTypes; | ||
import com.fasterxml.jackson.annotation.JsonTypeInfo; | ||
|
||
@JsonIgnoreProperties( | ||
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 | ||
) | ||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true, defaultImpl = Event.class) | ||
@JsonSubTypes({ | ||
@JsonSubTypes.Type(value = Event.class, name = Event.TYPE), | ||
@JsonSubTypes.Type(value = RelativeEvent.class, name = RelativeEvent.TYPE) | ||
}) | ||
public interface ScheduleEvent { | ||
public String getType(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.