-
Notifications
You must be signed in to change notification settings - Fork 4
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 #251 from qbicsoftware/release/2.11.0
2.11.0 (2021-08-03) ---------------------------- **Added** * A new enumeration for facilities ``life.qbic.datamodel.dtos.business.facilities.Facility`` (<#244>) * New properties ``internalUnitPrice``, ``externalUnitPrice`` and ``serviceProvider`` for the ``life.qbic.datamodel.dtos.business.services.Product`` and its derivatives (<#245>) * New properties ``totalPrice`` and ``totalDiscountPrice`` for the ``life.qbic.datamodel.dtos.business.ProductItem`` and ``totalDiscountPrice`` for the ``life.qbic.datamodel.dtos.business.Offer`` * A ``life.qbic.datamodel.dtos.business.facilities.FacilityFactory`` to get the facility for a given string representation (<#247>) **Fixed** * ProjectSpace names are now validated (<#249>) **Dependencies** **Deprecated** * The ``unitPrice`` property in ``life.qbic.datamodel.dtos.business.services.Product``
- Loading branch information
Showing
22 changed files
with
505 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.10.0-SNAPSHOT | ||
version: 2.11.0 | ||
domain: lib | ||
language: groovy | ||
project_slug: data-model-lib | ||
|
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
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
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
54 changes: 54 additions & 0 deletions
54
src/main/groovy/life/qbic/datamodel/dtos/business/facilities/Facility.groovy
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,54 @@ | ||
package life.qbic.datamodel.dtos.business.facilities | ||
|
||
/** | ||
* <p>Controlled vocabulary for concise core facility labels.</p> | ||
* | ||
* <p>The following facilities are currently defined:</p> | ||
* | ||
* <ul> | ||
* <li>CFMB: Core Facility for Medical Bioanalytics</li> | ||
* <li>IMGAG: Institute for Medical Genetics and Applied Genomics</li> | ||
* <li>MGM: Institute for Medical Microbiology and Hygiene</li> | ||
* <li>QBIC: Quantitative Biology Center</li> | ||
* <li>PCT: Proteome Center Tübingen</li> | ||
* </ul> | ||
* | ||
* @since 2.11.0 | ||
*/ | ||
enum Facility { | ||
|
||
CFMB("Core Facility for Medical Bioanalytics"), | ||
IMGAG("Institute for Medical Genetics and Applied Genomics"), | ||
MGM("Institute for Medical Microbiology and Hygiene"), | ||
QBIC("Quantitative Biology Center"), | ||
PCT("Proteome Center Tübingen") | ||
|
||
private final String fullName | ||
|
||
/** | ||
* Creates an instance of a facility enum | ||
* @param fullName The full name representation of the enum | ||
*/ | ||
Facility(String fullName) { | ||
this.fullName = fullName | ||
} | ||
|
||
/** | ||
* Returns to the full name representation of the facility | ||
* @return | ||
*/ | ||
String getFullName() { | ||
return this.fullName | ||
} | ||
|
||
/** | ||
* Returns a String representation of the facility enum. | ||
* | ||
* Is equivalent to {@link #getFullName()}. | ||
* @return | ||
*/ | ||
@Override | ||
String toString() { | ||
return this.getFullName() | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/groovy/life/qbic/datamodel/dtos/business/facilities/FacilityFactory.groovy
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,31 @@ | ||
package life.qbic.datamodel.dtos.business.facilities | ||
|
||
import life.qbic.datamodel.dtos.EnumFactory | ||
|
||
/** | ||
* This class provides functionality for enum key retrieval | ||
* | ||
* This class retrieves the corresponding Facility for a given String | ||
* | ||
* @see Facility | ||
* @since: 2.11.0 | ||
*/ | ||
class FacilityFactory extends EnumFactory<Facility> { | ||
/** | ||
* This method returns the enum with the provided String value. | ||
* | ||
* @throws IllegalArgumentException in case the String could not be mapped | ||
* @param value the String corresponding to a key of the enum | ||
* @return the enum key for the provided string value | ||
* @since 2.11.0 | ||
*/ | ||
@Override | ||
Facility getForString(String value) { | ||
Facility desiredKey | ||
desiredKey = Facility.values().find {it.fullName.equals(value.trim())} | ||
if (!desiredKey) { | ||
throw new IllegalArgumentException("Invalid value '$value' for ${Facility.getSimpleName()}") | ||
} | ||
return desiredKey | ||
} | ||
} |
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
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
Oops, something went wrong.