1

temporarily disable tests + rough change from groupid to uuid + remove invitelink old system

This commit is contained in:
Christoph
2020-03-23 16:17:17 +01:00
parent fff8a8a730
commit d562df8826
27 changed files with 152 additions and 384 deletions

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* Repräsentiert den aggregierten Zustand einer Gruppe.
@ -17,13 +18,13 @@ public class Group {
private final List<User> members;
private final Map<String, Role> roles;
private Long id;
private UUID id;
private String title;
private String description;
private Long userMaximum;
private GroupType type;
private Visibility visibility;
private Long parent;
private UUID parent;
public Group() {
this.members = new ArrayList<>();

View File

@ -12,7 +12,7 @@ public class EventDTO {
@Id
Long event_id;
Long group_id;
String group_id;
String user_id;
String event_type;
String event_payload;

View File

@ -12,6 +12,6 @@ public class InviteLinkDTO {
@Id
Long link_id;
Long group_id;
String group_id;
String invite_link;
}

View File

@ -10,6 +10,8 @@ import mops.gruppen2.domain.exception.EventException;
import mops.gruppen2.domain.exception.GroupFullException;
import mops.gruppen2.domain.exception.UserAlreadyExistsException;
import java.util.UUID;
/**
* Fügt einen einzelnen Nutzer einer Gruppe hinzu.
*/
@ -22,7 +24,7 @@ public class AddUserEvent extends Event {
private String familyname;
private String email;
public AddUserEvent(Long groupId, String userId, String givenname, String familyname, String email) {
public AddUserEvent(UUID groupId, String userId, String givenname, String familyname, String email) {
super(groupId, userId);
this.givenname = givenname;
this.familyname = familyname;

View File

@ -7,17 +7,19 @@ import mops.gruppen2.domain.Group;
import mops.gruppen2.domain.GroupType;
import mops.gruppen2.domain.Visibility;
import java.util.UUID;
@Getter
@AllArgsConstructor
@NoArgsConstructor // For Jackson
public class CreateGroupEvent extends Event {
private Visibility groupVisibility;
private Long groupParent;
private UUID groupParent;
private GroupType groupType;
private Long groupUserMaximum;
public CreateGroupEvent(Long groupId, String userId, Long parent, GroupType type, Visibility visibility, Long userMaximum) {
public CreateGroupEvent(UUID groupId, String userId, UUID parent, GroupType type, Visibility visibility, Long userMaximum) {
super(groupId, userId);
this.groupParent = parent;
this.groupType = type;

View File

@ -4,11 +4,13 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import mops.gruppen2.domain.Group;
import java.util.UUID;
@Getter
@NoArgsConstructor // For Jackson
public class DeleteGroupEvent extends Event {
public DeleteGroupEvent(Long groupId, String userId) {
public DeleteGroupEvent(UUID groupId, String userId) {
super(groupId, userId);
}

View File

@ -7,6 +7,8 @@ import mops.gruppen2.domain.User;
import mops.gruppen2.domain.exception.EventException;
import mops.gruppen2.domain.exception.UserNotFoundException;
import java.util.UUID;
/**
* Entfernt ein einzelnes Mitglied einer Gruppe.
*/
@ -14,7 +16,7 @@ import mops.gruppen2.domain.exception.UserNotFoundException;
@NoArgsConstructor // For Jackson
public class DeleteUserEvent extends Event {
public DeleteUserEvent(Long groupId, String userId) {
public DeleteUserEvent(UUID groupId, String userId) {
super(groupId, userId);
}

View File

@ -9,6 +9,8 @@ import mops.gruppen2.domain.Group;
import mops.gruppen2.domain.exception.EventException;
import mops.gruppen2.domain.exception.GroupIdMismatchException;
import java.util.UUID;
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
@ -28,7 +30,7 @@ import mops.gruppen2.domain.exception.GroupIdMismatchException;
@AllArgsConstructor
public abstract class Event {
protected Long groupId;
protected UUID groupId;
protected String userId;
public void apply(Group group) throws EventException {
@ -38,7 +40,7 @@ public abstract class Event {
protected abstract void applyEvent(Group group) throws EventException;
private void checkGroupIdMatch(Long groupId) {
private void checkGroupIdMatch(UUID groupId) {
if (groupId == null || this.groupId.equals(groupId)) {
return;
}

View File

@ -6,6 +6,8 @@ import lombok.NoArgsConstructor;
import mops.gruppen2.domain.Group;
import mops.gruppen2.domain.exception.NoValueException;
import java.util.UUID;
/**
* Ändert nur die Gruppenbeschreibung.
*/
@ -16,7 +18,7 @@ public class UpdateGroupDescriptionEvent extends Event {
private String newGroupDescription;
public UpdateGroupDescriptionEvent(Long groupId, String userId, String newGroupDescription) {
public UpdateGroupDescriptionEvent(UUID groupId, String userId, String newGroupDescription) {
super(groupId, userId);
this.newGroupDescription = newGroupDescription;
}

View File

@ -6,6 +6,8 @@ import lombok.NoArgsConstructor;
import mops.gruppen2.domain.Group;
import mops.gruppen2.domain.exception.NoValueException;
import java.util.UUID;
/**
* Ändert nur den Gruppentitel.
*/
@ -16,7 +18,7 @@ public class UpdateGroupTitleEvent extends Event {
private String newGroupTitle;
public UpdateGroupTitleEvent(Long groupId, String userId, String newGroupTitle) {
public UpdateGroupTitleEvent(UUID groupId, String userId, String newGroupTitle) {
super(groupId, userId);
this.newGroupTitle = newGroupTitle;
}

View File

@ -7,6 +7,8 @@ import mops.gruppen2.domain.Group;
import mops.gruppen2.domain.Role;
import mops.gruppen2.domain.exception.UserNotFoundException;
import java.util.UUID;
/**
* Aktualisiert die Gruppenrolle eines Teilnehmers.
*/
@ -17,7 +19,7 @@ public class UpdateRoleEvent extends Event {
private Role newRole;
public UpdateRoleEvent(Long groupId, String userId, Role newRole) {
public UpdateRoleEvent(UUID groupId, String userId, Role newRole) {
super(groupId, userId);
this.newRole = newRole;
}