diff --git a/buisnesslogic/src/main/java/com/plannaplan/entities/Event.java b/buisnesslogic/src/main/java/com/plannaplan/entities/Event.java new file mode 100644 index 0000000..8edf34c --- /dev/null +++ b/buisnesslogic/src/main/java/com/plannaplan/entities/Event.java @@ -0,0 +1,32 @@ +package com.plannaplan.entities; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import com.plannaplan.types.EventTypes; + +@Entity +public class Event { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + private EventTypes type; + @ManyToOne + @JoinColumn(name = "user_id") + private User user; + + public Event() { + } + + public EventTypes getType() { + return type; + } + + public void setType(EventTypes type) { + this.type = type; + } +} \ No newline at end of file diff --git a/buisnesslogic/src/main/java/com/plannaplan/repositories/EventRepository.java b/buisnesslogic/src/main/java/com/plannaplan/repositories/EventRepository.java new file mode 100644 index 0000000..5639fc9 --- /dev/null +++ b/buisnesslogic/src/main/java/com/plannaplan/repositories/EventRepository.java @@ -0,0 +1,11 @@ +package com.plannaplan.repositories; + +import com.plannaplan.entities.Event; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface EventRepository extends JpaRepository { + +} \ No newline at end of file diff --git a/buisnesslogic/src/main/java/com/plannaplan/services/EventService.java b/buisnesslogic/src/main/java/com/plannaplan/services/EventService.java new file mode 100644 index 0000000..c21b8ea --- /dev/null +++ b/buisnesslogic/src/main/java/com/plannaplan/services/EventService.java @@ -0,0 +1,12 @@ +package com.plannaplan.services; + +import com.plannaplan.repositories.EventRepository; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class EventService { + @Autowired + private EventRepository repo; +} \ No newline at end of file diff --git a/buisnesslogic/src/main/java/com/plannaplan/types/EventTypes.java b/buisnesslogic/src/main/java/com/plannaplan/types/EventTypes.java new file mode 100644 index 0000000..73ca9b0 --- /dev/null +++ b/buisnesslogic/src/main/java/com/plannaplan/types/EventTypes.java @@ -0,0 +1,5 @@ +package com.plannaplan.types; + +public enum EventTypes { + DROPPED_OUT, TOUR_STARTED, TRANSFER_FOUND, TOUR_FINISHED, COURSES_ACCEPTED +} \ No newline at end of file