Skip to content

Commit

Permalink
feat(be): Added missing status codes for Admin (#1405)
Browse files Browse the repository at this point in the history
* feat(be): Added missing status codes for Admin

* chore: Added javadocs
  • Loading branch information
mamartinezmejia authored Feb 4, 2025
1 parent 7e698fc commit f34a2cb
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ public Flux<Pair<ClientListDto, Long>> search(int page, int size, String keyword
});
}

/**
* Retrieves active client status codes from the legacy system.
*
* @return a Flux containing {@link CodeNameDto} objects representing active client statuses.
*/
public Flux<CodeNameDto> findActiveClientStatusCodes() {
log.info("Searching for active client statuses in legacy");

Expand All @@ -442,14 +447,20 @@ public Flux<CodeNameDto> findActiveClientStatusCodes() {
.get()
.uri("/api/codes/client-statuses")
.exchangeToFlux(response -> response.bodyToFlux(CodeNameDto.class))
// Log the results for debugging purposes
.doOnNext(
dto -> log.info(
"Found active client statuses in legacy"
)
);
}

/**
* Retrieves active client status codes filtered by client type and role from the legacy system.
*
* @param clientTypeCode the client type code to filter by.
* @param groups the set of roles to filter by.
* @return a Flux containing filtered {@link CodeNameDto} objects.
*/
public Flux<CodeNameDto> findActiveClientStatusCodesByClientTypeAndRole(
String clientTypeCode, Set<String> groups) {

Expand Down Expand Up @@ -478,6 +489,7 @@ else if (groups.contains(ApplicationConstant.ROLE_EDITOR)) {
private Set<String> getAdminStatuses(String clientTypeCode) {
return switch (clientTypeCode) {
case "B", "F", "G" -> Set.of("ACT", "DAC", "SPN");
case "I", "A" -> Set.of("ACT", "DEC", "REC", "SPN");
default -> Set.of("ACT", "DAC", "REC", "SPN");
};
}
Expand All @@ -490,6 +502,11 @@ private Set<String> getEditorStatuses(String clientTypeCode) {
};
}

/**
* Retrieves active registry type codes from the legacy system.
*
* @return a Flux containing {@link CodeNameDto} objects representing active registry types.
*/
public Flux<CodeNameDto> findActiveRegistryTypeCodes() {
log.info("Searching for active registry types in legacy");

Expand Down

0 comments on commit f34a2cb

Please sign in to comment.