Skip to content

Commit

Permalink
Merge pull request #176 from qbicsoftware/release/2.3.0
Browse files Browse the repository at this point in the history
Release/2.3.0
  • Loading branch information
sven1103 authored Mar 16, 2021
2 parents b29746f + ee82641 commit 5e1b544
Show file tree
Hide file tree
Showing 16 changed files with 479 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .qube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ email: [email protected]
project_name: data-model-lib
project_short_description: "Data models. A collection of QBiC's central data models\
\ and DTOs. "
version: 2.2.0
version: 2.3.0
domain: lib
language: groovy
project_slug: data-model-lib
Expand Down
27 changes: 25 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ Changelog
This project adheres to `Semantic Versioning <https://semver.org/>`_.


2.3.0 (2021-03-16)
------------------

**Added**

* overheadRatio property for ``life.qbic.datamodel.dtos.business.Offer``

* ``life.qbic.datamodel.dtos.projectmanagement.ProjectIdentifier``, ``life.qbic.datamodel.dtos.projectmanagement.ProjectCode``, ``life.qbic.datamodel.dtos.projectmanagement.ProjectSpace`` and ``life.qbic.datamodel.dtos.projectmanagement.Project`` to describe QBiC projects

* ``life.qbic.datamodel.dtos.business.ProjectApplication`` to describe a project application for registration at QBiC's data management platform

* Added uniqueId field to ``life.qbic.datamodel.dtos.business.ProductId`` (`#173 <https://github.com/qbicsoftware/data-model-lib/pull/173>`_)

* Add `Hour` ``life.qbic.datamodel.dtos.business.services.ProductUnit.PER_HOUR`` (`#175 <https://github.com/qbicsoftware/data-model-lib/pull/175>`_)

**Fixed**

**Dependencies**

**Deprecated**

* ``life.qbic.datamodel.dtos.business.ProductId#identifier`` is replaced by ``life.qbic.datamodel.dtos.business.ProductId#uniqueId`` (`#173 <https://github.com/qbicsoftware/data-model-lib/pull/173>`_)


2.2.0 (2021-03-02)
------------------

Expand All @@ -27,7 +51,7 @@ This project adheres to `Semantic Versioning <https://semver.org/>`_.
* Introduce a schema resource for bioinformatic pipeline result sets validation via ``life.qbic.datamodel.pipelines.PipelineOutput`` (`#159 <https://github.com/qbicsoftware/data-model-lib/pull/159/>`_)
* Add field ``life.qbic.datamodel.dtos.business.Offer#projectObjective``, will replace ``life.qbic.datamodel.dtos.business.Offer#projectDescription`` (`#161 <https://github.com/qbicsoftware/data-model-lib/pull/161>`_)
* Add fields ``life.qbic.datamodel.dtos.business.Offer#itemsWithOverhead``, ``life.qbic.datamodel.dtos.business.Offer#itemsWithoutOverhead``,
``life.qbic.datamodel.dtos.business.Offer#itemsWithOverheadNetPrice`` and ``life.qbic.datamodel.dtos.business.Offer#itemsWithoutOverheadNetPrice`` to Offer DTO (`#160 <https://github.com/qbicsoftware/data-model-lib/pull/160/>`_)
``life.qbic.datamodel.dtos.business.Offer#itemsWithOverheadNetPrice`` and ``life.qbic.datamodel.dtos.business.Offer#itemsWithoutOverheadNetPrice`` to Offer DTO (`#160 <https://github.com/qbicsoftware/data-model-lib/pull/160/>`_)

**Fixed**

Expand Down Expand Up @@ -324,4 +348,3 @@ This project adheres to `Semantic Versioning <https://semver.org/>`_.
**Dependencies**

**Deprecated**

4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
# the built documents.
#
# The short X.Y version.
version = '2.2.0'
version = '2.3.0'
# The full version, including alpha/beta/rc tags.
release = '2.2.0'
release = '2.3.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>life.qbic</groupId>
<artifactId>data-model-lib</artifactId>
<version>2.2.0</version> <!-- <<QUBE_FORCE_BUMP>> -->
<version>2.3.0</version> <!-- <<QUBE_FORCE_BUMP>> -->
<name>data-model-lib</name>
<url>http://github.com/qbicsoftware/data-model-lib</url>
<description>Data models. A collection of QBiC's central data models and DTOs. </description>
Expand Down
2 changes: 1 addition & 1 deletion qube.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.2.0
current_version = 2.3.0

[bumpversion_files_whitelisted]
dot_qube = .qube.yml
Expand Down
13 changes: 12 additions & 1 deletion src/main/groovy/life/qbic/datamodel/dtos/business/Offer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ class Offer {
* The net price of all items for which an overhead cost is not applicable, without overhead and taxes
*/
final double itemsWithoutOverheadNetPrice
/**
* The overhead ratio applied to the pricing dependent on the customer affiliation
*/
final double overheadRatio

static class Builder {

Expand Down Expand Up @@ -122,7 +126,7 @@ class Offer {
double overheads
double itemsWithOverheadNet
double itemsWithoutOverheadNet

double overheadRatio
/**
* @deprecated Replaced with {@link #projectObjective}, since 2.1.0
*/
Expand Down Expand Up @@ -151,6 +155,7 @@ class Offer {
this.itemsWithOverheadNet = 0
this.itemsWithoutOverheadNet = 0
this.checksum = ""
this.overheadRatio = 0

/*
Deprecated
Expand Down Expand Up @@ -223,6 +228,11 @@ class Offer {
return this
}

Builder overheadRatio(double overheadRatio){
this.overheadRatio = overheadRatio
return this
}

Offer build() {
return new Offer(this)
}
Expand Down Expand Up @@ -258,6 +268,7 @@ class Offer {
this.itemsWithoutOverhead = builder.itemsWithoutOverhead
this.itemsWithOverheadNetPrice = builder.itemsWithOverheadNet
this.itemsWithoutOverheadNetPrice = builder.itemsWithoutOverheadNet
this.overheadRatio = builder.overheadRatio

/*
Deprecated properties
Expand Down
75 changes: 68 additions & 7 deletions src/main/groovy/life/qbic/datamodel/dtos/business/ProductId.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,88 @@ class ProductId {
/**
* Identifying number used in conjunction with the type
*/
private final String identifier
private final long uniqueId

/**
* A builder for ProductId instances.
*/
static class Builder {
private String productType
private long uniqueId

/**
*
* @param productType
* @param identifier the unique id - will be interpreted as unsigned long
*/
Builder(String productType, String identifier) {
this.productType = Objects.requireNonNull(productType)
this.uniqueId = Objects.requireNonNull(Long.parseUnsignedLong(identifier))
}

/**
*
* @param productType
* @param uniqueId the unique id - will be interpreted as unsigned long
*/
Builder(String productType, long uniqueId) {
this.productType = Objects.requireNonNull(productType)
this.uniqueId = Objects.requireNonNull(uniqueId)
}

Builder productType(String productType) {
this.productType = productType
return this
}

Builder uniqueId(long identifier) {
this.uniqueId = identifier
return this
}
/**
* Constructs a product identifier based on the configuration of the builder
* @return
*/
ProductId build() {
return new ProductId(this)
}
}

/**
* Creates an identifier object with the
*
* @param type describing the type of the underlying identifier
* @param identifier describes the identifying running number
* @deprecated please use {@link ProductId.Builder}
*/

@Deprecated
ProductId(String type, String identifier){
this.type = Objects.requireNonNull(type, "type must not be null")
this.identifier= Objects.requireNonNull(identifier, "version must not be null")
Builder builder = new Builder(type, identifier)
this.type = builder.productType
this.uniqueId = builder.uniqueId
}

private ProductId(Builder builder) {
this.type = builder.productType
this.uniqueId = builder.uniqueId
}

/**
* Returns the identifying running number
* @return
* @return the identifier
* @deprecated please use {@link ProductId#getUniqueId()}
*/
@Deprecated
String getIdentifier() {
return identifier
return uniqueId.toString()
}

/**
* Returns the identifying running number
* @return the identifier
*/
Long getUniqueId() {
return uniqueId
}
/**
* Returns the type of the identifier
Expand All @@ -62,6 +123,6 @@ class ProductId {
*/
@Override
String toString() {
return type + "_" + identifier
return "${type}_${uniqueId}"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package life.qbic.datamodel.dtos.business

import life.qbic.datamodel.dtos.business.Customer
import life.qbic.datamodel.dtos.business.OfferId
import life.qbic.datamodel.dtos.business.ProjectManager
import life.qbic.datamodel.dtos.projectmanagement.ProjectCode
import life.qbic.datamodel.dtos.projectmanagement.ProjectSpace

/**
* Information about a desired project registration in QBiC's project management system.
*
* Instances of this class describe a request to register a new project at QBiC.
*
* Beside the mandatory fields required to be passed to the constructor, there are two optional
* fields:
* 1: projectSpace
* 2: projectCode
* If any of these are not defined, then either of it will be created randomly.
*
* @since 2.3.0
*/
class ProjectApplication {

/**
* The associated offer
*/
final OfferId linkedOffer

/**
* A short and precise project title
*/
final String projectTitle

/**
* A descriptive project objective
*/
final String projectObjective

/**
* A description about the experimental design
*/
final String experimentalDesign

/**
* The associated project manager
*/
final ProjectManager projectManager

/**
* The associated customer
*/
final Customer customer

/**
* The requested project space the project shall be associated with
*/
final ProjectSpace projectSpace

/**
* The desired project code
*/
final ProjectCode projectCode

ProjectApplication(OfferId linkedOffer,
String projectTitle,
String projectObjective,
String experimentalDesign,
ProjectManager projectManager,
ProjectSpace projectSpace,
Customer customer,
ProjectCode code) {
this.linkedOffer = Objects.requireNonNull(linkedOffer)
this.projectTitle = Objects.requireNonNull(projectTitle)
this.projectObjective = Objects.requireNonNull(projectObjective)
this.experimentalDesign = Objects.requireNonNull(experimentalDesign)
this.projectManager = Objects.requireNonNull(projectManager)
this.customer = Objects.requireNonNull(customer)
this.projectSpace = Objects.requireNonNull(projectSpace)
this.projectCode = Objects.requireNonNull(code)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ enum ProductUnit {

PER_GIGABYTE("Gigabyte"),
PER_SAMPLE("Sample"),
PER_DATASET("Dataset")
PER_DATASET("Dataset"),
PER_HOUR("Hour")

/**
Holds the String value of the enum
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package life.qbic.datamodel.dtos.projectmanagement

import life.qbic.datamodel.dtos.business.OfferId

/**
* A typical scientific QBiC project.
*
* Describes and provides information about a scientific project
* at QBiC.
*
* @since 2.3.0
*/
class Project {

/**
* A short but descriptive project title
*/
final String projectTitle

/**
* QBiC's internal project identifier
*/
final ProjectIdentifier projectId

/**
* The associated offer
*/
final OfferId linkedOffer

private Project(Builder builder) {
this.projectId = Objects.requireNonNull(builder.projectIdentifier)
this.projectTitle = Objects.requireNonNull(builder.projectTitle)
this.linkedOffer = builder.linkedOfferId
}

static class Builder {
private ProjectIdentifier projectIdentifier
private String projectTitle
private OfferId linkedOfferId

Builder(ProjectIdentifier projectIdentifier, String projectTitle) {
this.projectIdentifier = projectIdentifier
this.projectTitle = projectTitle
this.linkedOfferId = null
}

Builder projectIdentifier(ProjectIdentifier projectIdentifier) {
this.projectIdentifier = projectIdentifier
return this
}

Builder projectTitle(String projectTitle) {
this.projectTitle = projectTitle
return this
}

Builder linkedOfferId(OfferId offerId) {
this.linkedOfferId = offerId
return this
}

Project build() {
return new Project(this)
}
}
}
Loading

0 comments on commit 5e1b544

Please sign in to comment.