mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 20:13:52 +00:00
Merge branch 'master' into foiling
This commit is contained in:
commit
853c1ee316
71 files changed
+1099
-669
No files matched your search
+2
-1
@@ -2662,7 +2662,8 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList());
|
||||
replicate(new CreateEvent(eventName, eventDescription, startDate, endDate, venue, isPublic, id,
|
||||
/* officialWebsiteURLAsString */null, /* sailorsInfoWebsiteURLAsString */null,
|
||||
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList()));
|
||||
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList(),
|
||||
/* leaderboardGroupIds */ Collections.<UUID> emptyList()));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+16
-2
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.server.operationaltransformation;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sailing.domain.base.Event;
|
||||
import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sailing.server.RacingEventServiceOperation;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
@@ -31,9 +34,10 @@ public class CreateEvent extends AbstractEventOperation<Event> {
|
||||
private final Iterable<VideoDescriptor> videos;
|
||||
private final URL officialWebsiteURL;
|
||||
private final Map<Locale, URL> sailorsInfoWebsiteURLs;
|
||||
private final Iterable<UUID> leaderboardGroupIds;
|
||||
|
||||
public CreateEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
|
||||
boolean isPublic, UUID id, URL officialWebsiteURL, Map<Locale, URL> sailorsInfoWebsiteURLs, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
|
||||
boolean isPublic, UUID id, URL officialWebsiteURL, Map<Locale, URL> sailorsInfoWebsiteURLs, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos, Iterable<UUID> leaderboardGroupIds) {
|
||||
super(id);
|
||||
this.eventName = eventName;
|
||||
this.eventDescription = eventDescription;
|
||||
@@ -45,6 +49,7 @@ public class CreateEvent extends AbstractEventOperation<Event> {
|
||||
this.sailorsInfoWebsiteURLs = sailorsInfoWebsiteURLs;
|
||||
this.images = images;
|
||||
this.videos = videos;
|
||||
this.leaderboardGroupIds = leaderboardGroupIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,8 +70,17 @@ public class CreateEvent extends AbstractEventOperation<Event> {
|
||||
|
||||
@Override
|
||||
public Event internalApplyTo(RacingEventService toState) {
|
||||
return toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic,
|
||||
final Event result = toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic,
|
||||
getId(), officialWebsiteURL, sailorsInfoWebsiteURLs, images, videos);
|
||||
List<LeaderboardGroup> lgl = new ArrayList<>();
|
||||
for (final UUID lgid : leaderboardGroupIds) {
|
||||
final LeaderboardGroup lg = toState.getLeaderboardGroupByID(lgid);
|
||||
if (lg != null) {
|
||||
lgl.add(lg);
|
||||
}
|
||||
}
|
||||
result.setLeaderboardGroups(lgl);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user