From d0b40c725ef52a8515c79844fb92c02e35249f94 Mon Sep 17 00:00:00 2001 From: Maria Martinez Date: Mon, 7 Oct 2024 14:18:44 -0700 Subject: [PATCH 1/3] fix(FSADT1-1524): renamed field in query and renamed other field --- .../java/ca/bc/gov/app/repository/ForestClientRepository.java | 2 +- .../main/java/ca/bc/gov/app/service/ClientSearchService.java | 2 +- .../bc/gov/app/service/ClientSearchServiceIntegrationTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/legacy/src/main/java/ca/bc/gov/app/repository/ForestClientRepository.java b/legacy/src/main/java/ca/bc/gov/app/repository/ForestClientRepository.java index 88610a8ff2..9602653894 100644 --- a/legacy/src/main/java/ca/bc/gov/app/repository/ForestClientRepository.java +++ b/legacy/src/main/java/ca/bc/gov/app/repository/ForestClientRepository.java @@ -71,7 +71,7 @@ Flux findClientByIncorporationOrName( c.legal_middle_name as client_middle_name, cl.city as city, ctc.description as client_type, - csc.description as status_code, + csc.description as client_status, ( CASE WHEN c.client_number = :value THEN 112 ELSE 0 END + CASE WHEN c.CLIENT_ACRONYM = :value THEN 111 ELSE 0 END + diff --git a/legacy/src/main/java/ca/bc/gov/app/service/ClientSearchService.java b/legacy/src/main/java/ca/bc/gov/app/service/ClientSearchService.java index 279505e863..bb04638850 100644 --- a/legacy/src/main/java/ca/bc/gov/app/service/ClientSearchService.java +++ b/legacy/src/main/java/ca/bc/gov/app/service/ClientSearchService.java @@ -541,7 +541,7 @@ public Flux predictiveSearch(String value){ .findByPredictiveSearch(value.toUpperCase()) .doOnNext(dto -> log.info("Found predictive search for value {} as {} {} with score {}", value, - dto.clientNumber(), dto.name(), dto.score() + dto.clientNumber(), dto.fullName(), dto.score() ) ); } diff --git a/legacy/src/test/java/ca/bc/gov/app/service/ClientSearchServiceIntegrationTest.java b/legacy/src/test/java/ca/bc/gov/app/service/ClientSearchServiceIntegrationTest.java index f4354175dd..3aa73628d3 100644 --- a/legacy/src/test/java/ca/bc/gov/app/service/ClientSearchServiceIntegrationTest.java +++ b/legacy/src/test/java/ca/bc/gov/app/service/ClientSearchServiceIntegrationTest.java @@ -117,7 +117,7 @@ void shouldSearchWithPredictiveSearch( .assertNext(dto -> { assertNotNull(dto); assertEquals(expectedClientNumber, dto.clientNumber()); - assertEquals(expectedClientName, dto.name()); + assertEquals(expectedClientName, dto.fullName()); }); } test.verifyComplete(); From 82a5f5c6b6cead99f4d43f6368d90ed5edc876fc Mon Sep 17 00:00:00 2001 From: Maria Martinez Date: Mon, 7 Oct 2024 14:21:51 -0700 Subject: [PATCH 2/3] no message --- .../java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/src/main/java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java b/legacy/src/main/java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java index 63247198d0..bef53a0315 100644 --- a/legacy/src/main/java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java +++ b/legacy/src/main/java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java @@ -19,8 +19,8 @@ public record PredictiveSearchResultDto( long score ) { - @JsonProperty("name") - public String name() { + @JsonProperty("fullName") + public String fullName() { String finalName = Stream.of(this.clientFirstName, this.clientMiddleName, this.clientName) .filter(StringUtils::isNotBlank) .map(String::trim) From 63bd4b2f45e5a8f504de3cb35b914732e0d1d992 Mon Sep 17 00:00:00 2001 From: Maria Martinez Date: Mon, 7 Oct 2024 14:35:00 -0700 Subject: [PATCH 3/3] no message --- .../java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java | 4 ++-- .../main/java/ca/bc/gov/app/service/ClientSearchService.java | 2 +- .../gov/app/service/ClientSearchServiceIntegrationTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy/src/main/java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java b/legacy/src/main/java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java index bef53a0315..63247198d0 100644 --- a/legacy/src/main/java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java +++ b/legacy/src/main/java/ca/bc/gov/app/dto/PredictiveSearchResultDto.java @@ -19,8 +19,8 @@ public record PredictiveSearchResultDto( long score ) { - @JsonProperty("fullName") - public String fullName() { + @JsonProperty("name") + public String name() { String finalName = Stream.of(this.clientFirstName, this.clientMiddleName, this.clientName) .filter(StringUtils::isNotBlank) .map(String::trim) diff --git a/legacy/src/main/java/ca/bc/gov/app/service/ClientSearchService.java b/legacy/src/main/java/ca/bc/gov/app/service/ClientSearchService.java index bb04638850..279505e863 100644 --- a/legacy/src/main/java/ca/bc/gov/app/service/ClientSearchService.java +++ b/legacy/src/main/java/ca/bc/gov/app/service/ClientSearchService.java @@ -541,7 +541,7 @@ public Flux predictiveSearch(String value){ .findByPredictiveSearch(value.toUpperCase()) .doOnNext(dto -> log.info("Found predictive search for value {} as {} {} with score {}", value, - dto.clientNumber(), dto.fullName(), dto.score() + dto.clientNumber(), dto.name(), dto.score() ) ); } diff --git a/legacy/src/test/java/ca/bc/gov/app/service/ClientSearchServiceIntegrationTest.java b/legacy/src/test/java/ca/bc/gov/app/service/ClientSearchServiceIntegrationTest.java index 3aa73628d3..f4354175dd 100644 --- a/legacy/src/test/java/ca/bc/gov/app/service/ClientSearchServiceIntegrationTest.java +++ b/legacy/src/test/java/ca/bc/gov/app/service/ClientSearchServiceIntegrationTest.java @@ -117,7 +117,7 @@ void shouldSearchWithPredictiveSearch( .assertNext(dto -> { assertNotNull(dto); assertEquals(expectedClientNumber, dto.clientNumber()); - assertEquals(expectedClientName, dto.fullName()); + assertEquals(expectedClientName, dto.name()); }); } test.verifyComplete();