Skip to content
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ This project adheres to `Semantic Versioning <https://semver.org/>`_.
**Added**

* A new enumeration for facilities ``life.qbic.datamodel.dtos.business.facilities.Facility`` (`#244 <https://github.com/qbicsoftware/data-model-lib/pull/244>`_)
* New properties ``internalUnitPrice``, ``externalUnitPrice`` and ``serviceProvider`` for the ``life.qbic.datamodel.dtos.business.services.Product`` and its derivatives (`#245 <https://github.com/qbicsoftware/data-model-lib/pull/245>`_)

**Fixed**

**Dependencies**

**Deprecated**

* The ``unitPrice`` property in ``life.qbic.datamodel.dtos.business.services.Product``


2.10.0 (2021-07-19)
-------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode
import life.qbic.datamodel.dtos.business.ProductId
import life.qbic.datamodel.dtos.business.facilities.Facility

/**
* Describes a product type that can only have positive natural unit multipliers (N={0,1...,inf+})
Expand All @@ -23,8 +24,30 @@ class AtomicProduct extends Product {
* @param unitPrice The price in € per unit
* @param unit The product unit
* @param productId The product identifier
*
* @deprecated 2.11.0
*/
@Deprecated
AtomicProduct(String name, String description, double unitPrice, ProductUnit unit, ProductId productId) {
super(name, description, unitPrice, unit, productId)
}

/**
* Basic product constructor.
*
* Checks that all passed arguments are not null.
*
* @param name The name of the product.
* @param description The description of what the product is about.
* @param internalUnitPrice The price in € per unit for internal customers
* @param externalUnitPrice The price in € per unit for external customers
* @param unit The product unit
* @param productId The product identifier
* @param serviceProvider The facility providing the service product
*
* @since 2.11.0
*/
AtomicProduct(String name, String description, double internalUnitPrice, double externalUnitPrice, ProductUnit unit, ProductId productId, Facility serviceProvider) {
super(name, description, internalUnitPrice, externalUnitPrice, unit, productId, serviceProvider)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode
import life.qbic.datamodel.dtos.business.ProductId
import life.qbic.datamodel.dtos.business.facilities.Facility

/**
* Describes a product for data storage services.
Expand Down Expand Up @@ -37,8 +38,29 @@ class DataStorage extends PartialProduct {
* @param unitPrice The price in € per unit
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
*
* @deprecated 2.11.0
*/
@Deprecated
DataStorage(String name, String description, double unitPrice, ProductUnit unit, long runningNumber) {
super(name, description, unitPrice, unit, new ProductId.Builder(ProductType.DATA_STORAGE.toString(), runningNumber).build())
}

/**
* Basic product constructor.
*
* Checks that all passed arguments are not null.
*
* @param name The name of the product.
* @param description The description of what the product is about.
* @param internalUnitPrice The price in € per unit for internal customers
* @param externalUnitPrice The price in € per unit for external customers
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
*
* @since 2.11.0
*/
DataStorage(String name, String description, double internalUnitPrice, double externalUnitPrice, ProductUnit unit, long runningNumber, Facility serviceProvider) {
super(name, description, internalUnitPrice, externalUnitPrice, unit, new ProductId.Builder(ProductType.DATA_STORAGE.toString(), runningNumber).build(), serviceProvider)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode
import life.qbic.datamodel.dtos.business.ProductId
import life.qbic.datamodel.dtos.business.facilities.Facility

/**
* Describes a product for metabolomics services.
Expand Down Expand Up @@ -37,9 +38,31 @@ class MetabolomicAnalysis extends AtomicProduct {
* @param unitPrice The price in € per unit
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
*
* @deprecated 2.11.0
*/
@Deprecated
MetabolomicAnalysis(String name, String description, double unitPrice, ProductUnit unit, long runningNumber) {
super(name, description, unitPrice, unit, new ProductId.Builder(ProductType.METABOLOMIC.toString(), runningNumber).build())
}

/**
* Basic product constructor.
*
* Checks that all passed arguments are not null.
*
* @param name The name of the product.
* @param description The description of what the product is about.
* @param internalUnitPrice The price in € per unit for internal customers
* @param externalUnitPrice The price in € per unit for external customers
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
* @param serviceProvider The facility providing the service product
*
* @since 2.11.0
*/
MetabolomicAnalysis(String name, String description, double internalUnitPrice, double externalUnitPrice, ProductUnit unit, long runningNumber, Facility serviceProvider) {
super(name, description, internalUnitPrice, externalUnitPrice, unit, new ProductId.Builder(ProductType.METABOLOMIC.toString(), runningNumber).build(), serviceProvider)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode
import life.qbic.datamodel.dtos.business.ProductId
import life.qbic.datamodel.dtos.business.facilities.Facility

/**
* Describes a product type that can only have positive natural unit multipliers (N={0,1...,inf+})
* Describes a product type that can have positive rational unit multipliers (N={0,1...,inf+})
*
* An example for an PartialProduct is a sample data storage service product. You can offer
* multiple of this product and express the quantities as i.e. 1.5 * 1 Terabyte (100€/Tb) => 1.5
Expand All @@ -24,8 +25,30 @@ class PartialProduct extends Product {
* @param unitPrice The price in € per unit
* @param unit The product unit
* @param productId The product identifier
*
* @deprecated 2.11.0
*/
@Deprecated
PartialProduct(String name, String description, double unitPrice, ProductUnit unit, ProductId productId) {
super(name, description, unitPrice, unit, productId)
}

/**
* Basic product constructor.
*
* Checks that all passed arguments are not null.
*
* @param name The name of the product.
* @param description The description of what the product is about.
* @param internalUnitPrice The price in € per unit for internal customers
* @param externalUnitPrice The price in € per unit for external customers
* @param unit The product unit
* @param productId The product identifier
* @param serviceProvider The facility providing the service product
*
* @since 2.11.0
*/
PartialProduct(String name, String description, double internalUnitPrice, double externalUnitPrice, ProductUnit unit, ProductId productId, Facility serviceProvider) {
super(name, description, internalUnitPrice, externalUnitPrice, unit, productId, serviceProvider)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode
import life.qbic.datamodel.dtos.business.ProductId
import life.qbic.datamodel.dtos.business.facilities.Facility

/**
* Describes a product for primary bioinformatic analysis services.
Expand Down Expand Up @@ -37,8 +38,30 @@ class PrimaryAnalysis extends AtomicProduct {
* @param unitPrice The price in € per unit
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
*
* @deprecated 2.11.0
*/
@Deprecated
PrimaryAnalysis(String name, String description, double unitPrice, ProductUnit unit, long runningNumber) {
super(name, description, unitPrice, unit, new ProductId.Builder(ProductType.PRIMARY_BIOINFO.toString(), runningNumber).build())
}

/**
* Basic product constructor.
*
* Checks that all passed arguments are not null.
*
* @param name The name of the product.
* @param description The description of what the product is about.
* @param internalUnitPrice The price in € per unit for internal customers
* @param externalUnitPrice The price in € per unit for external customers
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
* @param serviceProvider The facility providing the service product
*
* @since 2.11.0
*/
PrimaryAnalysis(String name, String description, double internalUnitPrice, double externalUnitPrice, ProductUnit unit, long runningNumber, Facility serviceProvider) {
super(name, description, internalUnitPrice, externalUnitPrice, unit, new ProductId.Builder(ProductType.PRIMARY_BIOINFO.toString(), runningNumber).build(), serviceProvider)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode
import life.qbic.datamodel.dtos.business.ProductId
import life.qbic.datamodel.dtos.business.facilities.Facility

/**
* Holds information about a simple QBiC service product.
Expand All @@ -25,10 +26,33 @@ abstract class Product {
final String productName

/**
* The unit price in €/unit.
* The unit price in €/unit for customers. Can be 0 in case the deprecated constructor was used to create the product.
*
* @deprecated 2.11.0, please call the {@link #internalUnitPrice} or {@link #externalUnitPrice}
*/
final double unitPrice

/**
* The The unit price in €/unit for internal customers.
*
* @since 2.11.0
*/
final double internalUnitPrice

/**
* The unit price in €/unit for external customers.
*
* @since 2.11.0
*/
final double externalUnitPrice

/**
* The facility that provides the service product.
*
* @since 2.11.0
*/
final Facility serviceProvider

/**
* The currency of the price
*/
Expand All @@ -54,7 +78,10 @@ abstract class Product {
* @param unitPrice The price in € per unit
* @param unit The product unit
* @param productId The Id of the product
*
* @deprecated 2.11.0
*/
@Deprecated
Product(String name, String description, double unitPrice, ProductUnit unit, ProductId productId) {
this.productName = Objects.requireNonNull(name, "Name must not be null")
this.description = Objects.requireNonNull(description, "Description must not be null")
Expand All @@ -63,6 +90,42 @@ abstract class Product {
this.productId = Objects.requireNonNull(productId, "ProductId must not be null")
//currency is on default in euro
this.currency = Currency.getInstance(Locale.GERMANY)
this.externalUnitPrice = 0.00
this.internalUnitPrice = 0.00
this.serviceProvider = Facility.QBIC
}

/**
* Basic product constructor.
*
* Checks that all passed arguments except productId are not null.
*
* @param name The name of the product.
* @param description The description of what the product is about.
* @param internalUnitPrice The price in € per unit for internal customers
* @param externalUnitPrice The price in € per unit for external customers
* @param unit The product unit
* @param productId The Id of the product
*
* @since 2.11.0
*/
Product(String name,
String description,
double internalUnitPrice,
double externalUnitPrice,
ProductUnit unit,
ProductId productId,
Facility serviceProvider) {
this.productName = Objects.requireNonNull(name, "Name must not be null")
this.description = Objects.requireNonNull(description, "Description must not be null")
this.internalUnitPrice = Objects.requireNonNull(internalUnitPrice, "Internal unit price must not be null")
this.externalUnitPrice = Objects.requireNonNull(externalUnitPrice, "External unit price must not be null")
this.unitPrice = 0.00
this.unit = Objects.requireNonNull(unit, "Unit must not be null")
this.productId = Objects.requireNonNull(productId, "ProductId must not be null")
//currency is on default in euro
this.currency = Currency.getInstance(Locale.GERMANY)
this.serviceProvider = Objects.requireNonNull(serviceProvider, "Service provider must not be null")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode
import life.qbic.datamodel.dtos.business.ProductId
import life.qbic.datamodel.dtos.business.facilities.Facility

/**
* Describes a product for project management services.
Expand Down Expand Up @@ -37,8 +38,30 @@ class ProjectManagement extends PartialProduct {
* @param unitPrice The price in € per unit
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
*
* @deprecated 2.11.0
*/
@Deprecated
ProjectManagement(String name, String description, double unitPrice, ProductUnit unit, long runningNumber) {
super(name, description, unitPrice, unit, new ProductId.Builder(ProductType.PROJECT_MANAGEMENT.toString(), runningNumber).build())
}

/**
* Basic product constructor.
*
* Checks that all passed arguments are not null.
*
* @param name The name of the product.
* @param description The description of what the product is about.
* @param internalUnitPrice The price in € per unit for internal customers
* @param externalUnitPrice The price in € per unit for external customers
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
* @param serviceProvider The facility providing the service product
*
* @since 2.11.0
*/
ProjectManagement(String name, String description, double internalUnitPrice, double externalUnitPrice, ProductUnit unit, long runningNumber, Facility serviceProvider) {
super(name, description, internalUnitPrice, externalUnitPrice, unit, new ProductId.Builder(ProductType.PROJECT_MANAGEMENT.toString(), runningNumber).build(), serviceProvider)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode
import life.qbic.datamodel.dtos.business.ProductId
import life.qbic.datamodel.dtos.business.facilities.Facility

/**
* Describes a product for proteomics services.
Expand Down Expand Up @@ -38,8 +39,30 @@ class ProteomicAnalysis extends AtomicProduct {
* @param unitPrice The price in € per unit
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
*
* @deprecated 2.11.0
*/
@Deprecated
ProteomicAnalysis(String name, String description, double unitPrice, ProductUnit unit, long runningNumber) {
super(name, description, unitPrice, unit, new ProductId.Builder(ProductType.PROTEOMIC.toString(), runningNumber).build())
}

/**
* Basic product constructor.
*
* Checks that all passed arguments are not null.
*
* @param name The name of the product.
* @param description The description of what the product is about.
* @param internalUnitPrice The price in € per unit for internal customers
* @param externalUnitPrice The price in € per unit for external customers
* @param unit The product unit
* @param runningNumber Number used in conjunction with ProductType{@link life.qbic.datamodel.dtos.business.services.ProductType} to identify product
* @param serviceProvider The facility providing the service product
*
* @since 2.11.0
*/
ProteomicAnalysis(String name, String description, double internalUnitPrice, double externalUnitPrice, ProductUnit unit, long runningNumber, Facility serviceProvider) {
super(name, description, internalUnitPrice, externalUnitPrice, unit, new ProductId.Builder(ProductType.PROTEOMIC.toString(), runningNumber).build(), serviceProvider)
}
}
Loading