-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(VIST-CPC-927): implementing aggregation and details page #579
Merged
CrisWillCarry
merged 15 commits into
main
from
feat/VIST-CPC-927_Implementing_Aggregation_and_Details_Page
Oct 23, 2023
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
880cf91
weird connection closed happening
CrisWillCarry fbb8a4b
fixed issue, need to fix tests
CrisWillCarry 02e22ac
ready to rebase
CrisWillCarry 802f2f7
weird connection closed happening
CrisWillCarry 641e3a2
scared of this thing breaking everything
CrisWillCarry ef57686
ready to rebase
CrisWillCarry b178d95
good job me
CrisWillCarry 4062871
weird connection closed happening
CrisWillCarry 8cdb015
scared of this thing breaking everything
CrisWillCarry 5e54201
ready to rebase
CrisWillCarry 42fb61e
weird connection closed happening
CrisWillCarry c958e41
fixed issue, need to fix tests
CrisWillCarry a4fc2ca
ready to rebase
CrisWillCarry b67440d
actually ready to push to main
CrisWillCarry 1ad27c0
fixed test coverage
CrisWillCarry 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 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
7 changes: 7 additions & 0 deletions
7
api-gateway/src/main/resources/static/scripts/visit-details-info/visit.component.js
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,7 @@ | ||
'use strict'; | ||
|
||
angular.module('visit') | ||
.component('visit', { | ||
templateUrl: 'scripts/visit-details-info/visit.details.template.html', | ||
controller: 'VisitController' | ||
}); |
10 changes: 10 additions & 0 deletions
10
api-gateway/src/main/resources/static/scripts/visit-details-info/visit.controller.js
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 @@ | ||
angular.module('visit') | ||
.controller('VisitController', ['$http', '$stateParams', function ($http, $stateParams){ | ||
var self = this; | ||
|
||
$http.get('api/gateway/visits/' + $stateParams.visitId).then(function (resp) { | ||
self.visit = resp.data; | ||
}); | ||
|
||
|
||
}]) |
54 changes: 54 additions & 0 deletions
54
api-gateway/src/main/resources/static/scripts/visit-details-info/visit.details.template.html
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,54 @@ | ||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" rel="stylesheet"> | ||
<link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> | ||
|
||
<div class="container mt-5"> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<a class="btn btn-success" href="http://localhost:8080/#!/visitList">Back to Visits</a> | ||
</div> | ||
</div> | ||
<br> | ||
<div class="alert alert-danger" ng-if="$ctrl.visit.status === 'CANCELLED'"> | ||
NOTICE: This visit is cancelled. | ||
</div> | ||
<br> | ||
<div class="row"> | ||
<div class="col-md-4 text-start"> | ||
<h1 class="visit-title">VISIT(<span ng-style="{'color': $ctrl.visit.status === 'CANCELLED' ? 'red' : $ctrl.visit.status === 'UPCOMING' ? 'blue' : $ctrl.visit.status === 'CONFIRMED' ? 'green' : 'black'}">{{$ctrl.visit.status}}</span>)</h1> | ||
</div> | ||
<div class="col-md-4"></div> <!-- Empty column for spacing --> | ||
<div class="col-md-4 text-end"> | ||
<h3 class="visit-id">Visit ID: {{$ctrl.visit.visitId}}</h3> | ||
<h5>Date: {{$ctrl.visit.visitDate}}</h5> | ||
</div> | ||
<div class="col-md-4 text-start"> | ||
<h5>Visit Description: {{$ctrl.visit.description}}</h5> | ||
</div> | ||
</div> | ||
<hr> | ||
<div class="row g-5"> | ||
<div class="col-md-6"> | ||
<h3 class="text-center">Pet Information</h3> | ||
<h5>Pet ID: {{$ctrl.visit.petId}}</h5> | ||
<h5>Pet Name: {{$ctrl.visit.petName}} </h5> | ||
<h5>Birth Date: {{$ctrl.visit.petBirthDate | date: 'yyyy-MM-dd'}}</h5> | ||
<hr> | ||
<h3 class="text-center">Vet Information</h3> | ||
<h5>Vet ID: {{$ctrl.visit.practitionerId}}</h5> | ||
<h5>Vet Name: {{$ctrl.visit.vetFirstName}} {{$ctrl.visit.vetLastName}} </h5> | ||
<h5>Email: {{$ctrl.visit.vetEmail}}</h5> | ||
<h5>Phone Number: {{$ctrl.visit.vetPhoneNumber}}</h5> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.visit-title, .visit-id { | ||
font-size: 24px; | ||
font-weight: bold; | ||
} | ||
</style> | ||
|
||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script> |
11 changes: 11 additions & 0 deletions
11
api-gateway/src/main/resources/static/scripts/visit-details-info/visit.js
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 @@ | ||
'use strict'; | ||
|
||
angular.module('visit', ['ui.router']) | ||
.config(['$stateProvider', function ($stateProvider) { | ||
$stateProvider | ||
.state('visitDetails', { | ||
parent: 'app', | ||
url: '/visit/:visitId/details', | ||
template: '<visit></visit>' | ||
}); | ||
}]); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
import java.io.IOException; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.Arrays; | ||
import java.util.Date; | ||
import java.util.Objects; | ||
import java.util.UUID; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
@@ -63,8 +64,34 @@ static void tearDown() throws IOException { | |
|
||
@Test | ||
void getAllVisits() throws JsonProcessingException { | ||
VisitResponseDTO visitResponseDTO = new VisitResponseDTO("73b5c112-5703-4fb7-b7bc-ac8186811ae1", LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")), "this is a dummy description", "2", "2", Status.UPCOMING); | ||
VisitResponseDTO visitResponseDTO2 = new VisitResponseDTO("73b5c112-5703-4fb7-b7bc-ac8186811ae1", LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")), "this is a dummy description", "2", "2", Status.UPCOMING); | ||
VisitResponseDTO visitResponseDTO = VisitResponseDTO.builder() | ||
.visitId("73b5c112-5703-4fb7-b7bc-ac8186811ae1") | ||
.visitDate(LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))) | ||
.description("this is a dummy description") | ||
.petId("2") | ||
.petName("YourPetNameHere") | ||
.petBirthDate(new Date()) | ||
.practitionerId("2") | ||
.vetFirstName("VetFirstNameHere") | ||
.vetLastName("VetLastNameHere") | ||
.vetEmail("[email protected]") | ||
.vetPhoneNumber("123-456-7890") | ||
.status(Status.UPCOMING) | ||
.build(); | ||
VisitResponseDTO visitResponseDTO2 = VisitResponseDTO.builder() | ||
.visitId("73b5c112-5703-4fb7-b7bc-ac8186811ae1") | ||
.visitDate(LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))) | ||
.description("this is a dummy description") | ||
.petId("2") | ||
.petName("YourPetNameHere") | ||
.petBirthDate(new Date()) | ||
.practitionerId("2") | ||
.vetFirstName("VetFirstNameHere") | ||
.vetLastName("VetLastNameHere") | ||
.vetEmail("[email protected]") | ||
.vetPhoneNumber("123-456-7890") | ||
.status(Status.UPCOMING) | ||
.build(); | ||
server.enqueue(new MockResponse().setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) | ||
.setBody(objectMapper.writeValueAsString(Arrays.asList(visitResponseDTO, visitResponseDTO2))).addHeader("Content-Type", "application/json")); | ||
|
||
|
@@ -93,7 +120,20 @@ void getAllVisits_500Error()throws IllegalArgumentException{ | |
|
||
@Test | ||
void getVisitsForStatus() throws JsonProcessingException{ | ||
VisitResponseDTO visitResponseDTO = new VisitResponseDTO("773fa7b2-e04e-47b8-98e7-4adf7cfaaeee", LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")), "this is a dummy description", "2", "2", Status.UPCOMING); | ||
VisitResponseDTO visitResponseDTO = VisitResponseDTO.builder() | ||
.visitId("73b5c112-5703-4fb7-b7bc-ac8186811ae1") | ||
.visitDate(LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))) | ||
.description("this is a dummy description") | ||
.petId("2") | ||
.petName("YourPetNameHere") | ||
.petBirthDate(new Date()) | ||
.practitionerId("2") | ||
.vetFirstName("VetFirstNameHere") | ||
.vetLastName("VetLastNameHere") | ||
.vetEmail("[email protected]") | ||
.vetPhoneNumber("123-456-7890") | ||
.status(Status.UPCOMING) | ||
.build(); | ||
server.enqueue(new MockResponse().setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) | ||
.setBody(objectMapper.writeValueAsString(visitResponseDTO)).addHeader("Content-Type", "application/json")); | ||
|
||
|
@@ -114,14 +154,20 @@ void createVisitForPet_Valid() throws JsonProcessingException { | |
); | ||
|
||
// Mock the server response | ||
VisitResponseDTO visitResponseDTO = new VisitResponseDTO( | ||
"73b5c112-5703-4fb7-b7bc-ac8186811ae1", | ||
LocalDateTime.parse("2024-11-25 14:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")), | ||
"Test Visit", | ||
"1", | ||
"2", | ||
Status.UPCOMING | ||
); | ||
VisitResponseDTO visitResponseDTO = VisitResponseDTO.builder() | ||
.visitId("73b5c112-5703-4fb7-b7bc-ac8186811ae1") | ||
.visitDate(LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))) | ||
.description("this is a dummy description") | ||
.petId("2") | ||
.petName("YourPetNameHere") | ||
.petBirthDate(new Date()) | ||
.practitionerId("2") | ||
.vetFirstName("VetFirstNameHere") | ||
.vetLastName("VetLastNameHere") | ||
.vetEmail("[email protected]") | ||
.vetPhoneNumber("123-456-7890") | ||
.status(Status.UPCOMING) | ||
.build(); | ||
server.enqueue(new MockResponse() | ||
.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) | ||
.setBody(objectMapper.writeValueAsString(visitResponseDTO)) | ||
|
@@ -248,7 +294,20 @@ void createVisitForPet_InvalidErrorResponse_ThrowsBadRequestException() throws J | |
|
||
@Test | ||
void getVisitsForPet() throws Exception { | ||
VisitResponseDTO visitResponseDTO = new VisitResponseDTO("773fa7b2-e04e-47b8-98e7-4adf7cfaaeee", LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")), "this is a dummy description", "2", "2", Status.UPCOMING); | ||
VisitResponseDTO visitResponseDTO = VisitResponseDTO.builder() | ||
.visitId("73b5c112-5703-4fb7-b7bc-ac8186811ae1") | ||
.visitDate(LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))) | ||
.description("this is a dummy description") | ||
.petId("2") | ||
.petName("YourPetNameHere") | ||
.petBirthDate(new Date()) | ||
.practitionerId("2") | ||
.vetFirstName("VetFirstNameHere") | ||
.vetLastName("VetLastNameHere") | ||
.vetEmail("[email protected]") | ||
.vetPhoneNumber("123-456-7890") | ||
.status(Status.UPCOMING) | ||
.build(); | ||
server.enqueue(new MockResponse().setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE).setBody(objectMapper.writeValueAsString(visitResponseDTO)).addHeader("Content-Type", "application/json")); | ||
|
||
Flux<VisitResponseDTO> visits = visitsServiceClient.getVisitsForPet("2"); | ||
|
@@ -258,7 +317,21 @@ void getVisitsForPet() throws Exception { | |
} | ||
@Test | ||
void getVisitById() throws Exception { | ||
VisitResponseDTO visitResponseDTO = new VisitResponseDTO("773fa7b2-e04e-47b8-98e7-4adf7cfaaeee", LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")), "this is a dummy description", "2", "2", Status.UPCOMING); | ||
VisitResponseDTO visitResponseDTO = VisitResponseDTO.builder() | ||
.visitId("73b5c112-5703-4fb7-b7bc-ac8186811ae1") | ||
.visitDate(LocalDateTime.parse("2024-11-25 13:45", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))) | ||
.description("this is a dummy description") | ||
.petId("2") | ||
.petName("YourPetNameHere") | ||
.petBirthDate(new Date()) | ||
.practitionerId("2") | ||
.vetFirstName("VetFirstNameHere") | ||
.vetLastName("VetLastNameHere") | ||
.vetEmail("[email protected]") | ||
.vetPhoneNumber("123-456-7890") | ||
.status(Status.UPCOMING) | ||
.build(); | ||
|
||
server.enqueue(new MockResponse().setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE).setBody(objectMapper.writeValueAsString(visitResponseDTO)).addHeader("Content-Type", "application/json")); | ||
|
||
Mono<VisitResponseDTO> visitResponseDTOMono = visitsServiceClient.getVisitByVisitId("773fa7b2-e04e-47b8-98e7-4adf7cfaaeee"); | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing the missing td on the table.