Skip to content
Merged
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
@@ -1,5 +1,7 @@
package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode

/**
* Describes a product type that can only have positive natural unit multipliers (N={0,1...,inf+})
*
Expand All @@ -8,6 +10,7 @@ package life.qbic.datamodel.dtos.business.services
*
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class AtomicProduct extends Product {
/**
* Basic product constructor.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode

/**
* Describes a product for data storage services.
*
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class DataStorage extends PartialProduct {
/**
* Basic product constructor.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode

/**
* Describes a product type that can only have positive natural unit multipliers (N={0,1...,inf+})
*
Expand All @@ -9,6 +11,7 @@ package life.qbic.datamodel.dtos.business.services
*
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class PartialProduct extends Product {
/**
* Basic product constructor.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode

/**
* Describes a product for primary bioinformatic analysis services.
*
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class PrimaryAnalysis extends AtomicProduct {
/**
* Basic product constructor.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode

/**
* Holds information about a simple QBiC service product.
*
Expand All @@ -8,6 +10,7 @@ package life.qbic.datamodel.dtos.business.services
*
* @since 1.12.0
*/
@EqualsAndHashCode
abstract class Product {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode

/**
* Describes a product for project management services.
*
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class ProjectManagement extends PartialProduct {
/**
* Basic product constructor.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode

/**
* Describes a product for secondary bioinformatic analysis services.
*
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class SecondaryAnalysis extends AtomicProduct {
/**
* Basic product constructor.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package life.qbic.datamodel.dtos.business.services

import groovy.transform.EqualsAndHashCode

/**
* Describes a product for sequencing services.
*
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class Sequencing extends AtomicProduct {
/**
* Basic product constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@ class ProductItemSpec extends Specification {
def "ProductItem shall store and provide the given properties: name, description and product"() {
when:
Product product = new Sequencing("RNA Sequencing", "This package manages the pricing for all RNA sequencings", 1.0, ProductUnit.PER_SAMPLE)

def productItem = new ProductItem(3.0, product)

then:
productItem.product == product
}

def "Products shall be comparable"(){
when:
Product product = new Sequencing("RNA Sequencing", "This package manages the pricing for all RNA sequencings", 1.0, ProductUnit.PER_SAMPLE)
Product product2 = new Sequencing("RNA Sequencing", "This package manages the pricing for all RNA sequencings", 1.0, ProductUnit.PER_SAMPLE)

then:
product == product2
}


}