diff --git a/gradle.properties b/gradle.properties index b9cd86a25..8ce96390f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # buildscript - project id projectGroup=com.generalbytes.batm.public -projectVersion=1.2.4 +projectVersion=1.3.1 # buildscript - common dependency versions bitrafaelVersion=1.0.44 diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 068423da7..b437247e2 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -36,9 +36,9 @@ - - - + + + @@ -74,11 +74,6 @@ - - - - - @@ -103,6 +98,11 @@ + + + + + @@ -111,11 +111,6 @@ - - - - - @@ -124,15 +119,10 @@ - - - - - - - - - + + + + @@ -142,6 +132,16 @@ + + + + + + + + + + @@ -1132,7 +1132,9 @@ - + + + @@ -1655,7 +1657,7 @@ - + diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionRequest.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionRequest.java index ac4fb8d2c..050e9cfdf 100644 --- a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionRequest.java +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionRequest.java @@ -17,8 +17,11 @@ ************************************************************************************/ package com.generalbytes.batm.server.extensions; +import com.generalbytes.batm.server.extensions.quiz.QuizResult; + import java.math.BigDecimal; import java.util.Date; +import java.util.List; public interface ITransactionRequest { @@ -156,8 +159,11 @@ public interface ITransactionRequest { */ BigDecimal getDiscountQuotient(); - - - + /** + * Returns quiz results if any quiz has been activated. + * + * @return List of {@link QuizResult}. Can be null. + */ + List getQuizResults(); } diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/customfields/CustomFieldDefinitionType.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/customfields/CustomFieldDefinitionType.java index 43aea7dcc..30f42355a 100644 --- a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/customfields/CustomFieldDefinitionType.java +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/customfields/CustomFieldDefinitionType.java @@ -4,6 +4,7 @@ import com.generalbytes.batm.server.extensions.customfields.value.ChoiceCustomFieldValue; import com.generalbytes.batm.server.extensions.customfields.value.CustomFieldValue; import com.generalbytes.batm.server.extensions.customfields.value.FileCustomFieldValue; +import com.generalbytes.batm.server.extensions.customfields.value.LocalDateCustomFieldValue; import com.generalbytes.batm.server.extensions.customfields.value.StringCustomFieldValue; /** @@ -39,7 +40,12 @@ public enum CustomFieldDefinitionType { /** * Document scan or other file */ - DOCUMENT(FileCustomFieldValue.class); + DOCUMENT(FileCustomFieldValue.class), + /** + * A date value. + * Presented as date picker. + */ + DATE(LocalDateCustomFieldValue.class); private final Class allowedValueType; diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/customfields/value/LocalDateCustomFieldValue.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/customfields/value/LocalDateCustomFieldValue.java new file mode 100644 index 000000000..f3db23c11 --- /dev/null +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/customfields/value/LocalDateCustomFieldValue.java @@ -0,0 +1,20 @@ +package com.generalbytes.batm.server.extensions.customfields.value; + +import com.generalbytes.batm.server.extensions.customfields.CustomFieldDefinitionType; + +import java.time.LocalDate; + +/** + * used with {@link CustomFieldDefinitionType#DATE} + */ +public class LocalDateCustomFieldValue implements CustomFieldValue { + private final LocalDate localDateValue; + + public LocalDateCustomFieldValue(LocalDate localDateValue) { + this.localDateValue = localDateValue; + } + + public LocalDate getLocalDateValue() { + return localDateValue; + } +} diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/quiz/QuestionAnswer.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/quiz/QuestionAnswer.java new file mode 100644 index 000000000..02c8bbcdf --- /dev/null +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/quiz/QuestionAnswer.java @@ -0,0 +1,53 @@ +/************************************************************************************* + * Copyright (C) 2014-2023 GENERAL BYTES s.r.o. All rights reserved. + * + * This software may be distributed and modified under the terms of the GNU + * General Public License version 2 (GPL2) as published by the Free Software + * Foundation and appearing in the file GPL2.TXT included in the packaging of + * this file. Please note that GPL2 Section 2[b] requires that all works based + * on this software must also be made publicly available under the terms of + * the GPL2 ("Copyleft"). + * + * Contact information + * ------------------- + * + * GENERAL BYTES s.r.o. + * Web : http://www.generalbytes.com + * + ************************************************************************************/ +package com.generalbytes.batm.server.extensions.quiz; + +/** + * An object representing the question and answer data in the {@link QuizResult}. + */ +public class QuestionAnswer { + + private String question; + + private String answer; + + public QuestionAnswer() { + + } + + public QuestionAnswer(String question, String answer) { + this.question = question; + this.answer = answer; + } + + public String getQuestion() { + return question; + } + + public void setQuestion(String question) { + this.question = question; + } + + public String getAnswer() { + return answer; + } + + public void setAnswer(String answer) { + this.answer = answer; + } +} diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/quiz/QuizResult.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/quiz/QuizResult.java new file mode 100644 index 000000000..623e6c913 --- /dev/null +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/quiz/QuizResult.java @@ -0,0 +1,55 @@ +/************************************************************************************* + * Copyright (C) 2014-2023 GENERAL BYTES s.r.o. All rights reserved. + * + * This software may be distributed and modified under the terms of the GNU + * General Public License version 2 (GPL2) as published by the Free Software + * Foundation and appearing in the file GPL2.TXT included in the packaging of + * this file. Please note that GPL2 Section 2[b] requires that all works based + * on this software must also be made publicly available under the terms of + * the GPL2 ("Copyleft"). + * + * Contact information + * ------------------- + * + * GENERAL BYTES s.r.o. + * Web : http://www.generalbytes.com + * + ************************************************************************************/ +package com.generalbytes.batm.server.extensions.quiz; + +import java.util.List; + +/** + * An object representing data about quiz result. + */ +public class QuizResult { + + private String quizName; + + private List answers; + + public QuizResult() { + + } + + public QuizResult(String quizName, List answers) { + this.quizName = quizName; + this.answers = answers; + } + + public String getQuizName() { + return quizName; + } + + public void setQuizName(String quizName) { + this.quizName = quizName; + } + + public List getAnswers() { + return answers; + } + + public void setAnswers(List answers) { + this.answers = answers; + } +} diff --git a/server_extensions_api/src/test/java/com/generalbytes/batm/server/extensions/customfields/CustomFieldDefinitionTypeTest.java b/server_extensions_api/src/test/java/com/generalbytes/batm/server/extensions/customfields/CustomFieldDefinitionTypeTest.java index c92ada66a..2da70f720 100644 --- a/server_extensions_api/src/test/java/com/generalbytes/batm/server/extensions/customfields/CustomFieldDefinitionTypeTest.java +++ b/server_extensions_api/src/test/java/com/generalbytes/batm/server/extensions/customfields/CustomFieldDefinitionTypeTest.java @@ -18,5 +18,6 @@ public void isValueTypeAllowed() { assertFalse(CustomFieldDefinitionType.CHECKBOX.isValueTypeAllowed(str.getClass())); assertFalse(CustomFieldDefinitionType.IMAGE.isValueTypeAllowed(str.getClass())); assertFalse(CustomFieldDefinitionType.DOCUMENT.isValueTypeAllowed(str.getClass())); + assertFalse(CustomFieldDefinitionType.DATE.isValueTypeAllowed(str.getClass())); } } \ No newline at end of file