-
Notifications
You must be signed in to change notification settings - Fork 0
EI-11 GET batches/{id} endpoint #46
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
8 commits
Select commit
Hold shift + click to select a range
f7d0027
EI-11 GET batches/{id} endpoint
dcarello 141248e
EI-18: Connected Delete batches/{id} to DB (#50)
dcarello c572d43
Updated where DTO is
dcarello 09ed898
Update BatchServiceTest.java
dcarello 3c0b2a0
Update BatchService.java
dcarello d79ce8d
Merge branch 'develop' into feature/EI-11
dcarello 34ea568
Unit Test/Mapping fix
dcarello 5b8da94
Merge branch 'develop' into feature/EI-11
dcarello 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
20 changes: 13 additions & 7 deletions
20
endpoint-insights-api/src/main/java/com/vsp/endpointinsightsapi/dto/BatchResponseDTO.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 |
|---|---|---|
| @@ -1,17 +1,23 @@ | ||
| package com.vsp.endpointinsightsapi.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
| import com.vsp.endpointinsightsapi.model.Job; | ||
| import lombok.*; | ||
|
|
||
| import java.time.LocalDate; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
|
|
||
| @Getter | ||
| @Setter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class BatchResponseDTO { | ||
| private Long id; | ||
| private String name; | ||
| private String status; | ||
| private UUID id; | ||
| private String batchName; | ||
| private Long scheduleId; | ||
| private LocalDate startTime; | ||
| private LocalDate lastTimeRun; | ||
| private Boolean active; | ||
| } |
14 changes: 14 additions & 0 deletions
14
...ights-api/src/main/java/com/vsp/endpointinsightsapi/exception/BatchNotFoundException.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,14 @@ | ||
| package com.vsp.endpointinsightsapi.exception; | ||
|
|
||
| import org.springframework.http.HttpStatus; | ||
|
|
||
| /** | ||
| * Thrown when a batch with the given ID does not exist in the database. | ||
| */ | ||
| public class BatchNotFoundException extends CustomException { | ||
|
|
||
| public BatchNotFoundException(String batchId) { | ||
| super(HttpStatus.NOT_FOUND, | ||
| new ErrorResponse("BATCH_NOT_FOUND", "Batch not found with ID: " + batchId, null)); | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
endpoint-insights-api/src/main/java/com/vsp/endpointinsightsapi/mapper/BatchMapper.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,14 @@ | ||
| package com.vsp.endpointinsightsapi.mapper; | ||
|
|
||
| import com.vsp.endpointinsightsapi.dto.BatchResponseDTO; | ||
| import com.vsp.endpointinsightsapi.model.TestBatch; | ||
| import org.mapstruct.Mapper; | ||
| import org.mapstruct.Mapping; | ||
|
|
||
| @Mapper(componentModel = "spring") | ||
| public interface BatchMapper { | ||
|
|
||
| // MapStruct will generate the implementation automatically | ||
| @Mapping(source = "batch_id", target = "id") | ||
| BatchResponseDTO toDto(TestBatch 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
3 changes: 0 additions & 3 deletions
3
endpoint-insights-api/src/main/resources/application.properties
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.