-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #425 from qbicsoftware/release/0.30.0
Release/0.30.0
- Loading branch information
Showing
114 changed files
with
1,730 additions
and
751 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
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>life.qbic</groupId> | ||
<artifactId>datamanager</artifactId> | ||
<version>0.29.0</version> | ||
</parent> | ||
|
||
<groupId>life.qbic.finances</groupId> | ||
<artifactId>finances-api</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
</project> |
53 changes: 53 additions & 0 deletions
53
finances-api/src/main/java/life/qbic/finances/api/FinanceService.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,53 @@ | ||
package life.qbic.finances.api; | ||
|
||
import java.util.Collection; | ||
import java.util.Optional; | ||
|
||
/** | ||
* <b>Finance service</b> | ||
* <p> | ||
* Interface to enable clients to look up basic offer information. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
public interface FinanceService { | ||
|
||
/** | ||
* Lists concise offer information for offers that contain a given character sequence in the | ||
* project title or in the offerId. | ||
* <p> | ||
* The search is inclusive, so either a match in the title or the project id will be returned. | ||
* | ||
* @param projectTitle a character sequence to search for in the project title of an offer | ||
* @param offerId a character sequence to search for in the offer id of an offer | ||
* @return list of {@link OfferSummary} matching the criteria | ||
* @since 1.0.0 | ||
*/ | ||
Collection<OfferSummary> findOfferContainingProjectTitleOrId(String projectTitle, | ||
String offerId); | ||
|
||
/** | ||
* Same as {@link FinanceService#findOfferContainingProjectTitleOrId(String, String)} but with a | ||
* possibility for pagination by providing an offset and query result size limit. | ||
* | ||
* @param projectTitle a character sequence to search for in the project title of an offer | ||
* @param offerId a character sequence to search for in the offer id of an offer | ||
* @param offset the offset to start listing the matching search results | ||
* @param limit the maximum number of matching search results | ||
* @return list of {@link OfferSummary} matching the criteria | ||
* @since 1.0.0 | ||
*/ | ||
Collection<OfferSummary> findOfferContainingProjectTitleOrId(String projectTitle, String offerId, | ||
int offset, int limit); | ||
|
||
|
||
/** | ||
* Searches for an offer based on a given offer id | ||
* | ||
* @param offerId the offer id | ||
* @return an optional offer, is {@link Optional#empty()} if no matching offer was found | ||
* @since 1.0.0 | ||
*/ | ||
Optional<Offer> findOfferById(String offerId); | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
finances-api/src/main/java/life/qbic/finances/api/Offer.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,19 @@ | ||
package life.qbic.finances.api; | ||
|
||
/** | ||
* <b>Offer</b> | ||
* | ||
* <p>Holds offer information such as:</p> | ||
* | ||
* <ul> | ||
* <li>offer id</li> | ||
* <li>title</li> | ||
* <li>objective</li> | ||
* <li>experimental design</li> | ||
* </ul> | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
public record Offer(String id, String title, String objective, String experimentDescription) { | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
finances-api/src/main/java/life/qbic/finances/api/OfferSummary.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,12 @@ | ||
package life.qbic.finances.api; | ||
|
||
/** | ||
* <b>Offer summary</b> | ||
* | ||
* <p>Holds title and id of an offer</p> | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
public record OfferSummary(String title, String offerId) { | ||
|
||
} |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>life.qbic</groupId> | ||
<artifactId>datamanager</artifactId> | ||
<version>0.29.0</version> | ||
</parent> | ||
|
||
<artifactId>finances-infrastructure</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>life.qbic</groupId> | ||
<artifactId>finances</artifactId> | ||
<version>0.29.0</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
4 changes: 2 additions & 2 deletions
4
...nfrastructure/OfferPreviewRepository.java → ...nfrastructure/OfferPreviewRepository.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
6 changes: 3 additions & 3 deletions
6
...ement/infrastructure/OfferRepository.java → ...nance/infrastructure/OfferRepository.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
2 changes: 1 addition & 1 deletion
2
...nt/infrastructure/OffsetBasedRequest.java → ...ce/infrastructure/OffsetBasedRequest.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
10 changes: 5 additions & 5 deletions
10
...rastructure/SimpleOfferSearchService.java → ...rastructure/SimpleOfferSearchService.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
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
73 changes: 0 additions & 73 deletions
73
...es/src/main/java/life/qbic/controlling/application/finances/offer/OfferLookupService.java
This file was deleted.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
finances/src/main/java/life/qbic/finance/application/FinanceServiceImpl.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,67 @@ | ||
package life.qbic.finance.application; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import life.qbic.finance.domain.model.OfferPreview; | ||
import life.qbic.finances.api.FinanceService; | ||
import life.qbic.finances.api.Offer; | ||
import life.qbic.finances.api.OfferSummary; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
/** | ||
* <b>Finance Service</b> | ||
* <p> | ||
* Enables search queries for offers. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
@Service | ||
public class FinanceServiceImpl implements FinanceService { | ||
|
||
private final OfferSearchService offerSearchService; | ||
|
||
@Autowired | ||
public FinanceServiceImpl( | ||
OfferSearchService offerSearchService) { | ||
this.offerSearchService = offerSearchService; | ||
} | ||
|
||
private static OfferSummary convert(OfferPreview offerPreview) { | ||
return new OfferSummary(offerPreview.getProjectTitle().title(), offerPreview.offerId().id()); | ||
} | ||
|
||
private static Offer convert(life.qbic.finance.domain.model.Offer offer) { | ||
return new Offer(offer.offerId().id(), offer.projectTitle().title(), | ||
offer.projectObjective().objective(), offer.experimentalDesignDescription().description()); | ||
} | ||
|
||
/** | ||
* @inheritDocs | ||
*/ | ||
@Override | ||
public List<OfferSummary> findOfferContainingProjectTitleOrId(String projectTitle, | ||
String offerId) { | ||
return offerSearchService.findByProjectTitleOrOfferId(projectTitle, offerId).stream() | ||
.map(FinanceServiceImpl::convert).toList(); | ||
} | ||
|
||
/** | ||
* @inheritDocs | ||
*/ | ||
@Override | ||
public List<OfferSummary> findOfferContainingProjectTitleOrId(String projectTitle, String offerId, | ||
int offset, int limit) { | ||
return offerSearchService.findByProjectTitleOrOfferId(projectTitle, offerId, offset, limit) | ||
.stream().map(FinanceServiceImpl::convert).toList(); | ||
} | ||
|
||
/** | ||
* @inheritDocs | ||
*/ | ||
@Override | ||
public Optional<life.qbic.finances.api.Offer> findOfferById(String offerId) { | ||
return offerSearchService.findByOfferId(offerId).map(FinanceServiceImpl::convert); | ||
} | ||
|
||
} |
6 changes: 3 additions & 3 deletions
6
...on/finances/offer/OfferSearchService.java → ...nance/application/OfferSearchService.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
2 changes: 1 addition & 1 deletion
2
.../offer/ExperimentalDesignDescription.java → .../model/ExperimentalDesignDescription.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
2 changes: 1 addition & 1 deletion
2
...trolling/domain/finances/offer/Offer.java → ...life/qbic/finance/domain/model/Offer.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
2 changes: 1 addition & 1 deletion
2
...olling/domain/finances/offer/OfferId.java → ...fe/qbic/finance/domain/model/OfferId.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
2 changes: 1 addition & 1 deletion
2
...g/domain/finances/offer/OfferPreview.java → ...ic/finance/domain/model/OfferPreview.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
2 changes: 1 addition & 1 deletion
2
...main/finances/offer/ProjectObjective.java → ...inance/domain/model/ProjectObjective.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
2 changes: 1 addition & 1 deletion
2
...g/domain/finances/offer/ProjectTitle.java → ...ic/finance/domain/model/ProjectTitle.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
Oops, something went wrong.