Skip to content

Commit

Permalink
Merge pull request #342 from qbicsoftware/development
Browse files Browse the repository at this point in the history
Prepare Release 2.23.0
  • Loading branch information
Steffengreiner authored Nov 24, 2022
2 parents 9a96f07 + 296e58a commit 70cfdf5
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ final class Affiliation {
*/
final AffiliationLabel label

/**
* Boolean flag if an affiliation is active
* @since 2.23.0
*/
final Boolean active

static class Builder {

int id
Expand All @@ -86,6 +92,8 @@ final class Affiliation {

AffiliationLabel label

Boolean active

Builder(String organisation, String street, String postalCode, String city) {
this.id = id
this.organisation = organisation
Expand All @@ -96,6 +104,7 @@ final class Affiliation {
this.country = "Germany"
this.category = AffiliationCategory.EXTERNAL
this.label = AffiliationLabel.MNF
this.active = Boolean.TRUE
}

Builder id(int id) {
Expand Down Expand Up @@ -128,6 +137,16 @@ final class Affiliation {
return this
}

Builder setInactive() {
this.active = Boolean.FALSE
return this
}

Builder setActive() {
this.active = Boolean.TRUE
return this
}


Affiliation build() {
return new Affiliation(this)
Expand All @@ -145,6 +164,7 @@ final class Affiliation {
this.category = builder.category
this.city = builder.city
this.label = builder.label
this.active = builder.active
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import life.qbic.datamodel.dtos.business.facilities.Facility
* @since 2.4.0
*/
@EqualsAndHashCode(callSuper = true)
class MetabolomicAnalysis extends AtomicProduct {
class MetabolomicAnalysis extends PartialProduct {
/**
* Basic product constructor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import life.qbic.datamodel.dtos.business.facilities.Facility
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class PrimaryAnalysis extends AtomicProduct {
class PrimaryAnalysis extends PartialProduct {
/**
* Basic product constructor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import life.qbic.datamodel.dtos.business.facilities.Facility
* @since 2.4.0
*/
@EqualsAndHashCode(callSuper = true)
class ProteomicAnalysis extends AtomicProduct {
class ProteomicAnalysis extends PartialProduct {

/**
* Basic product constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import life.qbic.datamodel.dtos.business.facilities.Facility
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class SecondaryAnalysis extends AtomicProduct {
class SecondaryAnalysis extends PartialProduct {
/**
* Basic product constructor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import life.qbic.datamodel.dtos.business.facilities.Facility
* @since 1.12.0
*/
@EqualsAndHashCode(callSuper = true)
class Sequencing extends AtomicProduct {
class Sequencing extends PartialProduct {
/**
* Basic product constructor.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package life.qbic.datamodel.dtos.business

import life.qbic.datamodel.dtos.business.facilities.Facility
import life.qbic.datamodel.dtos.business.services.DataStorage
import life.qbic.datamodel.dtos.business.services.ExternalServiceProduct
import life.qbic.datamodel.dtos.business.services.MetabolomicAnalysis
import life.qbic.datamodel.dtos.business.services.PrimaryAnalysis
import life.qbic.datamodel.dtos.business.services.Product
import life.qbic.datamodel.dtos.business.services.ProductUnit
import life.qbic.datamodel.dtos.business.services.ProjectManagement
import life.qbic.datamodel.dtos.business.services.ProteomicAnalysis
import life.qbic.datamodel.dtos.business.services.SecondaryAnalysis
import life.qbic.datamodel.dtos.business.services.Sequencing
import spock.lang.Specification
import spock.lang.Unroll
Expand Down Expand Up @@ -101,5 +107,23 @@ class ProductItemSpec extends Specification {
product.currency.displayName == "Euro"
}


def "ProductItems allow partial quantities for all services"() {

when: "ProductItems for all service products can be created"
ProductItem productItem = new ProductItem(quantity, product, totalPrice, quantityDiscount)

then: "No exceptions are thrown"
noExceptionThrown()

where: "for every service product"
quantity | internalUnitPrice | product | totalPrice | quantityDiscount
1.1 | 1 | new Sequencing("Sequencing", "Sequencing description", 1.0, 3.0, ProductUnit.PER_SAMPLE, 1, Facility.QBIC) | quantity * internalUnitPrice | 0.0
2.2 | 2 | new PrimaryAnalysis("Primary Analysis", "Primary Analysis description", 2.0, 4.0, ProductUnit.PER_CYCLE, 2, Facility.QBIC) | quantity * internalUnitPrice | 0.0
3.3 | 3 | new SecondaryAnalysis("Secondary Analysis", "Secondary Analysis description", 3.0, 5.0, ProductUnit.PER_DATASET, 3, Facility.QBIC) | quantity * internalUnitPrice | 0.0
4.4 | 4 | new ProteomicAnalysis("Proteomic Analysis", "Proteomic Analysis description", 4.0, 6.0, ProductUnit.PER_FLOW_CELL, 4, Facility.QBIC) | quantity * internalUnitPrice | 0.0
5.5 | 5 | new MetabolomicAnalysis("Metabolomic Analysis", "Metabolomic Analysis description", 5.0, 7.0, ProductUnit.PER_100_MICROGRAM_PEPTIDE_CHANNEL, 5, Facility.QBIC) | quantity * internalUnitPrice | 0.0
6.6 | 6 | new ProjectManagement("Project Management", "Project Management description", 6.0, 8.0, ProductUnit.PER_HOUR, 6, Facility.QBIC) | quantity * internalUnitPrice | 0.0
7.7 | 7 | new DataStorage("Data Storage", "Data Storage description", 7.0, 9.0, ProductUnit.PER_GIGABYTE, 7, Facility.QBIC) | quantity * internalUnitPrice | 0.0
8.8 | 8 | new ExternalServiceProduct("External Service", "External Service description", 8.0, 10.0, ProductUnit.PER_PROJECT, 8, Facility.CEGAT) | quantity * 10 | 0.0
}
}

0 comments on commit 70cfdf5

Please sign in to comment.