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 #315 from it-at-m/152-implementierung-wahlvorstand…
…sdaten 152 implementierung wahlvorstandsdaten
- Loading branch information
Showing
40 changed files
with
1,603 additions
and
36 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
stack/keycloak/migration/add-authorities-eai-wahlvorstand.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,21 @@ | ||
id: add authorities eai wahlvorstand | ||
author: MrSebastian | ||
realm: ${SSO_REALM} | ||
changes: | ||
- addRole: | ||
name: aoueai_BUSINESSACTION_LoadWahlvorstand | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allEaiAuthorities | ||
role: aoueai_BUSINESSACTION_LoadWahlvorstand | ||
clientId: ${SSO_CLIENT_ID} | ||
|
||
- addRole: | ||
name: aoueai_BUSINESSACTION_SaveAnwesenheit | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allEaiAuthorities | ||
role: aoueai_BUSINESSACTION_SaveAnwesenheit | ||
clientId: ${SSO_CLIENT_ID} |
15 changes: 15 additions & 0 deletions
15
stack/keycloak/migration/create-group-all-eai-authorities.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,15 @@ | ||
id: create group allEaiAuthorities and link wls_all* | ||
author: MrSebastian | ||
realm: ${SSO_REALM} | ||
changes: | ||
- addGroup: | ||
name: allEaiAuthorities | ||
- assignGroup: | ||
user: wls_all | ||
group: allEaiAuthorities | ||
- assignGroup: | ||
user: wls_all_uwb | ||
group: allEaiAuthorities | ||
- assignGroup: | ||
user: wls_all_bwb | ||
group: allEaiAuthorities |
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
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
39 changes: 39 additions & 0 deletions
39
...ain/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahlvorstand/Wahlvorstand.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.wahlvorstand; | ||
|
||
import static java.sql.Types.VARCHAR; | ||
|
||
import de.muenchen.oss.wahllokalsystem.eaiservice.domain.BaseEntity; | ||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.OneToMany; | ||
import jakarta.validation.constraints.NotNull; | ||
import java.util.Collection; | ||
import java.util.UUID; | ||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import org.hibernate.annotations.JdbcTypeCode; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = true) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ToString(onlyExplicitlyIncluded = true, callSuper = true) | ||
public class Wahlvorstand extends BaseEntity { | ||
|
||
@NotNull | ||
@ToString.Include | ||
@JdbcTypeCode(VARCHAR) | ||
private UUID wahlbezirkID; | ||
|
||
@OneToMany(cascade = CascadeType.ALL) | ||
@JoinColumn(name = "wahlvorstandid") | ||
private Collection<Wahlvorstandsmitglied> mitglieder; | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...e/muenchen/oss/wahllokalsystem/eaiservice/domain/wahlvorstand/WahlvorstandRepository.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,10 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahlvorstand; | ||
|
||
import java.util.Optional; | ||
import java.util.UUID; | ||
import org.springframework.data.repository.CrudRepository; | ||
|
||
public interface WahlvorstandRepository extends CrudRepository<Wahlvorstand, UUID> { | ||
|
||
Optional<Wahlvorstand> findFirstByWahlbezirkID(UUID wahlbezirkID); | ||
} |
43 changes: 43 additions & 0 deletions
43
...de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahlvorstand/Wahlvorstandsmitglied.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,43 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahlvorstand; | ||
|
||
import de.muenchen.oss.wahllokalsystem.eaiservice.domain.BaseEntity; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDateTime; | ||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = true) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ToString(onlyExplicitlyIncluded = true) | ||
public class Wahlvorstandsmitglied extends BaseEntity { | ||
|
||
@NotNull | ||
@ToString.Include | ||
private String vorname; | ||
|
||
@NotNull | ||
@ToString.Include | ||
private String nachname; | ||
|
||
@NotNull | ||
@ToString.Include | ||
@Enumerated(EnumType.STRING) | ||
private WahlvorstandsmitgliedsFunktion funktion; | ||
|
||
@ToString.Include | ||
private boolean anwesend; | ||
|
||
@ToString.Include | ||
private LocalDateTime anwesenheitUpdatedOn; | ||
} |
9 changes: 9 additions & 0 deletions
9
...en/oss/wahllokalsystem/eaiservice/domain/wahlvorstand/WahlvorstandsmitgliedsFunktion.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,9 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.domain.wahlvorstand; | ||
|
||
public enum WahlvorstandsmitgliedsFunktion { | ||
W, //Wahlvorsteher*in | ||
SB, //Schriftführer*in | ||
SWB, //Stellvertretung Wahlvorsteher*in | ||
SSB, //Stellvertretung Schriftführer*in | ||
B //Beisitzer*in | ||
} |
38 changes: 38 additions & 0 deletions
38
...ain/java/de/muenchen/oss/wahllokalsystem/eaiservice/exception/GlobalExceptionHandler.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,38 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.exception; | ||
|
||
import de.muenchen.oss.wahllokalsystem.wls.common.exception.errorhandler.AbstractExceptionHandler; | ||
import de.muenchen.oss.wahllokalsystem.wls.common.exception.rest.model.DTOMapper; | ||
import de.muenchen.oss.wahllokalsystem.wls.common.exception.rest.model.WlsExceptionDTO; | ||
import de.muenchen.oss.wahllokalsystem.wls.common.exception.util.ServiceIDFormatter; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ControllerAdvice; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
|
||
@ControllerAdvice | ||
@Slf4j | ||
public class GlobalExceptionHandler extends AbstractExceptionHandler { | ||
private final ServiceIDFormatter serviceIDFormatter; | ||
|
||
public GlobalExceptionHandler(final ServiceIDFormatter serviceIDFormatter, final DTOMapper dtoMapper) { | ||
super(dtoMapper); | ||
this.serviceIDFormatter = serviceIDFormatter; | ||
} | ||
|
||
@ExceptionHandler | ||
public ResponseEntity<WlsExceptionDTO> handleThrowables(final Throwable throwable) { | ||
log.info("handling throwable", throwable); | ||
return createResponse(getWahlExceptionDTO(throwable)); | ||
} | ||
|
||
@ExceptionHandler | ||
public ResponseEntity<Void> handleNotFoundException(final NotFoundException notFoundException) { | ||
log.debug("not found entity {} with id {}", notFoundException.getEntityClass(), notFoundException.getRequestedID()); | ||
return ResponseEntity.notFound().build(); | ||
} | ||
|
||
@Override | ||
protected String getService() { | ||
return serviceIDFormatter.getId(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/exception/NotFoundException.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,17 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.exception; | ||
|
||
import java.util.UUID; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class NotFoundException extends RuntimeException { | ||
|
||
private final UUID requestedID; | ||
|
||
private final Class<?> entityClass; | ||
|
||
public NotFoundException(UUID requestID, Class<?> entityClass) { | ||
this.requestedID = requestID; | ||
this.entityClass = entityClass; | ||
} | ||
} |
14 changes: 10 additions & 4 deletions
14
.../de/muenchen/oss/wahllokalsystem/eaiservice/rest/common/exception/ExceptionConstants.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
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
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
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
9 changes: 9 additions & 0 deletions
9
...s/wahllokalsystem/eaiservice/rest/wahlvorstand/dto/WahlvorstandsmitgliedsFunktionDTO.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,9 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.rest.wahlvorstand.dto; | ||
|
||
public enum WahlvorstandsmitgliedsFunktionDTO { | ||
W, //Wahlvorsteher*in | ||
SB, //Schriftführer*in | ||
SWB, //Stellvertretung Wahlvorsteher*in | ||
SSB, //Stellvertretung Schriftführer*in | ||
B //Beisitzer*in | ||
} |
Oops, something went wrong.