Skip to content

Commit

Permalink
Made code reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
mamartinezmejia committed Dec 3, 2024
1 parent 4b6f62c commit 405a84b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,35 +87,27 @@ public Flux<ClientListDto> fullSearch(
@RequestParam(required = false, defaultValue = "10") int size,
@RequestParam(required = false, defaultValue = "") String keyword,
ServerHttpResponse serverResponse) {

log.info("Listing clients: page={}, size={}, keyword={}", page, size, keyword);

return clientLegacyService
.search(
page,
size,
keyword
)
.doOnNext(pair -> {
Long count = pair.getSecond();

serverResponse
.getHeaders()
.putIfAbsent(
ApplicationConstant.X_TOTAL_COUNT,
List.of(count.toString())
);
}
)
.map(Pair::getFirst)
.doFinally(signalType ->
serverResponse
.getHeaders()
.putIfAbsent(
ApplicationConstant.X_TOTAL_COUNT,
List.of("0")
)
);
log.info("Listing clients: page={}, size={}, keyword={}", page, size, keyword);

return clientLegacyService
.search(page, size, keyword)
.doOnNext(pair -> {
Long count = pair.getSecond();

serverResponse
.getHeaders()
.putIfAbsent(
ApplicationConstant.X_TOTAL_COUNT,
List.of(count.toString()));
})
.map(Pair::getFirst)
.doFinally(signalType ->
serverResponse
.getHeaders()
.putIfAbsent(
ApplicationConstant.X_TOTAL_COUNT,
List.of("0")));
}

/**
Expand Down
52 changes: 25 additions & 27 deletions legacy/src/main/java/ca/bc/gov/app/dto/ForestClientDetailsDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,29 @@
import java.time.LocalDate;
import java.util.List;

public record ForestClientDetailsDto (
String clientNumber,
String clientName,
String legalFirstName,
String legalMiddleName,
String clientStatusCode,
String clientStatusDesc,
String clientTypeCode,
String clientTypeDesc,
String clientIdTypeCode,
String clientIdTypeDesc,
String clientIdentification,
String registryCompanyTypeCode,
String corpRegnNmbr,
String clientAcronym,
String wcbFirmNumber,
String clientComment,
LocalDate clientCommentUpdateDate,
String clientCommentUpdateUser,
String goodStandingInd,
LocalDate birthdate,

List<ForestClientLocationDto> addresses,
List<ForestClientContactDto> contacts,
List<ClientDoingBusinessAsDto> doingBusinessAs
) {

public record ForestClientDetailsDto(
String clientNumber,
String clientName,
String legalFirstName,
String legalMiddleName,
String clientStatusCode,
String clientStatusDesc,
String clientTypeCode,
String clientTypeDesc,
String clientIdTypeCode,
String clientIdTypeDesc,
String clientIdentification,
String registryCompanyTypeCode,
String corpRegnNmbr,
String clientAcronym,
String wcbFirmNumber,
String clientComment,
LocalDate clientCommentUpdateDate,
String clientCommentUpdateUser,
String goodStandingInd,
LocalDate birthdate,

List<ForestClientLocationDto> addresses,
List<ForestClientContactDto> contacts,
List<ClientDoingBusinessAsDto> doingBusinessAs) {
}

0 comments on commit 405a84b

Please sign in to comment.