Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public class TransactionEntity extends CommonEntity implements Persistable<Strin
@OneToMany(mappedBy = "transaction", orphanRemoval = true, fetch = EAGER, cascade = CascadeType.ALL)
private Set<TransactionItemEntity> items = new LinkedHashSet<>();

@OneToOne(fetch = FetchType.LAZY)
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "reconcilation_id")
@Nullable
private ReconcilationEntity lastReconcilation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void checkReportStatusForOrganisation(Organisation org, int txStatusInsp

Set<ReportEntity> reportEntities = reportEntityRepositoryGateway.findDispatchedReportsThatAreNotFinalizedYet(org.getId(), Limit.of(txStatusInspectionLimitPerOrgPullSize));

reportEntities.forEach(report -> {
reportEntities.forEach(report -> {
log.info("Checking transaction status for report: {}", report.getId());
L1SubmissionData l1SubmissionData = report.getL1SubmissionData().orElseThrow(() -> new RuntimeException("Failed to get L1 submission data"));
report.setL1SubmissionData(Optional.of(updateL1SubmissionData(l1SubmissionData, chainTip)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.client.RestClient;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestClientResponseException;
Expand All @@ -38,9 +37,7 @@ public class BlockchainReaderPublicApi implements BlockchainReaderPublicApiIF {
public static final String INTERNAL_SERVER_ERROR_REASON_S = "Internal server error, reason: %s";
private final RestClient restClient;
private final CardanoNetwork network;

@Value("${lob.blockchain_reader.lob_follower_base_url:http://localhost:9090/api}")
private String lobFollowerBaseUrl;
private final String lobFollowerBaseUrl;

@PostConstruct
public void init() {
Expand All @@ -50,6 +47,7 @@ public void init() {
@Override
public Either<Problem, ChainTip> getChainTip() {
try {
log.info("Get chain tip from {}", "%s/tip".formatted(lobFollowerBaseUrl));
ChainTip chainTip = restClient.get()
.uri("%s/v1/tip".formatted(lobFollowerBaseUrl))
.retrieve()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -16,12 +17,15 @@
@Slf4j
public class BlockchainReaderConfig {

@Value("${lob.blockchain_reader.lob_follower_base_url:http://localhost:9090/api}")
private String lobFollowerUrl;

@Bean
@ConditionalOnProperty(prefix = "lob.blockchain_reader", value = "enabled", havingValue = "true", matchIfMissing = true)
public BlockchainReaderPublicApiIF blockchainReaderPublicApiReal(@Qualifier("blockchainReaderRestClient") RestClient restClient, CardanoNetwork network) {
log.info("Creating BlockchainReaderPublicApi with real YACI service, blockchain_reader enabled.");

return new BlockchainReaderPublicApi(restClient, network);
return new BlockchainReaderPublicApi(restClient, network, lobFollowerUrl);
}

@Bean
Expand Down
8 changes: 6 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ subprojects {
}
}

extra["springBootVersion"] = "3.3.3"
extra["springBootVersion"] = "3.3.13"
extra["springCloudVersion"] = "2023.0.0"
extra["jMoleculesVersion"] = "2023.1.0"

Expand All @@ -115,7 +115,7 @@ subprojects {

// needed to store json via JPA in PostgreSQL for
// Hibernate 6.6, 6.5, 6.4, and 6.3
implementation("io.hypersistence:hypersistence-utils-hibernate-63:3.8.3")
implementation("io.hypersistence:hypersistence-utils-hibernate-63:3.10.3")

runtimeOnly("io.micrometer:micrometer-registry-prometheus")
runtimeOnly("org.postgresql:postgresql")
Expand Down Expand Up @@ -308,6 +308,10 @@ subprojects {
name = "localM2"
url = uri("${System.getProperty("user.home")}/.m2/repository")
}
maven {
name = "localM2App"
url = uri("${System.getProperty("user.home")}/git/reeve/cf-reeve-application/.m2/repository")
}
maven {
name = "gitlabPrivate"
url = uri(System.getenv("GITLAB_MAVEN_REGISTRY_URL") ?: "")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = org.cardanofoundation
version = 1.1.0
version = 1.1.0-native-test-SNAPSHOT

jsonWebTokenVersion=0.11.5
springBootSecurity=3.2.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ChartOfAccount extends CommonEntity implements Persistable<ChartOfA
@Builder.Default
private Boolean active = true;

@ManyToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "subType", referencedColumnName = "id")
private ChartOfAccountSubType subType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ChartOfAccountSubType extends CommonEntity {
@Column(name = "name", nullable = false)
private String name;

@ManyToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "type", referencedColumnName = "id")
private ChartOfAccountType type;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.cardanofoundation.lob.app.organisation.domain.entity;

import static jakarta.persistence.FetchType.LAZY;

import java.util.LinkedHashSet;
import java.util.Set;

Expand Down Expand Up @@ -36,7 +34,7 @@ public class ChartOfAccountType extends CommonEntity {
@Column(name = "name", nullable = false)
private String name;

@OneToMany(mappedBy = "type", orphanRemoval = true, fetch = LAZY, cascade = CascadeType.ALL)
@OneToMany(mappedBy = "type", orphanRemoval = true, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@Builder.Default
private Set<ChartOfAccountSubType> subTypes = new LinkedHashSet<>();

Expand Down