change create group event + new group fields
This commit is contained in:
@ -19,15 +19,20 @@ public class Group extends Aggregate {
|
|||||||
private final List<User> members;
|
private final List<User> members;
|
||||||
private final Map<User, Role> roles;
|
private final Map<User, Role> roles;
|
||||||
|
|
||||||
|
private GroupType type;
|
||||||
|
private Visibility visibility;
|
||||||
|
private Long parent;
|
||||||
|
|
||||||
public Group() {
|
public Group() {
|
||||||
this.members = new ArrayList<>();
|
this.members = new ArrayList<>();
|
||||||
this.roles = new HashMap<>();
|
this.roles = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyEvent(CreateGroupEvent event) {
|
private void applyEvent(CreateGroupEvent event) {
|
||||||
title = event.getGroupTitle();
|
|
||||||
description = event.getGroupDescription();
|
|
||||||
id = event.getGroup_id();
|
id = event.getGroup_id();
|
||||||
|
visibility = event.getGroupVisibility();
|
||||||
|
parent = event.getGroupParent();
|
||||||
|
type = event.getGroupType();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyEvent(UpdateRoleEvent event) throws UserNotFoundException {
|
private void applyEvent(UpdateRoleEvent event) throws UserNotFoundException {
|
||||||
|
|||||||
@ -3,22 +3,21 @@ package mops.gruppen2.domain.event;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import mops.gruppen2.domain.GroupType;
|
||||||
|
import mops.gruppen2.domain.Visibility;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class CreateGroupEvent extends Event {
|
public class CreateGroupEvent extends Event {
|
||||||
String groupTitle;
|
private Visibility groupVisibility;
|
||||||
String groupDescription;
|
private Long groupParent;
|
||||||
|
private GroupType groupType;
|
||||||
|
|
||||||
public CreateGroupEvent(long event_id, Long group_id, String user_id, String groupTitle, String groupDescription) {
|
public CreateGroupEvent(Long group_id, String user_id, Long parent, GroupType type, Visibility visibility) {
|
||||||
super(event_id, group_id, user_id);
|
|
||||||
this.groupTitle = groupTitle;
|
|
||||||
this.groupDescription = groupDescription;
|
|
||||||
}
|
|
||||||
public CreateGroupEvent(Long group_id, String user_id, String groupTitle, String groupDescription) {
|
|
||||||
super(group_id, user_id);
|
super(group_id, user_id);
|
||||||
this.groupTitle = groupTitle;
|
this.groupParent = parent;
|
||||||
this.groupDescription = groupDescription;
|
this.groupType = type;
|
||||||
|
this.groupVisibility = visibility;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user