generated from it-at-m/oss-repository-en-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from it-at-m/153-implementierung-wahldaten
153 implementierung wahldaten in eai-service
- Loading branch information
Showing
78 changed files
with
3,367 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
stack/keycloak/migration/add-authorities-eai-wahldaten.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
id: add authorities eai wahldaten | ||
author: MrSebastian | ||
realm: ${SSO_REALM} | ||
changes: | ||
- addRole: | ||
name: aoueai_BUSINESSACTION_LoadWahltage | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allEaiAuthorities | ||
role: aoueai_BUSINESSACTION_LoadWahltage | ||
clientId: ${SSO_CLIENT_ID} | ||
|
||
- addRole: | ||
name: aoueai_BUSINESSACTION_LoadWahlen | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allEaiAuthorities | ||
role: aoueai_BUSINESSACTION_LoadWahlen | ||
clientId: ${SSO_CLIENT_ID} | ||
|
||
- addRole: | ||
name: aoueai_BUSINESSACTION_LoadWahlbezirke | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allEaiAuthorities | ||
role: aoueai_BUSINESSACTION_LoadWahlbezirke | ||
clientId: ${SSO_CLIENT_ID} | ||
|
||
- addRole: | ||
name: aoueai_BUSINESSACTION_LoadWahlberechtigte | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allEaiAuthorities | ||
role: aoueai_BUSINESSACTION_LoadWahlberechtigte | ||
clientId: ${SSO_CLIENT_ID} | ||
|
||
- addRole: | ||
name: aoueai_BUSINESSACTION_LoadBasisdaten | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allEaiAuthorities | ||
role: aoueai_BUSINESSACTION_LoadBasisdaten | ||
clientId: ${SSO_CLIENT_ID} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...n/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/Stimmzettelgebiet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
import de.muenchen.oss.wahllokalsystem.eaiservice.domain.BaseEntity; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = true) | ||
@ToString(onlyExplicitlyIncluded = true, callSuper = true) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Stimmzettelgebiet extends BaseEntity { | ||
|
||
@ToString.Include | ||
private String nummer; | ||
|
||
@ToString.Include | ||
private String name; | ||
|
||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
@ToString.Include | ||
private Stimmzettelgebietsart stimmzettelgebietsart; | ||
|
||
@NotNull | ||
@ManyToOne | ||
@JoinColumn(name = "wahlID") | ||
private Wahl wahl; | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
...muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/StimmzettelgebietRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.UUID; | ||
import org.springframework.data.repository.CrudRepository; | ||
|
||
public interface StimmzettelgebietRepository extends CrudRepository<Stimmzettelgebiet, UUID> { | ||
|
||
List<Stimmzettelgebiet> findByWahlWahltagTagAndWahlWahltagNummer(LocalDate wahltag, String nummer); | ||
} |
5 changes: 5 additions & 0 deletions
5
...va/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/Stimmzettelgebietsart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
public enum Stimmzettelgebietsart { | ||
SB, SG, SK, WK | ||
} |
39 changes: 39 additions & 0 deletions
39
...rvice/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/Wahl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
import de.muenchen.oss.wahllokalsystem.eaiservice.domain.BaseEntity; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = true) | ||
@ToString(onlyExplicitlyIncluded = true, callSuper = true) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Wahl extends BaseEntity { | ||
|
||
@NotNull | ||
@ToString.Include | ||
private String name; | ||
|
||
@NotNull | ||
@ToString.Include | ||
@Enumerated(EnumType.STRING) | ||
private Wahlart wahlart; | ||
|
||
@NotNull | ||
@ManyToOne | ||
@JoinColumn(name = "wahltagID") | ||
private Wahltag wahltag; | ||
} |
11 changes: 11 additions & 0 deletions
11
...main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/WahlRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.UUID; | ||
import org.springframework.data.repository.CrudRepository; | ||
|
||
public interface WahlRepository extends CrudRepository<Wahl, UUID> { | ||
|
||
List<Wahl> findByWahltagTagAndWahltagNummer(LocalDate wahltag, String nummer); | ||
} |
5 changes: 5 additions & 0 deletions
5
...ce/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/Wahlart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
public enum Wahlart { | ||
BAW, BEB, BTW, BZW, EUW, LTW, MBW, OBW, SRW, SVW, VE | ||
} |
48 changes: 48 additions & 0 deletions
48
...src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/Wahlbezirk.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
import de.muenchen.oss.wahllokalsystem.eaiservice.domain.BaseEntity; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = true) | ||
@ToString(onlyExplicitlyIncluded = true, callSuper = true) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Wahlbezirk extends BaseEntity { | ||
|
||
@NotNull | ||
@ToString.Include | ||
@Enumerated(EnumType.STRING) | ||
private WahlbezirkArt wahlbezirkArt; | ||
|
||
@NotNull | ||
@ToString.Include | ||
private String nummer; | ||
|
||
@NotNull | ||
@ManyToOne | ||
@JoinColumn(name = "stimmzettelgebietID") | ||
private Stimmzettelgebiet stimmzettelgebiet; | ||
|
||
@ToString.Include | ||
private long a1; | ||
|
||
@ToString.Include | ||
private long a2; | ||
|
||
@ToString.Include | ||
private long a3; | ||
} |
5 changes: 5 additions & 0 deletions
5
.../main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/WahlbezirkArt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
public enum WahlbezirkArt { | ||
UWB, BWB | ||
} |
20 changes: 20 additions & 0 deletions
20
...ava/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/WahlbezirkRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.UUID; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.CrudRepository; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface WahlbezirkRepository extends CrudRepository<Wahlbezirk, UUID> { | ||
|
||
@Query( | ||
"SELECT wb FROM Wahlbezirk wb JOIN FETCH wb.stimmzettelgebiet sg JOIN FETCH sg.wahl w JOIN FETCH w.wahltag t WHERE t.tag = (:wahltag) AND t.nummer = (:nummer)" | ||
) | ||
List<Wahlbezirk> findWahlbezirkeWithStimmzettelgebietAndWahlAndWahltagByWahltagAndNummer(@Param("wahltag") LocalDate wahltag, | ||
@Param("nummer") String nummer); | ||
|
||
@Query("SELECT wb FROM Wahlbezirk wb JOIN FETCH wb.stimmzettelgebiet sg JOIN FETCH sg.wahl w JOIN FETCH w.wahltag t WHERE wb.id = (:wahlbezirkID)") | ||
List<Wahlbezirk> findWahlbezirkeWithStimmzettelgebietAndWahlAndWahltagByID(@Param("wahlbezirkID") UUID wahlbezirkID); | ||
} |
34 changes: 34 additions & 0 deletions
34
...ce/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/Wahltag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
import de.muenchen.oss.wahllokalsystem.eaiservice.domain.BaseEntity; | ||
import jakarta.persistence.Entity; | ||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = true) | ||
@ToString(onlyExplicitlyIncluded = true, callSuper = true) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Wahltag extends BaseEntity { | ||
|
||
@NotNull | ||
@ToString.Include | ||
private LocalDate tag; | ||
|
||
@NotNull | ||
@ToString.Include | ||
private String beschreibung; | ||
|
||
@NotNull | ||
@ToString.Include | ||
private String nummer; | ||
} |
11 changes: 11 additions & 0 deletions
11
.../java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahldaten/WahltageRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahldaten; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.UUID; | ||
import org.springframework.data.repository.CrudRepository; | ||
|
||
public interface WahltageRepository extends CrudRepository<Wahltag, UUID> { | ||
|
||
List<Wahltag> findByTagAfterOrTagEquals(LocalDate afterDate, LocalDate equalsDate); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.