-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for case notes functionality #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
457243b
Add support for case notes functionality
mattknatt c94036e
Configure Lombok as an annotation processor via Maven compiler plugin
mattknatt 3e8dda6
Merge remote-tracking branch 'origin/main' into feature/CaseNotes
mattknatt 738b7b7
Ensure `notes` field is initialized with an empty list if null
mattknatt 5a95b80
Merge branch 'main' into feature/CaseNotes
mattknatt b3ff9c1
fix fix
mattknatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
29 changes: 29 additions & 0 deletions
29
src/main/java/org/example/projektarendehantering/application/service/CaseNoteMapper.java
This file contains hidden or 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,29 @@ | ||
| package org.example.projektarendehantering.application.service; | ||
|
|
||
| import org.example.projektarendehantering.infrastructure.persistence.CaseNoteEntity; | ||
| import org.example.projektarendehantering.presentation.dto.CaseNoteDTO; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| @Component | ||
| public class CaseNoteMapper { | ||
|
|
||
| public CaseNoteDTO toDTO(CaseNoteEntity entity) { | ||
| if (entity == null) return null; | ||
| return new CaseNoteDTO( | ||
| entity.getId(), | ||
| entity.getContent(), | ||
| entity.getAuthor(), | ||
| entity.getCreatedAt() | ||
| ); | ||
| } | ||
|
|
||
| public CaseNoteEntity toEntity(CaseNoteDTO dto) { | ||
| if (dto == null) return null; | ||
| CaseNoteEntity entity = new CaseNoteEntity(); | ||
| entity.setId(dto.getId()); | ||
| entity.setContent(dto.getContent()); | ||
| entity.setAuthor(dto.getAuthor()); | ||
| entity.setCreatedAt(dto.getCreatedAt()); | ||
| return entity; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
35 changes: 35 additions & 0 deletions
35
...in/java/org/example/projektarendehantering/infrastructure/persistence/CaseNoteEntity.java
This file contains hidden or 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,35 @@ | ||
| package org.example.projektarendehantering.infrastructure.persistence; | ||
|
|
||
| import jakarta.persistence.*; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
|
|
||
| import java.time.Instant; | ||
| import java.util.UUID; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @Entity | ||
| @Table(name = "case_notes") | ||
| public class CaseNoteEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.UUID) | ||
| private UUID id; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "case_id") | ||
| private CaseEntity caseEntity; | ||
|
|
||
| private String content; | ||
|
|
||
| private String author; | ||
|
|
||
| private Instant createdAt; | ||
|
|
||
|
|
||
| } |
10 changes: 10 additions & 0 deletions
10
...ava/org/example/projektarendehantering/infrastructure/persistence/CaseNoteRepository.java
This file contains hidden or 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 org.example.projektarendehantering.infrastructure.persistence; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| @Repository | ||
| public interface CaseNoteRepository extends JpaRepository<CaseNoteEntity, UUID> { | ||
| } |
This file contains hidden or 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
33 changes: 33 additions & 0 deletions
33
src/main/java/org/example/projektarendehantering/presentation/dto/CaseNoteDTO.java
This file contains hidden or 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,33 @@ | ||
| package org.example.projektarendehantering.presentation.dto; | ||
|
|
||
| import java.time.Instant; | ||
| import java.util.UUID; | ||
|
|
||
| public class CaseNoteDTO { | ||
|
|
||
| private UUID id; | ||
| private String content; | ||
| private String author; | ||
| private Instant createdAt; | ||
|
|
||
| public CaseNoteDTO() {} | ||
|
|
||
| public CaseNoteDTO(UUID id, String content, String author, Instant createdAt) { | ||
| this.id = id; | ||
| this.content = content; | ||
| this.author = author; | ||
| this.createdAt = createdAt; | ||
| } | ||
|
|
||
| public UUID getId() { return id; } | ||
| public void setId(UUID id) { this.id = id; } | ||
|
|
||
| public String getContent() { return content; } | ||
| public void setContent(String content) { this.content = content; } | ||
|
|
||
| public String getAuthor() { return author; } | ||
| public void setAuthor(String author) { this.author = author; } | ||
|
|
||
| public Instant getCreatedAt() { return createdAt; } | ||
| public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } | ||
| } |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.