Skip to content

Commit d033d50

Browse files
committed
Merge branch 'main' into MUXDBS-104-move-tasks
2 parents e3b9fa8 + ac44d22 commit d033d50

File tree

66 files changed

+2289
-1249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2289
-1249
lines changed

docs/package-lock.json

Lines changed: 582 additions & 458 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"@muenchen/prettier-codeformat": "1.0.2",
1717
"markdownlint-cli": "0.45.0",
18-
"mermaid": "11.10.1",
18+
"mermaid": "11.11.0",
1919
"vitepress": "1.6.4",
2020
"vitepress-plugin-mermaid": "2.0.17"
2121
}

personalization-service/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# For documentation see https://jboss-container-images.github.io/openjdk/
2-
FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.22-1.1753981256@sha256:06d60e73be11d96b4cedc4bd1807e503a6196e9b01be9e4405b6b6d3b816202d
2+
FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.23-6.1756793420@sha256:381e4f75c654b4e60b6a39147e803480f85bd3af7db291c0c522811c94f31848
33

44
# Copy runnable jar to deployments
55
COPY target/*.jar /deployments/application.jar

personalization-service/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<spotless-maven-plugin.version>2.46.1</spotless-maven-plugin.version>
3434
<itm-java-codeformat.version>1.0.10</itm-java-codeformat.version>
3535
<pmd-maven-plugin.version>3.27.0</pmd-maven-plugin.version>
36-
<spotbugs-maven-plugin.version>4.9.4.0</spotbugs-maven-plugin.version>
36+
<spotbugs-maven-plugin.version>4.9.4.2</spotbugs-maven-plugin.version>
3737
<spotbugs-annotations.version>4.9.4</spotbugs-annotations.version> <!-- must match the patch version of spotbugs-maven-plugin -->
3838
<findsecbugs-plugin.version>1.14.0</findsecbugs-plugin.version>
3939

@@ -53,7 +53,7 @@
5353

5454
<!-- Additional required dependencies -->
5555
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version> <!-- Needed to make MapStruct and Lombok work together -->
56-
<springdoc-openapi-starter-webmvc-ui.version>2.8.11</springdoc-openapi-starter-webmvc-ui.version>
56+
<springdoc-openapi-starter-webmvc-ui.version>2.8.13</springdoc-openapi-starter-webmvc-ui.version>
5757
<springdoc-openapi-maven-plugin.version>1.5</springdoc-openapi-maven-plugin.version>
5858
<therapi-runtime-javadoc.version>0.15.0</therapi-runtime-javadoc.version>
5959

personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist/ChecklistRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
@Repository
1010
public interface ChecklistRepository extends JpaRepository<Checklist, UUID> {
1111

12-
List<Checklist> findChecklistByEmail(String email);
12+
List<Checklist> findChecklistByLhmExtId(String lhmExtId);
1313

1414
}

personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist/ChecklistService.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,34 @@ public class ChecklistService {
2525
private final ChecklistRepository checklistRepository;
2626

2727
public Checklist createChecklist(final Checklist checklist) {
28-
final String userMail = getUserMailFromAuthenticationOrThrow();
29-
log.debug("Create Checklist {} for {}", checklist, userMail);
30-
checklist.setEmail(userMail);
28+
final String lhmExtId = getLhmExtIdFromAuthenticationOrThrow();
29+
log.debug("Create Checklist {} for {}", checklist, lhmExtId);
30+
checklist.setLhmExtId(lhmExtId);
3131
return checklistRepository.save(checklist);
3232
}
3333

3434
public List<Checklist> getChecklists() {
35-
final String userMail = getUserMailFromAuthenticationOrThrow();
36-
log.debug("Get all checklists of {}", userMail);
37-
return checklistRepository.findChecklistByEmail(userMail);
35+
final String lhmExtId = getLhmExtIdFromAuthenticationOrThrow();
36+
log.debug("Get all checklists of {}", lhmExtId);
37+
return checklistRepository.findChecklistByLhmExtId(lhmExtId);
3838
}
3939

4040
public Checklist getChecklist(final UUID checklistId) {
41-
final String userMail = getUserMailFromAuthenticationOrThrow();
42-
log.debug("Get checklist with ID {} for {}", checklistId, userMail);
41+
final String lhmExtId = getLhmExtIdFromAuthenticationOrThrow();
42+
log.debug("Get checklist with ID {} for {}", checklistId, lhmExtId);
4343
final Checklist checklistOrThrowException = getChecklistOrThrowException(checklistId);
4444

45-
isChecklistOwnerOrThrow(checklistOrThrowException, userMail);
45+
isChecklistOwnerOrThrow(checklistOrThrowException, lhmExtId);
4646

4747
return checklistOrThrowException;
4848
}
4949

5050
public Checklist updateChecklist(final Checklist checklist, final UUID checklistId) {
51-
final String userMail = getUserMailFromAuthenticationOrThrow();
52-
log.debug("Update checklist with ID {} for {}", checklistId, userMail);
51+
final String lhmExtId = getLhmExtIdFromAuthenticationOrThrow();
52+
log.debug("Update checklist with ID {} for {}", checklistId, lhmExtId);
5353
final Checklist foundChecklist = getChecklistOrThrowException(checklistId);
5454

55-
isChecklistOwnerOrThrow(foundChecklist, userMail);
55+
isChecklistOwnerOrThrow(foundChecklist, lhmExtId);
5656

5757
foundChecklist.setChecklistItems(checklist.getChecklistItems());
5858
foundChecklist.setLastUpdate(ZonedDateTime.now());
@@ -61,11 +61,11 @@ public Checklist updateChecklist(final Checklist checklist, final UUID checklist
6161
}
6262

6363
public void deleteChecklist(final UUID checklistId) {
64-
final String userMail = getUserMailFromAuthenticationOrThrow();
65-
log.debug("Delete Checklist with ID {} for {}", checklistId, userMail);
64+
final String lhmExtId = getLhmExtIdFromAuthenticationOrThrow();
65+
log.debug("Delete Checklist with ID {} for {}", checklistId, lhmExtId);
6666

6767
final Checklist foundChecklist = getChecklistOrThrowException(checklistId);
68-
isChecklistOwnerOrThrow(foundChecklist, userMail);
68+
isChecklistOwnerOrThrow(foundChecklist, lhmExtId);
6969

7070
checklistRepository.deleteById(checklistId);
7171
}
@@ -76,19 +76,19 @@ private Checklist getChecklistOrThrowException(final UUID checklistId) {
7676
.orElseThrow(() -> new NotFoundException(String.format(MSG_NOT_FOUND, checklistId)));
7777
}
7878

79-
private String getUserMailFromAuthenticationOrThrow() {
79+
private String getLhmExtIdFromAuthenticationOrThrow() {
8080
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
8181
if (authentication.getPrincipal() instanceof Jwt jwt) {
82-
final Object emailClaim = jwt.getClaims().get("email");
83-
if (emailClaim != null && !StringUtils.isBlank(emailClaim.toString())) {
84-
return emailClaim.toString();
82+
final Object lhmExtIdClaim = jwt.getClaims().get("lhmExtId");
83+
if (lhmExtIdClaim != null && !StringUtils.isBlank(lhmExtIdClaim.toString())) {
84+
return lhmExtIdClaim.toString();
8585
}
8686
}
8787
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED);
8888
}
8989

90-
private void isChecklistOwnerOrThrow(final Checklist checklist, final String userMail) {
91-
if (!checklist.getEmail().equals(userMail)) {
90+
private void isChecklistOwnerOrThrow(final Checklist checklist, final String lhmExtId) {
91+
if (!checklist.getLhmExtId().equals(lhmExtId)) {
9292
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "User does not own the checklist");
9393
}
9494
}

personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist/domain/Checklist.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public class Checklist extends BaseEntity {
2525
@Serial
2626
private static final long serialVersionUID = 1L;
2727

28-
@Column(name = "email", nullable = false)
28+
@Column(name = "lhm_ext_id", nullable = false)
2929
@NotNull
30-
private String email;
30+
private String lhmExtId;
3131

3232
@Column(name = "title")
3333
@NotNull

personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist/domain/ChecklistMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public interface ChecklistMapper {
1010
ChecklistReadDTO toReadDTO(Checklist checklist);
1111

1212
@Mapping(target = "id", ignore = true)
13-
@Mapping(target = "email", ignore = true)
13+
@Mapping(target = "lhmExtId", ignore = true)
1414
Checklist toCreateChecklist(ChecklistCreateDTO checklistUpdateDTO);
1515

1616
@Mapping(target = "id", ignore = true)

personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist/domain/ChecklistReadDTO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.util.List;
66
import java.util.UUID;
77

8-
public record ChecklistReadDTO(@NotNull UUID id, @NotNull String email, @NotNull String title, @NotNull ZonedDateTime lastUpdate,
8+
public record ChecklistReadDTO(@NotNull UUID id, @NotNull String lhmExtId, @NotNull String title, @NotNull ZonedDateTime lastUpdate,
99
@NotNull List<ChecklistItemDTO> checklistItems) {
1010

1111
}

personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist/domain/ChecklistUpdateDTO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
import java.util.List;
55
import java.util.UUID;
66

7-
public record ChecklistUpdateDTO(@NotNull UUID id, @NotNull String email, @NotNull String title, @NotNull List<ChecklistItemDTO> checklistItems) {
7+
public record ChecklistUpdateDTO(@NotNull UUID id, @NotNull String lhmExtId, @NotNull String title, @NotNull List<ChecklistItemDTO> checklistItems) {
88

99
}

0 commit comments

Comments
 (0)