diff --git a/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/VisitDetails.java b/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/VisitDetails.java index 8dc66bdd0f..65f1780d9b 100644 --- a/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/VisitDetails.java +++ b/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/VisitDetails.java @@ -1,17 +1,19 @@ package com.petclinic.bffapigateway.dtos.Visits; + /* -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDateTime; -*/ + */ + /* @author Maciej Szarlinski Copied from https://github.com/spring-petclinic/spring-petclinic-microservices */ + /* @Data @NoArgsConstructor @@ -33,5 +35,6 @@ public class VisitDetails { private String description = null; private Status status = null; + private String billId = null; } */ \ No newline at end of file diff --git a/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/VisitResponseDTO.java b/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/VisitResponseDTO.java index fe2f6c9579..bd76420c31 100644 --- a/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/VisitResponseDTO.java +++ b/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/VisitResponseDTO.java @@ -28,4 +28,6 @@ public class VisitResponseDTO { private String vetEmail; private String vetPhoneNumber; private Status status; + private String billId; + private String customerId; } \ No newline at end of file diff --git a/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/Visits.java b/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/Visits.java index a57cf9a035..f5e31705a3 100644 --- a/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/Visits.java +++ b/api-gateway/src/main/java/com/petclinic/bffapigateway/dtos/Visits/Visits.java @@ -1,16 +1,20 @@ package com.petclinic.bffapigateway.dtos.Visits; + /* import lombok.Value; import java.util.ArrayList; import java.util.List; -*/ + */ + /* * @author Maciej Szarlinski * Copied from https://github.com/spring-petclinic/spring-petclinic-microservices */ + /* @Value public class Visits { private List items = new ArrayList<>(); } -*/ \ No newline at end of file + + */ diff --git a/api-gateway/src/main/resources/static/scripts/visit-list/visit-list.template.html b/api-gateway/src/main/resources/static/scripts/visit-list/visit-list.template.html index 78b10b6f32..fe4be3d7f2 100644 --- a/api-gateway/src/main/resources/static/scripts/visit-list/visit-list.template.html +++ b/api-gateway/src/main/resources/static/scripts/visit-list/visit-list.template.html @@ -172,7 +172,7 @@

Confirmed Visits

{{v.vetFirstName}} {{v.vetLastName}} {{v.petName}} - + {{v.billId}} {{v.status}} Cancelled Visits {{v.vetFirstName}} {{v.vetLastName}} {{v.petName}} - + {{v.billId}} {{v.status}} Completed Visits {{v.vetFirstName}} {{v.vetLastName}} {{v.petName}} - + {{v.billId}} {{v.status}} { - Assertions.assertTrue(response.getResponseBody().size() > 0); - VisitResponseDTO responseBody = response.getResponseBody().get(0); - // Asserting that the values match what's expected - Assertions.assertEquals(visitResponseDTO.getVisitId(), responseBody.getVisitId()); - Assertions.assertEquals(visitResponseDTO.getPetId(), responseBody.getPetId()); - Assertions.assertEquals(visitResponseDTO.getVisitDate(), responseBody.getVisitDate()); - Assertions.assertEquals(visitResponseDTO.getDescription(), responseBody.getDescription()); - Assertions.assertEquals(visitResponseDTO.getPractitionerId(), responseBody.getPractitionerId()); - }); - } - - @Test - void getVisitsByPractitionerId_Valid() { - 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("vet@email.com") - .vetPhoneNumber("123-456-7890") - .status(Status.UPCOMING) - .build(); - - when(visitsServiceClient.getVisitByPractitionerId(visitResponseDTO.getPractitionerId())).thenReturn(Flux.just(visitResponseDTO)); - - client.get() - .uri("/api/gateway/visits/vets/{practitionerId}", visitResponseDTO.getPractitionerId()) - .exchange() - .expectStatus().isOk() - .expectBodyList(VisitResponseDTO.class) - .consumeWith(response -> { - Assertions.assertTrue(response.getResponseBody().size() > 0); - VisitResponseDTO responseBody = response.getResponseBody().get(0); - - Assertions.assertEquals(visitResponseDTO.getVisitId(), responseBody.getVisitId()); - Assertions.assertEquals(visitResponseDTO.getPetId(), responseBody.getPetId()); - Assertions.assertEquals(visitResponseDTO.getVisitDate(), responseBody.getVisitDate()); - Assertions.assertEquals(visitResponseDTO.getDescription(), responseBody.getDescription()); - Assertions.assertEquals(visitResponseDTO.getPractitionerId(), responseBody.getPractitionerId()); - }); - } - // @Test // void getSingleVisit_Invalid() { @@ -3121,35 +3047,6 @@ void login_invalid() throws Exception { } - @Test - @DisplayName("Should Logout with a Valid Session, Clearing Bearer Cookie, and Returning 204") - void logout_shouldClearBearerCookie() { - MultiValueMap headers = new LinkedMultiValueMap<>(); - headers.add(HttpHeaders.COOKIE, "Bearer=some.token.value; Path=/; HttpOnly; SameSite=Lax"); - when(authServiceClient.logout(any(ServerHttpRequest.class), any(ServerHttpResponse.class))) - .thenReturn(Mono.just(ResponseEntity.noContent().build())); - client.post() - .uri("/api/gateway/users/logout") - .headers(httpHeaders -> httpHeaders.putAll(headers)) - .exchange() - .expectStatus().isNoContent() - .expectHeader().doesNotExist(HttpHeaders.SET_COOKIE); - } - - @Test - @DisplayName("Given Expired Session, Logout Should Return 401") - void logout_shouldReturnUnauthorizedForExpiredSession() { - MultiValueMap headers = new LinkedMultiValueMap<>(); - when(authServiceClient.logout(any(ServerHttpRequest.class), any(ServerHttpResponse.class))) - .thenReturn(Mono.just(ResponseEntity.status(HttpStatus.UNAUTHORIZED).build())); - client.post() - .uri("/api/gateway/users/logout") - .headers(httpHeaders -> httpHeaders.putAll(headers)) - .exchange() - .expectStatus().isUnauthorized() - .expectHeader().doesNotExist(HttpHeaders.SET_COOKIE); - } - private InventoryResponseDTO buildInventoryDTO(){ return InventoryResponseDTO.builder() @@ -3530,9 +3427,6 @@ void testAddProductToInventory_InvalidInventoryId_ShouldReturnNotFoundException( - - - private ProductResponseDTO buildProductDTO(){ return ProductResponseDTO.builder() .id("1") @@ -3555,11 +3449,6 @@ private VetResponseDTO buildVetResponseDTO() { .phoneNumber("947-238-2847") .resume("Just became a vet") .workday(new HashSet<>()) - .workHoursJson("{\n" + - " \"Monday\": [\"Hour_8_9\",\"Hour_9_10\",\"Hour_10_11\",\"Hour_11_12\",\"Hour_12_13\",\"Hour_13_14\",\"Hour_14_15\",\"Hour_15_16\"],\n" + - " \"Wednesday\": [\"Hour_12_13\",\"Hour_13_14\",\"Hour_14_15\",\"Hour_15_16\",\"Hour_16_17\",\"Hour_17_18\",\"Hour_18_19\",\"Hour_19_20\"],\n" + - " \"Thursday\": [\"Hour_10_11\",\"Hour_11_12\",\"Hour_12_13\",\"Hour_13_14\",\"Hour_14_15\",\"Hour_15_16\",\"Hour_16_17\",\"Hour_17_18\"]\n" + - " }") .specialties(new HashSet<>()) .active(false) .build(); @@ -3573,11 +3462,6 @@ private VetResponseDTO buildVetResponseDTO2() { .phoneNumber("947-238-2847") .resume("Just became a vet") .workday(new HashSet<>()) - .workHoursJson("{\n" + - " \"Monday\": [\"Hour_8_9\",\"Hour_9_10\",\"Hour_10_11\",\"Hour_11_12\",\"Hour_12_13\",\"Hour_13_14\",\"Hour_14_15\",\"Hour_15_16\"],\n" + - " \"Wednesday\": [\"Hour_12_13\",\"Hour_13_14\",\"Hour_14_15\",\"Hour_15_16\",\"Hour_16_17\",\"Hour_17_18\",\"Hour_18_19\",\"Hour_19_20\"],\n" + - " \"Thursday\": [\"Hour_10_11\",\"Hour_11_12\",\"Hour_12_13\",\"Hour_13_14\",\"Hour_14_15\",\"Hour_15_16\",\"Hour_16_17\",\"Hour_17_18\"]\n" + - " }") .specialties(new HashSet<>()) .active(true) .build(); @@ -3881,26 +3765,6 @@ public void getUserById_ValidUserId_ShouldReturnUser() { assertEquals(userDetails.getEmail(), u.getEmail()); }); } - - @Test - void deleteUserById_ValidUserId_ShouldDeleteUser() { - UserDetails userDetails = UserDetails.builder() - .userId("validUserId") - .username("validUsername") - .email("validEmail") - .build(); - - when(authServiceClient.deleteUser(anyString(), anyString())) - .thenReturn(Mono.empty()); - - client.delete() - .uri("/api/gateway/users/validUserId") - .cookie("Bearer", "validToken") - .exchange() - .expectStatus().isNoContent(); - } - - private EducationResponseDTO buildEducation(){ return EducationResponseDTO.builder() .educationId("1") diff --git a/billing-service/src/main/java/com/petclinic/billing/datalayer/DataSetupService.java b/billing-service/src/main/java/com/petclinic/billing/datalayer/DataSetupService.java index c37208315c..5814ed91c8 100644 --- a/billing-service/src/main/java/com/petclinic/billing/datalayer/DataSetupService.java +++ b/billing-service/src/main/java/com/petclinic/billing/datalayer/DataSetupService.java @@ -3,14 +3,14 @@ import com.petclinic.billing.businesslayer.BillService; import org.springframework.boot.CommandLineRunner; -import org.springframework.stereotype.Service; +import org.springframework.stereotype.Component; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.time.LocalDate; -@Service +@Component public class DataSetupService implements CommandLineRunner { private final BillService billService; public DataSetupService(BillService billService) { diff --git a/billing-service/src/main/java/com/petclinic/billing/presentationlayer/BillResource.java b/billing-service/src/main/java/com/petclinic/billing/presentationlayer/BillResource.java index 4c910da1c2..bb9e08bed2 100644 --- a/billing-service/src/main/java/com/petclinic/billing/presentationlayer/BillResource.java +++ b/billing-service/src/main/java/com/petclinic/billing/presentationlayer/BillResource.java @@ -14,6 +14,7 @@ import javax.validation.Valid; @RestController +@RequestMapping("") @Slf4j public class BillResource { private final BillService SERVICE; diff --git a/billing-service/src/main/resources/application.yml b/billing-service/src/main/resources/application.yml index 5f4fd4a1ea..8f8e14cd64 100644 --- a/billing-service/src/main/resources/application.yml +++ b/billing-service/src/main/resources/application.yml @@ -1,4 +1,5 @@ server.port: 7004 +server.error.include-message: always logging: level: @@ -22,8 +23,8 @@ app: host: localhost port: 7002 customers-service: - host: customers-service-reactive - port: 8090 + host: localhost + port: 7003 --- spring: config: diff --git a/docker-compose.yml b/docker-compose.yml index 08c4acc8f7..4291716530 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,11 +7,26 @@ services: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/njs:/etc/nginx/njs + billing-service: + build: billing-service + ports: + - "7004:8080" +# hostname: billing + #mem_limit: 350m + environment: + - SPRING_PROFILES_ACTIVE=docker + depends_on: + - mongo1 + # mysql5: + # condition: service_healthy + visits-service-new: build: visits-service-new + restart: always environment: - SPRING_PROFILES_ACTIVE=docker depends_on: + - billing-service - mongo2 - mailer-service @@ -46,6 +61,7 @@ services: environment: - SPRING_PROFILES_ACTIVE=docker depends_on: + - billing-service - customers-service-reactive - vet-service - visits-service-new @@ -63,16 +79,7 @@ services: environment: - SPRING_PROFILES_ACTIVE=docker - billing-service: - build: billing-service - hostname: billing - #mem_limit: 350m - environment: - - SPRING_PROFILES_ACTIVE=docker - depends_on: - - mongo1 - # mysql5: - # condition: service_healthy + mailer-service: build: mailer-service @@ -263,11 +270,11 @@ services: environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: password - # healthcheck: - # test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet - # retries: 5 - # interval: 15s - # start_period: 30s + #healthcheck: + #test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet + #retries: 5 + #interval: 15s + #start_period: 30s mongo-express1: image: mongo-express diff --git a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DataLayer/DataSetupService.java b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DataLayer/DataSetupService.java index 1c09f062f3..09c59571f3 100644 --- a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DataLayer/DataSetupService.java +++ b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DataLayer/DataSetupService.java @@ -1,31 +1,61 @@ package com.petclinic.visits.visitsservicenew.DataLayer; +import com.petclinic.visits.visitsservicenew.DomainClientLayer.BillResponseDTO; +import com.petclinic.visits.visitsservicenew.DomainClientLayer.BillServiceClient; import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; -import org.springframework.stereotype.Service; +import org.springframework.stereotype.Component; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; +import java.util.List; -@Service + +@Component @RequiredArgsConstructor public class DataSetupService implements CommandLineRunner { private final VisitRepo visitRepo; + @Autowired + private BillServiceClient billServiceClient; + + List billResponseList; + + List customerResponseList; + @Override public void run(String... args) throws Exception { - Visit visit1 = buildVisit("visitId1", "2022-11-24 13:00", "this is a dummy description", "ecb109cd-57ea-4b85-b51e-99751fd1c349", "69f852ca-625b-11ee-8c99-0242ac120002", Status.COMPLETED); - Visit visit2 = buildVisit("visitId2", "2022-03-01 13:00", "Dog Needs Meds", "0e4d8481-b611-4e52-baed-af16caa8bf8a", "69f85766-625b-11ee-8c99-0242ac120002", Status.COMPLETED); - Visit visit3 = buildVisit("visitId3", "2020-07-19 13:00","Dog Needs Surgery After Meds", "0e4d8481-b611-4e52-baed-af16caa8bf8a", "69f85bda-625b-11ee-8c99-0242ac120002", Status.COMPLETED); - Visit visit4 = buildVisit("visitId4", "2022-12-24 13:00", "Dog Needs Physio-Therapy", "0e4d8481-b611-4e52-baed-af16caa8bf8a", "69f85d2e-625b-11ee-8c99-0242ac120002", Status.UPCOMING); - Visit visit5 = buildVisit("visitId5", "2023-12-24 13:00", "Cat Needs Check-Up", "53163352-8398-4513-bdff-b7715c056d1d", "ac9adeb8-625b-11ee-8c99-0242ac120002", Status.UPCOMING); - Visit visit6 = buildVisit("visitId6", "2023-12-05 15:00", "Animal Needs Operation", "53163352-8398-4513-bdff-b7715c056d1d", "ac9adeb8-625b-11ee-8c99-0242ac120002", Status.UPCOMING); - Visit visit7 = buildVisit("visitId7", "2022-05-20 09:00", "Cat Needs Check-Up", "7056652d-f2fd-4873-a480-5d2e86bed641", "ac9adeb8-625b-11ee-8c99-0242ac120002", Status.CONFIRMED); + + Flux billResponseFlux = billServiceClient.getAllBilling(); + + Mono> customerResponseListMono = billResponseFlux.flatMap(s -> { + return Mono.just(s.getCustomerId()); + }).collectList(); + + customerResponseList = customerResponseListMono.block(); + + + Mono> billResponseListMono = billResponseFlux.flatMap(s -> { + return Mono.just(s.getBillId()); + }).collectList(); + + billResponseList = billResponseListMono.block(); + + Visit visit1 = buildVisit("visitId1", "2022-11-24 13:00", "this is a dummy description", "2", "69f852ca-625b-11ee-8c99-0242ac120002", Status.COMPLETED, billResponseList.get(0), customerResponseList.get(0)); + Visit visit2 = buildVisit("visitId2", "2022-03-01 13:00", "Dog Needs Meds", "1", "69f85766-625b-11ee-8c99-0242ac120002", Status.COMPLETED, billResponseList.get(2), customerResponseList.get(2)); + Visit visit3 = buildVisit("visitId3", "2020-07-19 13:00","Dog Needs Surgery After Meds", "1", "69f85bda-625b-11ee-8c99-0242ac120002", Status.COMPLETED, billResponseList.get(3), customerResponseList.get(3)); + Visit visit4 = buildVisit("visitId4", "2022-12-24 13:00", "Dog Needs Physio-Therapy", "1", "69f85d2e-625b-11ee-8c99-0242ac120002", Status.UPCOMING, billResponseList.get(4), customerResponseList.get(4)); + Visit visit5 = buildVisit("visitId5", "2023-12-24 13:00", "Cat Needs Check-Up", "4", "ac9adeb8-625b-11ee-8c99-0242ac120002", Status.UPCOMING, billResponseList.get(3), customerResponseList.get(3)); + Visit visit6 = buildVisit("visitId6", "2023-12-05 15:00", "Animals Needs Operation", "3", "ac9adeb8-625b-11ee-8c99-0242ac120002", Status.UPCOMING, billResponseList.get(1), customerResponseList.get(1)); + Visit visit7 = buildVisit("visitId7", "2022-05-20 09:00", "Cat Needs Check-Up", "4", "ac9adeb8-625b-11ee-8c99-0242ac120002", Status.CONFIRMED, billResponseList.get(2), customerResponseList.get(2)); + Flux.just(visit1, visit2, visit3, visit4, visit5, visit6, visit7).flatMap(x -> visitRepo.insert(Mono.just(x)).log(x.toString())).subscribe(); + } - private Visit buildVisit(String visitId, String visitDate, String description, String petId, String practitionerId, Status status){ + private Visit buildVisit(String visitId, String visitDate, String description, String petId, String practitionerId, Status status, String billId, String customerId){ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); LocalDateTime parsedVisitDate = LocalDateTime.parse(visitDate, formatter); @@ -36,7 +66,8 @@ private Visit buildVisit(String visitId, String visitDate, String description, S .petId(petId) .practitionerId(practitionerId) .status(status) + .billId(billId) + .customerId(customerId) .build(); } - } \ No newline at end of file diff --git a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DataLayer/Visit.java b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DataLayer/Visit.java index f42e6ad8a8..188e197d3d 100644 --- a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DataLayer/Visit.java +++ b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DataLayer/Visit.java @@ -28,4 +28,8 @@ public class Visit { private Status status; + private String billId; + + private String customerId; + } diff --git a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillRequestDTO.java b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillRequestDTO.java new file mode 100644 index 0000000000..8e80a94d44 --- /dev/null +++ b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillRequestDTO.java @@ -0,0 +1,23 @@ +package com.petclinic.visits.visitsservicenew.DomainClientLayer; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class BillRequestDTO { + + private String customerId; + private String visitType; + private String vetId; + private LocalDate date; + private double amount; + private BillStatus billStatus; + private LocalDate dueDate; +} diff --git a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillResponseDTO.java b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillResponseDTO.java new file mode 100644 index 0000000000..dab559cfe4 --- /dev/null +++ b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillResponseDTO.java @@ -0,0 +1,24 @@ +package com.petclinic.visits.visitsservicenew.DomainClientLayer; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class BillResponseDTO { + + private String billId; + private String customerId; + private String visitType; + private String vetId; + private LocalDate date; + private double amount; + private BillStatus billStatus; + private LocalDate dueDate; +} diff --git a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillServiceClient.java b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillServiceClient.java new file mode 100644 index 0000000000..46e8199596 --- /dev/null +++ b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillServiceClient.java @@ -0,0 +1,35 @@ +package com.petclinic.visits.visitsservicenew.DomainClientLayer; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; + + +@Component +public class BillServiceClient { + + private final WebClient.Builder webClientBuilder; + private final String billServiceUrl; + + + public BillServiceClient( + WebClient.Builder webClientBuilder, + @Value("${app.billing-service.host}") String billingServiceHost, + @Value("${app.billing-service.port}") String billingServicePort + ) { + this.webClientBuilder = webClientBuilder; + + billServiceUrl = "http://" + billingServiceHost + ":" + billingServicePort + "/bills"; + + } + public Flux getAllBilling() { + return webClientBuilder.build().get() + .uri(billServiceUrl) + .retrieve() + .bodyToFlux(BillResponseDTO.class); + } + +} + + diff --git a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillStatus.java b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillStatus.java new file mode 100644 index 0000000000..c72275d662 --- /dev/null +++ b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/DomainClientLayer/BillStatus.java @@ -0,0 +1,8 @@ +package com.petclinic.visits.visitsservicenew.DomainClientLayer; + +public enum BillStatus { + + PAID, + UNPAID, + OVERDUE +} diff --git a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/PresentationLayer/VisitResponseDTO.java b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/PresentationLayer/VisitResponseDTO.java index 5d549b71f5..0fa1c3c3b9 100644 --- a/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/PresentationLayer/VisitResponseDTO.java +++ b/visits-service-new/src/main/java/com/petclinic/visits/visitsservicenew/PresentationLayer/VisitResponseDTO.java @@ -29,4 +29,6 @@ public class VisitResponseDTO { private String vetEmail; private String vetPhoneNumber; private Status status; + private String billId; + private String customerId; } \ No newline at end of file diff --git a/visits-service-new/src/main/resources/application.yml b/visits-service-new/src/main/resources/application.yml index 6a3ff3720b..1279b50718 100644 --- a/visits-service-new/src/main/resources/application.yml +++ b/visits-service-new/src/main/resources/application.yml @@ -8,6 +8,9 @@ app: customers-service-reactive: host: localhost port: 8090 + billing-service: + host: localhost + port: 7004 auth-service: host: localhost port: 7005 @@ -78,9 +81,14 @@ app: host: mailer-service port: 8080 + billing-service: + host: billing-service + port: 8080 + logging: level: root: INFO com.petclinic: DEBUG -server.port: 8080 \ No newline at end of file +server: + port: 8080