-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MODTLR-79: Pick Slips API (part 2) (#78)
* MODTLR-79 Departments and address types * MODTLR-79 Implementation * MODTLR-79 Lower limit for search by query * MODTLR-79 Search instances with expandAll=true * MODTLR-79 Search instances with expandAll=true * MODTLR-79 Convert UUID to string * MODTLR-79 Fresh schemas, tests * MODTLR-79 Allow additional properties in imported schemas * MODTLR-79 Verify all calls in test * MODTLR-79 Tests for PickSlipsServiceImpl * MODTLR-79 Fix code smells * MODTLR-79 Remove unused class
- Loading branch information
1 parent
e68e659
commit f4202d5
Showing
97 changed files
with
2,905 additions
and
1,028 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/org/folio/client/feign/AddressTypeClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.AddressTypes; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
|
||
@FeignClient(name = "address-types", url = "addresstypes", configuration = FeignClientConfiguration.class) | ||
public interface AddressTypeClient extends GetByQueryClient<AddressTypes> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/folio/client/feign/DepartmentClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.Departments; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
|
||
@FeignClient(name = "departments", url = "departments", configuration = FeignClientConfiguration.class) | ||
public interface DepartmentClient extends GetByQueryClient<Departments> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.LoanTypes; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
|
||
@FeignClient(name = "loan-types", url = "loan-types", configuration = FeignClientConfiguration.class) | ||
public interface LoanTypeClient extends GetByQueryClient<LoanTypes> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/folio/client/feign/LocationCampusClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.Campuses; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
|
||
@FeignClient(name = "campuses", url = "location-units/campuses", configuration = FeignClientConfiguration.class) | ||
public interface LocationCampusClient extends GetByQueryClient<Campuses> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/folio/client/feign/LocationInstitutionClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.Institutions; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
|
||
@FeignClient(name = "institutions", url = "location-units/institutions", configuration = FeignClientConfiguration.class) | ||
public interface LocationInstitutionClient extends GetByQueryClient<Institutions> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/folio/client/feign/LocationLibraryClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.Libraries; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
|
||
@FeignClient(name = "libraries", url = "location-units/libraries", configuration = FeignClientConfiguration.class) | ||
public interface LocationLibraryClient extends GetByQueryClient<Libraries> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/folio/client/feign/MaterialTypeClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.MaterialTypes; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
|
||
@FeignClient(name = "material-types", url = "material-types", configuration = FeignClientConfiguration.class) | ||
public interface MaterialTypeClient extends GetByQueryClient<MaterialTypes> { | ||
|
||
} |
18 changes: 9 additions & 9 deletions
18
.../org/folio/client/feign/SearchClient.java → ...io/client/feign/SearchInstanceClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.SearchInstancesResponse; | ||
import org.folio.domain.dto.SearchItemResponse; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.folio.support.CqlQuery; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@FeignClient(name = "search", url = "search", configuration = FeignClientConfiguration.class) | ||
public interface SearchClient { | ||
@FeignClient(name = "search", url = "search/instances", configuration = FeignClientConfiguration.class) | ||
public interface SearchInstanceClient extends GetByQueryClient<SearchInstancesResponse> { | ||
|
||
@GetMapping("/instances") | ||
@GetMapping | ||
SearchInstancesResponse searchInstances(@RequestParam("query") CqlQuery cql, | ||
@RequestParam("expandAll") Boolean expandAll); | ||
@RequestParam("expandAll") Boolean expandAll, @RequestParam("limit") int limit); | ||
|
||
@GetMapping("/instances?query=id=={instanceId}&expandAll=true") | ||
@GetMapping("?query=id=={instanceId}&expandAll=true") | ||
SearchInstancesResponse searchInstance(@PathVariable("instanceId") String instanceId); | ||
|
||
@GetMapping("/consortium/item/{itemId}") | ||
SearchItemResponse searchItem(@PathVariable("itemId") String itemId); | ||
|
||
@Override | ||
// max limit for instance search is 500 | ||
@GetMapping("?expandAll=true&limit=500&query={query}") | ||
SearchInstancesResponse getByQuery(@PathVariable CqlQuery query); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/folio/client/feign/SearchItemClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.folio.client.feign; | ||
|
||
import org.folio.domain.dto.SearchInstancesResponse; | ||
import org.folio.domain.dto.SearchItemResponse; | ||
import org.folio.spring.config.FeignClientConfiguration; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
|
||
@FeignClient(name = "search-item", url = "search/consortium/item", | ||
configuration = FeignClientConfiguration.class) | ||
public interface SearchItemClient extends GetByQueryClient<SearchInstancesResponse> { | ||
|
||
@GetMapping("/{itemId}") | ||
SearchItemResponse searchItem(@PathVariable("itemId") String itemId); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.folio.service; | ||
|
||
import java.util.Collection; | ||
|
||
import org.folio.domain.dto.AddressType; | ||
|
||
public interface AddressTypeService { | ||
Collection<AddressType> findAddressTypes(Collection<String> ids); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.folio.service; | ||
|
||
import java.util.Collection; | ||
|
||
import org.folio.domain.dto.Department; | ||
|
||
public interface DepartmentService { | ||
Collection<Department> findDepartments(Collection<String> ids); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.folio.service; | ||
|
||
import java.util.Collection; | ||
|
||
import org.folio.domain.dto.Campus; | ||
import org.folio.domain.dto.Institution; | ||
import org.folio.domain.dto.Item; | ||
import org.folio.domain.dto.Library; | ||
import org.folio.domain.dto.LoanType; | ||
import org.folio.domain.dto.MaterialType; | ||
import org.folio.support.CqlQuery; | ||
|
||
public interface InventoryService { | ||
Collection<Item> findItems(CqlQuery query, String idIndex, Collection<String> ids); | ||
Collection<Item> findItems(Collection<String> ids); | ||
Collection<MaterialType> findMaterialTypes(Collection<String> ids); | ||
Collection<LoanType> findLoanTypes(Collection<String> ids); | ||
Collection<Library> findLibraries(Collection<String> ids); | ||
Collection<Campus> findCampuses(Collection<String> ids); | ||
Collection<Institution> findInstitutions(Collection<String> ids); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.folio.service; | ||
|
||
import java.util.Collection; | ||
|
||
import org.folio.domain.dto.SearchInstance; | ||
import org.folio.support.CqlQuery; | ||
|
||
public interface SearchService { | ||
Collection<SearchInstance> searchInstances(CqlQuery commonQuery, String idIndex, | ||
Collection<String> ids); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package org.folio.service; | ||
|
||
import java.util.Collection; | ||
|
||
import org.folio.domain.dto.ServicePoint; | ||
|
||
public interface ServicePointService { | ||
ServicePoint find(String id); | ||
Collection<ServicePoint> find(Collection<String> servicePointIds); | ||
ServicePoint create(ServicePoint servicePoint); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package org.folio.service; | ||
|
||
import java.util.Collection; | ||
|
||
import org.folio.domain.dto.UserGroup; | ||
|
||
public interface UserGroupService { | ||
UserGroup create(UserGroup userGroup); | ||
UserGroup update(UserGroup userGroup); | ||
Collection<UserGroup> find(Collection<String> ids); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package org.folio.service; | ||
|
||
import java.util.Collection; | ||
|
||
import org.folio.domain.dto.User; | ||
|
||
public interface UserService { | ||
User find(String userId); | ||
User create(User user); | ||
User update(User user); | ||
Collection<User> find(Collection<String> userIds); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/org/folio/service/impl/AddressTypeServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.folio.service.impl; | ||
|
||
import java.util.Collection; | ||
|
||
import org.folio.client.feign.AddressTypeClient; | ||
import org.folio.domain.dto.AddressType; | ||
import org.folio.domain.dto.AddressTypes; | ||
import org.folio.service.AddressTypeService; | ||
import org.folio.support.BulkFetcher; | ||
import org.springframework.stereotype.Service; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.log4j.Log4j2; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Log4j2 | ||
public class AddressTypeServiceImpl implements AddressTypeService { | ||
|
||
private final AddressTypeClient addressTypeClient; | ||
|
||
@Override | ||
public Collection<AddressType> findAddressTypes(Collection<String> ids) { | ||
log.info("findAddressTypes:: fetching address types by {} IDs", ids.size()); | ||
log.debug("findAddressTypes:: ids={}", ids); | ||
return BulkFetcher.fetch(addressTypeClient, ids, AddressTypes::getAddressTypes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.