From 2a0ca1044158d6ea157f0075258e2df023ad7cd5 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Mon, 4 Jan 2021 12:57:26 +0100 Subject: [PATCH 1/2] Change offer id version to String --- .../life/qbic/datamodel/dtos/business/OfferId.groovy | 2 +- .../life/qbic/datamodel/dtos/business/TomatoId.groovy | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/groovy/life/qbic/datamodel/dtos/business/OfferId.groovy b/src/main/groovy/life/qbic/datamodel/dtos/business/OfferId.groovy index 10388768a..3ef705944 100644 --- a/src/main/groovy/life/qbic/datamodel/dtos/business/OfferId.groovy +++ b/src/main/groovy/life/qbic/datamodel/dtos/business/OfferId.groovy @@ -15,7 +15,7 @@ class OfferId extends TomatoId{ private static final String TYPE = "O" - OfferId(String projectConservedPart, String randomPart, int version) { + OfferId(String projectConservedPart, String randomPart, String version) { super(TYPE,projectConservedPart,randomPart,version) } diff --git a/src/main/groovy/life/qbic/datamodel/dtos/business/TomatoId.groovy b/src/main/groovy/life/qbic/datamodel/dtos/business/TomatoId.groovy index 1297232c6..0fc8395c7 100644 --- a/src/main/groovy/life/qbic/datamodel/dtos/business/TomatoId.groovy +++ b/src/main/groovy/life/qbic/datamodel/dtos/business/TomatoId.groovy @@ -23,9 +23,9 @@ abstract class TomatoId { */ private String random /** - * Version of the identifier which is a number between 0 and 9 + * Version of the identifier */ - private int version + private String version /** * Creates an identifier object with the @@ -35,7 +35,7 @@ abstract class TomatoId { * @param randomPart describes the random part of the identifier * @param version describes the version of the identifier */ - TomatoId(String type, String projectConservedPart, String randomPart, int version){ + TomatoId(String type, String projectConservedPart, String randomPart, String version){ this.type = Objects.requireNonNull(type, "type must not be null") this.projectConserved = Objects.requireNonNull(projectConservedPart, "projectConservedPart must not be null") this.random = Objects.requireNonNull(randomPart, "randomPart must not be null") @@ -74,7 +74,7 @@ abstract class TomatoId { * Returns the version of the identifier * @return */ - int getVersion() { + String getVersion() { return version } /** From c7e0d42a08340ac046f1ad22be5d7e7db9bbd7f3 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Mon, 4 Jan 2021 13:01:20 +0100 Subject: [PATCH 2/2] Adjust tests --- .../groovy/life/qbic/datamodel/dtos/business/OfferSpec.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/groovy/life/qbic/datamodel/dtos/business/OfferSpec.groovy b/src/test/groovy/life/qbic/datamodel/dtos/business/OfferSpec.groovy index d3c3fa54f..4b590b663 100644 --- a/src/test/groovy/life/qbic/datamodel/dtos/business/OfferSpec.groovy +++ b/src/test/groovy/life/qbic/datamodel/dtos/business/OfferSpec.groovy @@ -29,7 +29,7 @@ class OfferSpec extends Specification { double vat = 0.19 double overhead = 0.2 double net = 900 - OfferId offerId = new OfferId("ab", "cd", 1) + OfferId offerId = new OfferId("ab", "cd", "1") ProductItem item = new ProductItem(2,new Sequencing("DNA Sequencing","This is a sequencing package",1.50, ProductUnit.PER_SAMPLE)) when: @@ -57,7 +57,7 @@ class OfferSpec extends Specification { def "Missing optional Field definitions shall haven null values in an Offer object"() { given: - OfferId offerId = new OfferId("ab", "cd", 1) + OfferId offerId = new OfferId("ab", "cd", "1") when: Offer testOffer =