Skip to content

Commit

Permalink
MODTLR-13 Handle request update event from data tenant to update ECS TLR
Browse files Browse the repository at this point in the history
  • Loading branch information
MagzhanArtykov committed Jan 29, 2024
1 parent d76634e commit 48341eb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/folio/domain/entity/EcsTlrEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class EcsTlrEntity {
private UUID id;
private UUID instanceId;
private UUID requesterId;
private UUID tlrId;
private String requestType;
private String requestLevel;
private Date requestExpirationDate;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/folio/repository/EcsTlrRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@

@Repository
public interface EcsTlrRepository extends JpaRepository<EcsTlrEntity, UUID> {
//Optional<EcsTlrEntity> findByTlrId(UUID tlrRequestId);
Optional<EcsTlrEntity> findByTlrId(UUID tlrRequestId);
}
3 changes: 1 addition & 2 deletions src/main/java/org/folio/service/impl/EcsTlrServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.folio.client.CirculationClient;
import org.folio.domain.dto.EcsTlr;
import org.folio.domain.dto.Request;
import org.folio.domain.entity.EcsTlrEntity;
import org.folio.domain.mapper.EcsTlrMapper;
import org.folio.repository.EcsTlrRepository;
import org.folio.service.TenantScopedExecutionService;
Expand Down Expand Up @@ -46,7 +45,7 @@ public EcsTlr post(EcsTlr ecsTlr) {
@Override
public void updateRequestItem(UUID tlrRequestId, UUID itemId) {
log.debug("updateRequestItem:: parameters tlrRequestId: {}, itemId: {}", tlrRequestId, itemId);
ecsTlrRepository.findById(tlrRequestId).ifPresentOrElse(
ecsTlrRepository.findByTlrId(tlrRequestId).ifPresentOrElse(
ecsTlrEntity -> {
ecsTlrEntity.setItemId(itemId);
ecsTlrRepository.save(ecsTlrEntity);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/db/changelog/changes/initial_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</column>
<column name="instance_id" type="uuid"/>
<column name="requester_id" type="uuid"/>
<column name="tlr_id" type="uuid"/>
<column name="request_type" type="varchar(255)"/>
<column name="request_level" type="varchar(255)"/>
<column name="request_date" type="timestamp with time zone"/>
Expand Down

0 comments on commit 48341eb

Please sign in to comment.