Skip to content

Commit

Permalink
Added meetingTime and meetingPoint to Event
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikEmmerich committed Sep 10, 2024
1 parent 9f9d773 commit 535dcbe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public EventModel toModel(final Event dto) {
dto.getName(),
dto.getDescription(),
dto.getMaxParticipants(),
dto.getNeedsBirthInformation()
dto.getNeedsBirthInformation(),
dto.getMeetingTime(),
dto.getMeetingPoint()
);
}

Expand All @@ -41,7 +43,9 @@ public Event toDto(final EventModel model) {
model.getDescription(),
model.getMaxParticipants(),
model.getMaxParticipants() - this.eventParticipationRepository.countAllByEventId(model.getId()),
model.getNeedsBirthInformation()
model.getNeedsBirthInformation(),
model.getMeetingTime(),
model.getMeetingPoint()
);
}

Expand All @@ -56,6 +60,8 @@ public void override(final EventModel model, final Event dto) {
model.setDescription(dto.getDescription());
model.setMaxParticipants(dto.getMaxParticipants());
model.setNeedsBirthInformation(dto.getNeedsBirthInformation());
model.setMeetingTime(dto.getMeetingTime());
model.setMeetingPoint(dto.getMeetingPoint());
}

@Override
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/edu/kit/physik/ophasenanmelder/dto/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.AllArgsConstructor;
import lombok.Data;

import java.time.OffsetDateTime;
import java.util.UUID;

@Data
Expand All @@ -19,20 +20,26 @@ public class Event implements Validatable {
private final Integer maxParticipants;
private final Integer freeSpots;
private final Boolean needsBirthInformation;
private final OffsetDateTime meetingTime;
private final String meetingPoint;

@JsonCreator
public Event(final UUID eventTypeId,
final String name,
final String description,
final Integer maxParticipants,
final Boolean needsBirthInformation) {
final Boolean needsBirthInformation,
final OffsetDateTime meetingTime,
final String meetingPoint) {
this.id = null;
this.eventTypeId = eventTypeId;
this.name = name;
this.description = description;
this.maxParticipants = maxParticipants;
this.freeSpots = null;
this.needsBirthInformation = needsBirthInformation;
this.meetingTime = meetingTime;
this.meetingPoint = meetingPoint;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.OffsetDateTime;

@Entity
@Setter
@Getter
Expand All @@ -34,4 +36,10 @@ public class EventModel extends TableModelAutoId {

@Column(name = "needs_birth_information", nullable = false)
private Boolean needsBirthInformation;

@Column(name = "meeting_time")
private OffsetDateTime meetingTime;

@Column(name = "meeting_point")
private String meetingPoint;
}

0 comments on commit 535dcbe

Please sign in to comment.