diff --git a/backend/src/main/java/ca/bc/gov/app/service/client/ClientLegacyService.java b/backend/src/main/java/ca/bc/gov/app/service/client/ClientLegacyService.java index aa3612cd8..cead33ab2 100644 --- a/backend/src/main/java/ca/bc/gov/app/service/client/ClientLegacyService.java +++ b/backend/src/main/java/ca/bc/gov/app/service/client/ClientLegacyService.java @@ -434,6 +434,11 @@ public Flux> 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 findActiveClientStatusCodes() { log.info("Searching for active client statuses in legacy"); @@ -442,7 +447,6 @@ public Flux 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" @@ -450,6 +454,13 @@ public Flux findActiveClientStatusCodes() { ); } + /** + * 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 findActiveClientStatusCodesByClientTypeAndRole( String clientTypeCode, Set groups) { @@ -478,6 +489,7 @@ else if (groups.contains(ApplicationConstant.ROLE_EDITOR)) { private Set 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"); }; } @@ -490,6 +502,11 @@ private Set 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 findActiveRegistryTypeCodes() { log.info("Searching for active registry types in legacy");