diff --git a/.gitignore b/.gitignore
index 8fba83140..433394b1f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ data/figs/.DS_Store
*.iws
*.iml
*.ipr
+.vscode/
### NetBeans ###
/nbproject/private/
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000..5e2daa09a
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,11 @@
+{
+ "java.compile.nullAnalysis.mode": "automatic",
+ "[handlebars]": {
+ "editor.formatOnSave": false,
+ "editor.formatOnPaste": false,
+ "editor.formatOnType": false
+ },
+ "files.associations": {
+ "*.hbs": "handlebars"
+ }
+}
\ No newline at end of file
diff --git a/applications/answers/.gitignore b/applications/answers/.gitignore
new file mode 100644
index 000000000..8cef91c92
--- /dev/null
+++ b/applications/answers/.gitignore
@@ -0,0 +1,30 @@
+# Build output
+target/
+build/
+
+# Logs
+logs/
+*.log
+
+# IDE
+.idea/
+.vscode/
+*.iml
+*.iws
+*.ipr
+.project
+.classpath
+.settings/
+.factorypath
+
+# OS
+.DS_Store
+Thumbs.db
+
+# Application specific
+HELP.md
+**/BehaviourReport.txt
+
+# Environment files
+src/main/resources/application-dev.properties
+src/main/resources/application-prod.properties
diff --git a/applications/answers/pom.xml b/applications/answers/pom.xml
new file mode 100644
index 000000000..fb44c54de
--- /dev/null
+++ b/applications/answers/pom.xml
@@ -0,0 +1,144 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.5.3
+
+
+ pt.ulisboa.tecnico.socialsoftware
+ answers
+ 1.0.0-SNAPSHOT
+ answers
+ answers - Generated with Nebula DSL
+
+ 21
+
+
+
+
+
+ pt.ulisboa.tecnico.socialsoftware
+ MicroservicesSimulator
+ 3.1.0-SNAPSHOT
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.hibernate.orm
+ hibernate-core
+
+
+ com.h2database
+ h2
+ runtime
+
+
+ org.postgresql
+ postgresql
+ runtime
+
+
+ org.springframework.retry
+ spring-retry
+
+
+
+
+ dev
+
+ dev
+
+
+ true
+
+
+
+ sagas
+
+ sagas
+
+
+
+ dev-sagas
+
+ dev,sagas
+
+
+
+ test-sagas
+
+ test,sagas
+
+
+
+
+ org.codehaus.gmavenplus
+ gmavenplus-plugin
+ 4.2.0
+
+
+
+ addTestSources
+ compileTests
+
+
+
+
+
+
+
+
+ test
+
+ test
+
+
+
+
+ org.codehaus.gmavenplus
+ gmavenplus-plugin
+ 4.2.0
+
+
+
+ addTestSources
+ compileTests
+
+
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/AnswersSimulator.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/AnswersSimulator.java
new file mode 100644
index 000000000..edd041969
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/AnswersSimulator.java
@@ -0,0 +1,53 @@
+package pt.ulisboa.tecnico.socialsoftware.answers;
+
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.domain.EntityScan;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.retry.annotation.EnableRetry;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import pt.ulisboa.tecnico.socialsoftware.ms.domain.event.EventService;
+
+@PropertySource({"classpath:application.properties"})
+@EnableJpaRepositories(basePackages = {
+ "pt.ulisboa.tecnico.socialsoftware.ms",
+ "pt.ulisboa.tecnico.socialsoftware.answers"
+})
+@EntityScan(basePackages = {
+ "pt.ulisboa.tecnico.socialsoftware.ms",
+ "pt.ulisboa.tecnico.socialsoftware.answers"
+})
+@EnableTransactionManagement
+@EnableJpaAuditing
+
+@EnableScheduling
+
+
+@EnableRetry
+
+@SpringBootApplication(scanBasePackages = {
+ "pt.ulisboa.tecnico.socialsoftware.ms",
+ "pt.ulisboa.tecnico.socialsoftware.answers"
+})
+public class AnswersSimulator implements InitializingBean {
+
+@Autowired
+private EventService eventService;
+
+
+public static void main(String[] args) {
+SpringApplication.run(AnswersSimulator.class, args);
+}
+
+@Override
+public void afterPropertiesSet() {
+
+eventService.clearEventsAtApplicationStartUp();
+
+}
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/ServiceMapping.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/ServiceMapping.java
new file mode 100644
index 000000000..2f9dd9eb1
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/ServiceMapping.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers;
+
+public enum ServiceMapping {
+ ANSWER("answer"),
+ COURSE("course"),
+ EXECUTION("execution"),
+ QUESTION("question"),
+ QUIZ("quiz"),
+ TOPIC("topic"),
+ TOURNAMENT("tournament"),
+ USER("user");
+
+ private final String serviceName;
+
+ ServiceMapping(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/AddAnswerQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/AddAnswerQuestionCommand.java
new file mode 100644
index 000000000..241c238dc
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/AddAnswerQuestionCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.AnswerQuestionDto;
+
+public class AddAnswerQuestionCommand extends Command {
+ private final Integer answerId;
+ private final Integer questionAggregateId;
+ private final AnswerQuestionDto questionDto;
+
+ public AddAnswerQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer answerId, Integer questionAggregateId, AnswerQuestionDto questionDto) {
+ super(unitOfWork, serviceName, null);
+ this.answerId = answerId;
+ this.questionAggregateId = questionAggregateId;
+ this.questionDto = questionDto;
+ }
+
+ public Integer getAnswerId() { return answerId; }
+ public Integer getQuestionAggregateId() { return questionAggregateId; }
+ public AnswerQuestionDto getQuestionDto() { return questionDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/AddAnswerQuestionsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/AddAnswerQuestionsCommand.java
new file mode 100644
index 000000000..027462374
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/AddAnswerQuestionsCommand.java
@@ -0,0 +1,20 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.AnswerQuestionDto;
+import java.util.List;
+
+public class AddAnswerQuestionsCommand extends Command {
+ private final Integer answerId;
+ private final List questionDtos;
+
+ public AddAnswerQuestionsCommand(UnitOfWork unitOfWork, String serviceName, Integer answerId, List questionDtos) {
+ super(unitOfWork, serviceName, null);
+ this.answerId = answerId;
+ this.questionDtos = questionDtos;
+ }
+
+ public Integer getAnswerId() { return answerId; }
+ public List getQuestionDtos() { return questionDtos; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/CreateAnswerCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/CreateAnswerCommand.java
new file mode 100644
index 000000000..fbcf3483a
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/CreateAnswerCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.answer.coordination.webapi.requestDtos.CreateAnswerRequestDto;
+
+public class CreateAnswerCommand extends Command {
+ private final CreateAnswerRequestDto createRequest;
+
+ public CreateAnswerCommand(UnitOfWork unitOfWork, String serviceName, CreateAnswerRequestDto createRequest) {
+ super(unitOfWork, serviceName, null);
+ this.createRequest = createRequest;
+ }
+
+ public CreateAnswerRequestDto getCreateRequest() { return createRequest; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/DeleteAnswerCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/DeleteAnswerCommand.java
new file mode 100644
index 000000000..91b09426f
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/DeleteAnswerCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class DeleteAnswerCommand extends Command {
+
+
+ public DeleteAnswerCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAllAnswersCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAllAnswersCommand.java
new file mode 100644
index 000000000..076680240
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAllAnswersCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAllAnswersCommand extends Command {
+
+
+ public GetAllAnswersCommand(UnitOfWork unitOfWork, String serviceName) {
+ super(unitOfWork, serviceName, null);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAnswerByIdCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAnswerByIdCommand.java
new file mode 100644
index 000000000..4e6030a33
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAnswerByIdCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAnswerByIdCommand extends Command {
+
+
+ public GetAnswerByIdCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAnswerQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAnswerQuestionCommand.java
new file mode 100644
index 000000000..03f19f938
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/GetAnswerQuestionCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAnswerQuestionCommand extends Command {
+ private final Integer answerId;
+ private final Integer questionAggregateId;
+
+ public GetAnswerQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer answerId, Integer questionAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.answerId = answerId;
+ this.questionAggregateId = questionAggregateId;
+ }
+
+ public Integer getAnswerId() { return answerId; }
+ public Integer getQuestionAggregateId() { return questionAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/RemoveAnswerQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/RemoveAnswerQuestionCommand.java
new file mode 100644
index 000000000..74afecc6c
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/RemoveAnswerQuestionCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class RemoveAnswerQuestionCommand extends Command {
+ private final Integer answerId;
+ private final Integer questionAggregateId;
+
+ public RemoveAnswerQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer answerId, Integer questionAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.answerId = answerId;
+ this.questionAggregateId = questionAggregateId;
+ }
+
+ public Integer getAnswerId() { return answerId; }
+ public Integer getQuestionAggregateId() { return questionAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/UpdateAnswerCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/UpdateAnswerCommand.java
new file mode 100644
index 000000000..d7eb89f70
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/UpdateAnswerCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.AnswerDto;
+
+public class UpdateAnswerCommand extends Command {
+ private final AnswerDto answerDto;
+
+ public UpdateAnswerCommand(UnitOfWork unitOfWork, String serviceName, AnswerDto answerDto) {
+ super(unitOfWork, serviceName, null);
+ this.answerDto = answerDto;
+ }
+
+ public AnswerDto getAnswerDto() { return answerDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/UpdateAnswerQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/UpdateAnswerQuestionCommand.java
new file mode 100644
index 000000000..ddb9f1abd
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/answer/UpdateAnswerQuestionCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.answer;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.AnswerQuestionDto;
+
+public class UpdateAnswerQuestionCommand extends Command {
+ private final Integer answerId;
+ private final Integer questionAggregateId;
+ private final AnswerQuestionDto questionDto;
+
+ public UpdateAnswerQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer answerId, Integer questionAggregateId, AnswerQuestionDto questionDto) {
+ super(unitOfWork, serviceName, null);
+ this.answerId = answerId;
+ this.questionAggregateId = questionAggregateId;
+ this.questionDto = questionDto;
+ }
+
+ public Integer getAnswerId() { return answerId; }
+ public Integer getQuestionAggregateId() { return questionAggregateId; }
+ public AnswerQuestionDto getQuestionDto() { return questionDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/CreateCourseCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/CreateCourseCommand.java
new file mode 100644
index 000000000..891300530
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/CreateCourseCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.course;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.course.coordination.webapi.requestDtos.CreateCourseRequestDto;
+
+public class CreateCourseCommand extends Command {
+ private final CreateCourseRequestDto createRequest;
+
+ public CreateCourseCommand(UnitOfWork unitOfWork, String serviceName, CreateCourseRequestDto createRequest) {
+ super(unitOfWork, serviceName, null);
+ this.createRequest = createRequest;
+ }
+
+ public CreateCourseRequestDto getCreateRequest() { return createRequest; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/DeleteCourseCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/DeleteCourseCommand.java
new file mode 100644
index 000000000..21b2f0b8a
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/DeleteCourseCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.course;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class DeleteCourseCommand extends Command {
+
+
+ public DeleteCourseCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/GetAllCoursesCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/GetAllCoursesCommand.java
new file mode 100644
index 000000000..8af8bb9d6
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/GetAllCoursesCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.course;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAllCoursesCommand extends Command {
+
+
+ public GetAllCoursesCommand(UnitOfWork unitOfWork, String serviceName) {
+ super(unitOfWork, serviceName, null);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/GetCourseByIdCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/GetCourseByIdCommand.java
new file mode 100644
index 000000000..51ac8bc9b
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/GetCourseByIdCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.course;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetCourseByIdCommand extends Command {
+
+
+ public GetCourseByIdCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/UpdateCourseCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/UpdateCourseCommand.java
new file mode 100644
index 000000000..c994e958c
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/course/UpdateCourseCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.course;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.CourseDto;
+
+public class UpdateCourseCommand extends Command {
+ private final CourseDto courseDto;
+
+ public UpdateCourseCommand(UnitOfWork unitOfWork, String serviceName, CourseDto courseDto) {
+ super(unitOfWork, serviceName, null);
+ this.courseDto = courseDto;
+ }
+
+ public CourseDto getCourseDto() { return courseDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/AddExecutionUserCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/AddExecutionUserCommand.java
new file mode 100644
index 000000000..633ffb7b7
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/AddExecutionUserCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.ExecutionUserDto;
+
+public class AddExecutionUserCommand extends Command {
+ private final Integer executionId;
+ private final Integer userAggregateId;
+ private final ExecutionUserDto userDto;
+
+ public AddExecutionUserCommand(UnitOfWork unitOfWork, String serviceName, Integer executionId, Integer userAggregateId, ExecutionUserDto userDto) {
+ super(unitOfWork, serviceName, null);
+ this.executionId = executionId;
+ this.userAggregateId = userAggregateId;
+ this.userDto = userDto;
+ }
+
+ public Integer getExecutionId() { return executionId; }
+ public Integer getUserAggregateId() { return userAggregateId; }
+ public ExecutionUserDto getUserDto() { return userDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/AddExecutionUsersCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/AddExecutionUsersCommand.java
new file mode 100644
index 000000000..1c51c0520
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/AddExecutionUsersCommand.java
@@ -0,0 +1,20 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.ExecutionUserDto;
+import java.util.List;
+
+public class AddExecutionUsersCommand extends Command {
+ private final Integer executionId;
+ private final List userDtos;
+
+ public AddExecutionUsersCommand(UnitOfWork unitOfWork, String serviceName, Integer executionId, List userDtos) {
+ super(unitOfWork, serviceName, null);
+ this.executionId = executionId;
+ this.userDtos = userDtos;
+ }
+
+ public Integer getExecutionId() { return executionId; }
+ public List getUserDtos() { return userDtos; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/CreateExecutionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/CreateExecutionCommand.java
new file mode 100644
index 000000000..74c007b38
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/CreateExecutionCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.execution.coordination.webapi.requestDtos.CreateExecutionRequestDto;
+
+public class CreateExecutionCommand extends Command {
+ private final CreateExecutionRequestDto createRequest;
+
+ public CreateExecutionCommand(UnitOfWork unitOfWork, String serviceName, CreateExecutionRequestDto createRequest) {
+ super(unitOfWork, serviceName, null);
+ this.createRequest = createRequest;
+ }
+
+ public CreateExecutionRequestDto getCreateRequest() { return createRequest; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/DeleteExecutionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/DeleteExecutionCommand.java
new file mode 100644
index 000000000..565197e97
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/DeleteExecutionCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class DeleteExecutionCommand extends Command {
+
+
+ public DeleteExecutionCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetAllExecutionsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetAllExecutionsCommand.java
new file mode 100644
index 000000000..f3d910827
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetAllExecutionsCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAllExecutionsCommand extends Command {
+
+
+ public GetAllExecutionsCommand(UnitOfWork unitOfWork, String serviceName) {
+ super(unitOfWork, serviceName, null);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetExecutionByIdCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetExecutionByIdCommand.java
new file mode 100644
index 000000000..c616f9981
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetExecutionByIdCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetExecutionByIdCommand extends Command {
+
+
+ public GetExecutionByIdCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetExecutionUserCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetExecutionUserCommand.java
new file mode 100644
index 000000000..bd1a46ea9
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/GetExecutionUserCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetExecutionUserCommand extends Command {
+ private final Integer executionId;
+ private final Integer userAggregateId;
+
+ public GetExecutionUserCommand(UnitOfWork unitOfWork, String serviceName, Integer executionId, Integer userAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.executionId = executionId;
+ this.userAggregateId = userAggregateId;
+ }
+
+ public Integer getExecutionId() { return executionId; }
+ public Integer getUserAggregateId() { return userAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/RemoveExecutionUserCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/RemoveExecutionUserCommand.java
new file mode 100644
index 000000000..ce46eb5ab
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/RemoveExecutionUserCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class RemoveExecutionUserCommand extends Command {
+ private final Integer executionId;
+ private final Integer userAggregateId;
+
+ public RemoveExecutionUserCommand(UnitOfWork unitOfWork, String serviceName, Integer executionId, Integer userAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.executionId = executionId;
+ this.userAggregateId = userAggregateId;
+ }
+
+ public Integer getExecutionId() { return executionId; }
+ public Integer getUserAggregateId() { return userAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/UpdateExecutionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/UpdateExecutionCommand.java
new file mode 100644
index 000000000..2063a60a6
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/UpdateExecutionCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.ExecutionDto;
+
+public class UpdateExecutionCommand extends Command {
+ private final ExecutionDto executionDto;
+
+ public UpdateExecutionCommand(UnitOfWork unitOfWork, String serviceName, ExecutionDto executionDto) {
+ super(unitOfWork, serviceName, null);
+ this.executionDto = executionDto;
+ }
+
+ public ExecutionDto getExecutionDto() { return executionDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/UpdateExecutionUserCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/UpdateExecutionUserCommand.java
new file mode 100644
index 000000000..6eda12bf7
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/execution/UpdateExecutionUserCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.execution;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.ExecutionUserDto;
+
+public class UpdateExecutionUserCommand extends Command {
+ private final Integer executionId;
+ private final Integer userAggregateId;
+ private final ExecutionUserDto userDto;
+
+ public UpdateExecutionUserCommand(UnitOfWork unitOfWork, String serviceName, Integer executionId, Integer userAggregateId, ExecutionUserDto userDto) {
+ super(unitOfWork, serviceName, null);
+ this.executionId = executionId;
+ this.userAggregateId = userAggregateId;
+ this.userDto = userDto;
+ }
+
+ public Integer getExecutionId() { return executionId; }
+ public Integer getUserAggregateId() { return userAggregateId; }
+ public ExecutionUserDto getUserDto() { return userDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionOptionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionOptionCommand.java
new file mode 100644
index 000000000..827255068
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionOptionCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.OptionDto;
+
+public class AddQuestionOptionCommand extends Command {
+ private final Integer questionId;
+ private final Integer key;
+ private final OptionDto optionDto;
+
+ public AddQuestionOptionCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, Integer key, OptionDto optionDto) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.key = key;
+ this.optionDto = optionDto;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public Integer getKey() { return key; }
+ public OptionDto getOptionDto() { return optionDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionOptionsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionOptionsCommand.java
new file mode 100644
index 000000000..c4fc96380
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionOptionsCommand.java
@@ -0,0 +1,20 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.OptionDto;
+import java.util.List;
+
+public class AddQuestionOptionsCommand extends Command {
+ private final Integer questionId;
+ private final List optionDtos;
+
+ public AddQuestionOptionsCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, List optionDtos) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.optionDtos = optionDtos;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public List getOptionDtos() { return optionDtos; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionTopicCommand.java
new file mode 100644
index 000000000..c61e1afca
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionTopicCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.QuestionTopicDto;
+
+public class AddQuestionTopicCommand extends Command {
+ private final Integer questionId;
+ private final Integer topicAggregateId;
+ private final QuestionTopicDto topicDto;
+
+ public AddQuestionTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, Integer topicAggregateId, QuestionTopicDto topicDto) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.topicAggregateId = topicAggregateId;
+ this.topicDto = topicDto;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public Integer getTopicAggregateId() { return topicAggregateId; }
+ public QuestionTopicDto getTopicDto() { return topicDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionTopicsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionTopicsCommand.java
new file mode 100644
index 000000000..c07a648b6
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/AddQuestionTopicsCommand.java
@@ -0,0 +1,20 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.QuestionTopicDto;
+import java.util.List;
+
+public class AddQuestionTopicsCommand extends Command {
+ private final Integer questionId;
+ private final List topicDtos;
+
+ public AddQuestionTopicsCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, List topicDtos) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.topicDtos = topicDtos;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public List getTopicDtos() { return topicDtos; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/CreateQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/CreateQuestionCommand.java
new file mode 100644
index 000000000..385773ec3
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/CreateQuestionCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.question.coordination.webapi.requestDtos.CreateQuestionRequestDto;
+
+public class CreateQuestionCommand extends Command {
+ private final CreateQuestionRequestDto createRequest;
+
+ public CreateQuestionCommand(UnitOfWork unitOfWork, String serviceName, CreateQuestionRequestDto createRequest) {
+ super(unitOfWork, serviceName, null);
+ this.createRequest = createRequest;
+ }
+
+ public CreateQuestionRequestDto getCreateRequest() { return createRequest; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/DeleteQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/DeleteQuestionCommand.java
new file mode 100644
index 000000000..d74cd2b65
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/DeleteQuestionCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class DeleteQuestionCommand extends Command {
+
+
+ public DeleteQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetAllQuestionsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetAllQuestionsCommand.java
new file mode 100644
index 000000000..8d36f3a38
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetAllQuestionsCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAllQuestionsCommand extends Command {
+
+
+ public GetAllQuestionsCommand(UnitOfWork unitOfWork, String serviceName) {
+ super(unitOfWork, serviceName, null);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionByIdCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionByIdCommand.java
new file mode 100644
index 000000000..316eaf284
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionByIdCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetQuestionByIdCommand extends Command {
+
+
+ public GetQuestionByIdCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionOptionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionOptionCommand.java
new file mode 100644
index 000000000..db9e97e33
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionOptionCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetQuestionOptionCommand extends Command {
+ private final Integer questionId;
+ private final Integer key;
+
+ public GetQuestionOptionCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, Integer key) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.key = key;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public Integer getKey() { return key; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionTopicCommand.java
new file mode 100644
index 000000000..b7ef8f714
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/GetQuestionTopicCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetQuestionTopicCommand extends Command {
+ private final Integer questionId;
+ private final Integer topicAggregateId;
+
+ public GetQuestionTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, Integer topicAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.topicAggregateId = topicAggregateId;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public Integer getTopicAggregateId() { return topicAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/RemoveQuestionOptionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/RemoveQuestionOptionCommand.java
new file mode 100644
index 000000000..0c123f892
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/RemoveQuestionOptionCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class RemoveQuestionOptionCommand extends Command {
+ private final Integer questionId;
+ private final Integer key;
+
+ public RemoveQuestionOptionCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, Integer key) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.key = key;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public Integer getKey() { return key; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/RemoveQuestionTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/RemoveQuestionTopicCommand.java
new file mode 100644
index 000000000..59b3d767b
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/RemoveQuestionTopicCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class RemoveQuestionTopicCommand extends Command {
+ private final Integer questionId;
+ private final Integer topicAggregateId;
+
+ public RemoveQuestionTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, Integer topicAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.topicAggregateId = topicAggregateId;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public Integer getTopicAggregateId() { return topicAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionCommand.java
new file mode 100644
index 000000000..ad9718622
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.QuestionDto;
+
+public class UpdateQuestionCommand extends Command {
+ private final QuestionDto questionDto;
+
+ public UpdateQuestionCommand(UnitOfWork unitOfWork, String serviceName, QuestionDto questionDto) {
+ super(unitOfWork, serviceName, null);
+ this.questionDto = questionDto;
+ }
+
+ public QuestionDto getQuestionDto() { return questionDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionOptionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionOptionCommand.java
new file mode 100644
index 000000000..1c08ddc26
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionOptionCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.OptionDto;
+
+public class UpdateQuestionOptionCommand extends Command {
+ private final Integer questionId;
+ private final Integer key;
+ private final OptionDto optionDto;
+
+ public UpdateQuestionOptionCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, Integer key, OptionDto optionDto) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.key = key;
+ this.optionDto = optionDto;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public Integer getKey() { return key; }
+ public OptionDto getOptionDto() { return optionDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionTopicCommand.java
new file mode 100644
index 000000000..67c210695
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/question/UpdateQuestionTopicCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.question;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.QuestionTopicDto;
+
+public class UpdateQuestionTopicCommand extends Command {
+ private final Integer questionId;
+ private final Integer topicAggregateId;
+ private final QuestionTopicDto topicDto;
+
+ public UpdateQuestionTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer questionId, Integer topicAggregateId, QuestionTopicDto topicDto) {
+ super(unitOfWork, serviceName, null);
+ this.questionId = questionId;
+ this.topicAggregateId = topicAggregateId;
+ this.topicDto = topicDto;
+ }
+
+ public Integer getQuestionId() { return questionId; }
+ public Integer getTopicAggregateId() { return topicAggregateId; }
+ public QuestionTopicDto getTopicDto() { return topicDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/AddQuizQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/AddQuizQuestionCommand.java
new file mode 100644
index 000000000..a1243306e
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/AddQuizQuestionCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.QuizQuestionDto;
+
+public class AddQuizQuestionCommand extends Command {
+ private final Integer quizId;
+ private final Integer questionAggregateId;
+ private final QuizQuestionDto questionDto;
+
+ public AddQuizQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer quizId, Integer questionAggregateId, QuizQuestionDto questionDto) {
+ super(unitOfWork, serviceName, null);
+ this.quizId = quizId;
+ this.questionAggregateId = questionAggregateId;
+ this.questionDto = questionDto;
+ }
+
+ public Integer getQuizId() { return quizId; }
+ public Integer getQuestionAggregateId() { return questionAggregateId; }
+ public QuizQuestionDto getQuestionDto() { return questionDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/AddQuizQuestionsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/AddQuizQuestionsCommand.java
new file mode 100644
index 000000000..637fbc8a6
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/AddQuizQuestionsCommand.java
@@ -0,0 +1,20 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.QuizQuestionDto;
+import java.util.List;
+
+public class AddQuizQuestionsCommand extends Command {
+ private final Integer quizId;
+ private final List questionDtos;
+
+ public AddQuizQuestionsCommand(UnitOfWork unitOfWork, String serviceName, Integer quizId, List questionDtos) {
+ super(unitOfWork, serviceName, null);
+ this.quizId = quizId;
+ this.questionDtos = questionDtos;
+ }
+
+ public Integer getQuizId() { return quizId; }
+ public List getQuestionDtos() { return questionDtos; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/CreateQuizCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/CreateQuizCommand.java
new file mode 100644
index 000000000..5873c1800
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/CreateQuizCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.quiz.coordination.webapi.requestDtos.CreateQuizRequestDto;
+
+public class CreateQuizCommand extends Command {
+ private final CreateQuizRequestDto createRequest;
+
+ public CreateQuizCommand(UnitOfWork unitOfWork, String serviceName, CreateQuizRequestDto createRequest) {
+ super(unitOfWork, serviceName, null);
+ this.createRequest = createRequest;
+ }
+
+ public CreateQuizRequestDto getCreateRequest() { return createRequest; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/DeleteQuizCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/DeleteQuizCommand.java
new file mode 100644
index 000000000..ae772c75b
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/DeleteQuizCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class DeleteQuizCommand extends Command {
+
+
+ public DeleteQuizCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetAllQuizsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetAllQuizsCommand.java
new file mode 100644
index 000000000..5381e8ddb
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetAllQuizsCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAllQuizsCommand extends Command {
+
+
+ public GetAllQuizsCommand(UnitOfWork unitOfWork, String serviceName) {
+ super(unitOfWork, serviceName, null);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetQuizByIdCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetQuizByIdCommand.java
new file mode 100644
index 000000000..aec70dda9
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetQuizByIdCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetQuizByIdCommand extends Command {
+
+
+ public GetQuizByIdCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetQuizQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetQuizQuestionCommand.java
new file mode 100644
index 000000000..078a4acca
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/GetQuizQuestionCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetQuizQuestionCommand extends Command {
+ private final Integer quizId;
+ private final Integer questionAggregateId;
+
+ public GetQuizQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer quizId, Integer questionAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.quizId = quizId;
+ this.questionAggregateId = questionAggregateId;
+ }
+
+ public Integer getQuizId() { return quizId; }
+ public Integer getQuestionAggregateId() { return questionAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/RemoveQuizQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/RemoveQuizQuestionCommand.java
new file mode 100644
index 000000000..996ddb8f4
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/RemoveQuizQuestionCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class RemoveQuizQuestionCommand extends Command {
+ private final Integer quizId;
+ private final Integer questionAggregateId;
+
+ public RemoveQuizQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer quizId, Integer questionAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.quizId = quizId;
+ this.questionAggregateId = questionAggregateId;
+ }
+
+ public Integer getQuizId() { return quizId; }
+ public Integer getQuestionAggregateId() { return questionAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/UpdateQuizCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/UpdateQuizCommand.java
new file mode 100644
index 000000000..1046839ac
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/UpdateQuizCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.QuizDto;
+
+public class UpdateQuizCommand extends Command {
+ private final QuizDto quizDto;
+
+ public UpdateQuizCommand(UnitOfWork unitOfWork, String serviceName, QuizDto quizDto) {
+ super(unitOfWork, serviceName, null);
+ this.quizDto = quizDto;
+ }
+
+ public QuizDto getQuizDto() { return quizDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/UpdateQuizQuestionCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/UpdateQuizQuestionCommand.java
new file mode 100644
index 000000000..88304beea
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/quiz/UpdateQuizQuestionCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.quiz;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.QuizQuestionDto;
+
+public class UpdateQuizQuestionCommand extends Command {
+ private final Integer quizId;
+ private final Integer questionAggregateId;
+ private final QuizQuestionDto questionDto;
+
+ public UpdateQuizQuestionCommand(UnitOfWork unitOfWork, String serviceName, Integer quizId, Integer questionAggregateId, QuizQuestionDto questionDto) {
+ super(unitOfWork, serviceName, null);
+ this.quizId = quizId;
+ this.questionAggregateId = questionAggregateId;
+ this.questionDto = questionDto;
+ }
+
+ public Integer getQuizId() { return quizId; }
+ public Integer getQuestionAggregateId() { return questionAggregateId; }
+ public QuizQuestionDto getQuestionDto() { return questionDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/CreateTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/CreateTopicCommand.java
new file mode 100644
index 000000000..777ec7ad3
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/CreateTopicCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.topic;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.topic.coordination.webapi.requestDtos.CreateTopicRequestDto;
+
+public class CreateTopicCommand extends Command {
+ private final CreateTopicRequestDto createRequest;
+
+ public CreateTopicCommand(UnitOfWork unitOfWork, String serviceName, CreateTopicRequestDto createRequest) {
+ super(unitOfWork, serviceName, null);
+ this.createRequest = createRequest;
+ }
+
+ public CreateTopicRequestDto getCreateRequest() { return createRequest; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/DeleteTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/DeleteTopicCommand.java
new file mode 100644
index 000000000..b7a460e15
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/DeleteTopicCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.topic;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class DeleteTopicCommand extends Command {
+
+
+ public DeleteTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/GetAllTopicsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/GetAllTopicsCommand.java
new file mode 100644
index 000000000..0268cbf8c
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/GetAllTopicsCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.topic;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAllTopicsCommand extends Command {
+
+
+ public GetAllTopicsCommand(UnitOfWork unitOfWork, String serviceName) {
+ super(unitOfWork, serviceName, null);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/GetTopicByIdCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/GetTopicByIdCommand.java
new file mode 100644
index 000000000..f2225f59a
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/GetTopicByIdCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.topic;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetTopicByIdCommand extends Command {
+
+
+ public GetTopicByIdCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/UpdateTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/UpdateTopicCommand.java
new file mode 100644
index 000000000..9c0cc08b4
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/topic/UpdateTopicCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.topic;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.TopicDto;
+
+public class UpdateTopicCommand extends Command {
+ private final TopicDto topicDto;
+
+ public UpdateTopicCommand(UnitOfWork unitOfWork, String serviceName, TopicDto topicDto) {
+ super(unitOfWork, serviceName, null);
+ this.topicDto = topicDto;
+ }
+
+ public TopicDto getTopicDto() { return topicDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentParticipantCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentParticipantCommand.java
new file mode 100644
index 000000000..dcf045e83
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentParticipantCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.TournamentParticipantDto;
+
+public class AddTournamentParticipantCommand extends Command {
+ private final Integer tournamentId;
+ private final Integer participantAggregateId;
+ private final TournamentParticipantDto participantDto;
+
+ public AddTournamentParticipantCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, Integer participantAggregateId, TournamentParticipantDto participantDto) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.participantAggregateId = participantAggregateId;
+ this.participantDto = participantDto;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public Integer getParticipantAggregateId() { return participantAggregateId; }
+ public TournamentParticipantDto getParticipantDto() { return participantDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentParticipantsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentParticipantsCommand.java
new file mode 100644
index 000000000..a3f2669b1
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentParticipantsCommand.java
@@ -0,0 +1,20 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.TournamentParticipantDto;
+import java.util.List;
+
+public class AddTournamentParticipantsCommand extends Command {
+ private final Integer tournamentId;
+ private final List participantDtos;
+
+ public AddTournamentParticipantsCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, List participantDtos) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.participantDtos = participantDtos;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public List getParticipantDtos() { return participantDtos; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentTopicCommand.java
new file mode 100644
index 000000000..5dabac3fe
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentTopicCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.TournamentTopicDto;
+
+public class AddTournamentTopicCommand extends Command {
+ private final Integer tournamentId;
+ private final Integer topicAggregateId;
+ private final TournamentTopicDto topicDto;
+
+ public AddTournamentTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, Integer topicAggregateId, TournamentTopicDto topicDto) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.topicAggregateId = topicAggregateId;
+ this.topicDto = topicDto;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public Integer getTopicAggregateId() { return topicAggregateId; }
+ public TournamentTopicDto getTopicDto() { return topicDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentTopicsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentTopicsCommand.java
new file mode 100644
index 000000000..156312a94
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/AddTournamentTopicsCommand.java
@@ -0,0 +1,20 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.TournamentTopicDto;
+import java.util.List;
+
+public class AddTournamentTopicsCommand extends Command {
+ private final Integer tournamentId;
+ private final List topicDtos;
+
+ public AddTournamentTopicsCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, List topicDtos) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.topicDtos = topicDtos;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public List getTopicDtos() { return topicDtos; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/CreateTournamentCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/CreateTournamentCommand.java
new file mode 100644
index 000000000..4287291d7
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/CreateTournamentCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.tournament.coordination.webapi.requestDtos.CreateTournamentRequestDto;
+
+public class CreateTournamentCommand extends Command {
+ private final CreateTournamentRequestDto createRequest;
+
+ public CreateTournamentCommand(UnitOfWork unitOfWork, String serviceName, CreateTournamentRequestDto createRequest) {
+ super(unitOfWork, serviceName, null);
+ this.createRequest = createRequest;
+ }
+
+ public CreateTournamentRequestDto getCreateRequest() { return createRequest; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/DeleteTournamentCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/DeleteTournamentCommand.java
new file mode 100644
index 000000000..e51dad46b
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/DeleteTournamentCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class DeleteTournamentCommand extends Command {
+
+
+ public DeleteTournamentCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetAllTournamentsCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetAllTournamentsCommand.java
new file mode 100644
index 000000000..2b60bfaa5
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetAllTournamentsCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAllTournamentsCommand extends Command {
+
+
+ public GetAllTournamentsCommand(UnitOfWork unitOfWork, String serviceName) {
+ super(unitOfWork, serviceName, null);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentByIdCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentByIdCommand.java
new file mode 100644
index 000000000..4375480a8
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentByIdCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetTournamentByIdCommand extends Command {
+
+
+ public GetTournamentByIdCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentParticipantCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentParticipantCommand.java
new file mode 100644
index 000000000..e162f3024
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentParticipantCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetTournamentParticipantCommand extends Command {
+ private final Integer tournamentId;
+ private final Integer participantAggregateId;
+
+ public GetTournamentParticipantCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, Integer participantAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.participantAggregateId = participantAggregateId;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public Integer getParticipantAggregateId() { return participantAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentTopicCommand.java
new file mode 100644
index 000000000..b109a2404
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/GetTournamentTopicCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetTournamentTopicCommand extends Command {
+ private final Integer tournamentId;
+ private final Integer topicAggregateId;
+
+ public GetTournamentTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, Integer topicAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.topicAggregateId = topicAggregateId;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public Integer getTopicAggregateId() { return topicAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/RemoveTournamentParticipantCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/RemoveTournamentParticipantCommand.java
new file mode 100644
index 000000000..ee15d5c02
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/RemoveTournamentParticipantCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class RemoveTournamentParticipantCommand extends Command {
+ private final Integer tournamentId;
+ private final Integer participantAggregateId;
+
+ public RemoveTournamentParticipantCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, Integer participantAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.participantAggregateId = participantAggregateId;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public Integer getParticipantAggregateId() { return participantAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/RemoveTournamentTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/RemoveTournamentTopicCommand.java
new file mode 100644
index 000000000..8352b300a
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/RemoveTournamentTopicCommand.java
@@ -0,0 +1,18 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class RemoveTournamentTopicCommand extends Command {
+ private final Integer tournamentId;
+ private final Integer topicAggregateId;
+
+ public RemoveTournamentTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, Integer topicAggregateId) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.topicAggregateId = topicAggregateId;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public Integer getTopicAggregateId() { return topicAggregateId; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentCommand.java
new file mode 100644
index 000000000..a2af2e6b0
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.TournamentDto;
+
+public class UpdateTournamentCommand extends Command {
+ private final TournamentDto tournamentDto;
+
+ public UpdateTournamentCommand(UnitOfWork unitOfWork, String serviceName, TournamentDto tournamentDto) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentDto = tournamentDto;
+ }
+
+ public TournamentDto getTournamentDto() { return tournamentDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentParticipantCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentParticipantCommand.java
new file mode 100644
index 000000000..dfab86feb
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentParticipantCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.TournamentParticipantDto;
+
+public class UpdateTournamentParticipantCommand extends Command {
+ private final Integer tournamentId;
+ private final Integer participantAggregateId;
+ private final TournamentParticipantDto participantDto;
+
+ public UpdateTournamentParticipantCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, Integer participantAggregateId, TournamentParticipantDto participantDto) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.participantAggregateId = participantAggregateId;
+ this.participantDto = participantDto;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public Integer getParticipantAggregateId() { return participantAggregateId; }
+ public TournamentParticipantDto getParticipantDto() { return participantDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentTopicCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentTopicCommand.java
new file mode 100644
index 000000000..bec8875ed
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/tournament/UpdateTournamentTopicCommand.java
@@ -0,0 +1,22 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.tournament;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.TournamentTopicDto;
+
+public class UpdateTournamentTopicCommand extends Command {
+ private final Integer tournamentId;
+ private final Integer topicAggregateId;
+ private final TournamentTopicDto topicDto;
+
+ public UpdateTournamentTopicCommand(UnitOfWork unitOfWork, String serviceName, Integer tournamentId, Integer topicAggregateId, TournamentTopicDto topicDto) {
+ super(unitOfWork, serviceName, null);
+ this.tournamentId = tournamentId;
+ this.topicAggregateId = topicAggregateId;
+ this.topicDto = topicDto;
+ }
+
+ public Integer getTournamentId() { return tournamentId; }
+ public Integer getTopicAggregateId() { return topicAggregateId; }
+ public TournamentTopicDto getTopicDto() { return topicDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/CreateUserCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/CreateUserCommand.java
new file mode 100644
index 000000000..678c58574
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/CreateUserCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.user;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.user.coordination.webapi.requestDtos.CreateUserRequestDto;
+
+public class CreateUserCommand extends Command {
+ private final CreateUserRequestDto createRequest;
+
+ public CreateUserCommand(UnitOfWork unitOfWork, String serviceName, CreateUserRequestDto createRequest) {
+ super(unitOfWork, serviceName, null);
+ this.createRequest = createRequest;
+ }
+
+ public CreateUserRequestDto getCreateRequest() { return createRequest; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/DeleteUserCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/DeleteUserCommand.java
new file mode 100644
index 000000000..12553f3ca
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/DeleteUserCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.user;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class DeleteUserCommand extends Command {
+
+
+ public DeleteUserCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/GetAllUsersCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/GetAllUsersCommand.java
new file mode 100644
index 000000000..b32368449
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/GetAllUsersCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.user;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetAllUsersCommand extends Command {
+
+
+ public GetAllUsersCommand(UnitOfWork unitOfWork, String serviceName) {
+ super(unitOfWork, serviceName, null);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/GetUserByIdCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/GetUserByIdCommand.java
new file mode 100644
index 000000000..149880824
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/GetUserByIdCommand.java
@@ -0,0 +1,15 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.user;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+
+public class GetUserByIdCommand extends Command {
+
+
+ public GetUserByIdCommand(UnitOfWork unitOfWork, String serviceName, Integer aggregateId) {
+ super(unitOfWork, serviceName, aggregateId);
+
+ }
+
+
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/UpdateUserCommand.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/UpdateUserCommand.java
new file mode 100644
index 000000000..91ac31fea
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/command/user/UpdateUserCommand.java
@@ -0,0 +1,16 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.command.user;
+
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.unitOfWork.UnitOfWork;
+import pt.ulisboa.tecnico.socialsoftware.ms.coordination.workflow.command.Command;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.dtos.UserDto;
+
+public class UpdateUserCommand extends Command {
+ private final UserDto userDto;
+
+ public UpdateUserCommand(UnitOfWork unitOfWork, String serviceName, UserDto userDto) {
+ super(unitOfWork, serviceName, null);
+ this.userDto = userDto;
+ }
+
+ public UserDto getUserDto() { return userDto; }
+}
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerBusinessRuleValidator.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerBusinessRuleValidator.java
new file mode 100644
index 000000000..9e2d9a044
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerBusinessRuleValidator.java
@@ -0,0 +1,23 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
+
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.answer.aggregate.Answer;
+
+public class AnswerBusinessRuleValidator implements ConstraintValidator {
+
+ @Override
+ public void initialize(ValidAnswerBusinessRule constraintAnnotation) {
+ }
+
+ @Override
+ public boolean isValid(Answer value, ConstraintValidatorContext context) {
+ if (value == null) {
+ return true; // Let @NotNull handle null validation
+ }
+
+ // Implement business rule validation logic for Answer
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerInvariants.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerInvariants.java
new file mode 100644
index 000000000..e362e8b34
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerInvariants.java
@@ -0,0 +1,92 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.answer.aggregate.Answer;
+
+/**
+ * Invariant validation methods for Answer
+ */
+public class AnswerInvariants {
+
+ /**
+ * CreationDate cannot be null
+ */
+ public static void invariantCreationDateNotNull(Answer entity) {
+ if (entity.getCreationDate() == null) {
+ throw new IllegalStateException("CreationDate cannot be null");
+ }
+ }
+
+ /**
+ * AnswerDate cannot be null
+ */
+ public static void invariantAnswerDateNotNull(Answer entity) {
+ if (entity.getAnswerDate() == null) {
+ throw new IllegalStateException("AnswerDate cannot be null");
+ }
+ }
+
+ /**
+ * Completed cannot be null
+ */
+ public static void invariantCompletedNotNull(Answer entity) {
+ if (entity.getCompleted() == null) {
+ throw new IllegalStateException("Completed cannot be null");
+ }
+ }
+
+ /**
+ * Execution cannot be null
+ */
+ public static void invariantExecutionNotNull(Answer entity) {
+ if (entity.getExecution() == null) {
+ throw new IllegalStateException("Execution cannot be null");
+ }
+ }
+
+ /**
+ * User cannot be null
+ */
+ public static void invariantUserNotNull(Answer entity) {
+ if (entity.getUser() == null) {
+ throw new IllegalStateException("User cannot be null");
+ }
+ }
+
+ /**
+ * Quiz cannot be null
+ */
+ public static void invariantQuizNotNull(Answer entity) {
+ if (entity.getQuiz() == null) {
+ throw new IllegalStateException("Quiz cannot be null");
+ }
+ }
+
+ /**
+ * Questions cannot be null
+ */
+ public static void invariantQuestionsNotNull(Answer entity) {
+ if (entity.getQuestions() == null) {
+ throw new IllegalStateException("Questions cannot be null");
+ }
+ }
+
+ /**
+ * Questions cannot be empty
+ */
+ public static void invariantQuestionsNotEmpty(Answer entity) {
+ if (entity.getQuestions() == null || ((java.util.Collection) entity.getQuestions()).isEmpty()) {
+ throw new IllegalStateException("Questions cannot be empty");
+ }
+ }
+
+ /**
+ * Answer aggregate must be in a valid state
+ */
+ public static void invariantAnswerValid(Answer entity) {
+ // Aggregate-level validation logic
+ // Validate business rules that span multiple properties
+ // Example: startDate must be before endDate
+ // Note: Aggregate-specific invariants should be defined in DSL invariants block
+ }
+
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerValidationAnnotations.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerValidationAnnotations.java
new file mode 100644
index 000000000..20017667c
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/AnswerValidationAnnotations.java
@@ -0,0 +1,106 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import java.time.LocalDateTime;
+import java.util.List;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.answer.aggregate.AnswerExecution;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.answer.aggregate.AnswerQuestion;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.answer.aggregate.AnswerQuiz;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.answer.aggregate.AnswerUser;
+
+public class AnswerValidationAnnotations {
+
+ public static class CreationDateValidation {
+ @NotNull
+ private LocalDateTime creationDate;
+
+ public LocalDateTime getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(LocalDateTime creationDate) {
+ this.creationDate = creationDate;
+ }
+ }
+
+ public static class AnswerDateValidation {
+ @NotNull
+ private LocalDateTime answerDate;
+
+ public LocalDateTime getAnswerDate() {
+ return answerDate;
+ }
+
+ public void setAnswerDate(LocalDateTime answerDate) {
+ this.answerDate = answerDate;
+ }
+ }
+
+ public static class CompletedValidation {
+ @NotNull
+ private Boolean completed;
+
+ public Boolean getCompleted() {
+ return completed;
+ }
+
+ public void setCompleted(Boolean completed) {
+ this.completed = completed;
+ }
+ }
+
+ public static class ExecutionValidation {
+ @NotNull
+ private AnswerExecution execution;
+
+ public AnswerExecution getExecution() {
+ return execution;
+ }
+
+ public void setExecution(AnswerExecution execution) {
+ this.execution = execution;
+ }
+ }
+
+ public static class UserValidation {
+ @NotNull
+ private AnswerUser user;
+
+ public AnswerUser getUser() {
+ return user;
+ }
+
+ public void setUser(AnswerUser user) {
+ this.user = user;
+ }
+ }
+
+ public static class QuizValidation {
+ @NotNull
+ private AnswerQuiz quiz;
+
+ public AnswerQuiz getQuiz() {
+ return quiz;
+ }
+
+ public void setQuiz(AnswerQuiz quiz) {
+ this.quiz = quiz;
+ }
+ }
+
+ public static class QuestionsValidation {
+ @NotNull
+ @NotEmpty
+ private List questions;
+
+ public List getQuestions() {
+ return questions;
+ }
+
+ public void setQuestions(List questions) {
+ this.questions = questions;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseBusinessRuleValidator.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseBusinessRuleValidator.java
new file mode 100644
index 000000000..90ef8e0d0
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseBusinessRuleValidator.java
@@ -0,0 +1,23 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
+
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.course.aggregate.Course;
+
+public class CourseBusinessRuleValidator implements ConstraintValidator {
+
+ @Override
+ public void initialize(ValidCourseBusinessRule constraintAnnotation) {
+ }
+
+ @Override
+ public boolean isValid(Course value, ConstraintValidatorContext context) {
+ if (value == null) {
+ return true; // Let @NotNull handle null validation
+ }
+
+ // Implement business rule validation logic for Course
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseInvariants.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseInvariants.java
new file mode 100644
index 000000000..8332a3fcc
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseInvariants.java
@@ -0,0 +1,56 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.course.aggregate.Course;
+
+/**
+ * Invariant validation methods for Course
+ */
+public class CourseInvariants {
+
+ /**
+ * Name cannot be null
+ */
+ public static void invariantNameNotNull(Course entity) {
+ if (entity.getName() == null) {
+ throw new IllegalStateException("Name cannot be null");
+ }
+ }
+
+ /**
+ * Name cannot be blank
+ */
+ public static void invariantNameNotBlank(Course entity) {
+ if (entity.getName() == null || entity.getName().trim().isEmpty()) {
+ throw new IllegalStateException("Name cannot be blank");
+ }
+ }
+
+ /**
+ * Type cannot be null
+ */
+ public static void invariantTypeNotNull(Course entity) {
+ if (entity.getType() == null) {
+ throw new IllegalStateException("Type cannot be null");
+ }
+ }
+
+ /**
+ * CreationDate cannot be null
+ */
+ public static void invariantCreationDateNotNull(Course entity) {
+ if (entity.getCreationDate() == null) {
+ throw new IllegalStateException("CreationDate cannot be null");
+ }
+ }
+
+ /**
+ * Course aggregate must be in a valid state
+ */
+ public static void invariantCourseValid(Course entity) {
+ // Aggregate-level validation logic
+ // Validate business rules that span multiple properties
+ // Example: startDate must be before endDate
+ // Note: Aggregate-specific invariants should be defined in DSL invariants block
+ }
+
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseValidationAnnotations.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseValidationAnnotations.java
new file mode 100644
index 000000000..5f132d351
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/CourseValidationAnnotations.java
@@ -0,0 +1,50 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import java.time.LocalDateTime;
+import pt.ulisboa.tecnico.socialsoftware.answers.shared.enums.CourseType;
+
+public class CourseValidationAnnotations {
+
+ public static class NameValidation {
+ @NotNull
+ @NotBlank
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+ }
+
+ public static class TypeValidation {
+ @NotNull
+ private CourseType type;
+
+ public CourseType getType() {
+ return type;
+ }
+
+ public void setType(CourseType type) {
+ this.type = type;
+ }
+ }
+
+ public static class CreationDateValidation {
+ @NotNull
+ private LocalDateTime creationDate;
+
+ public LocalDateTime getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(LocalDateTime creationDate) {
+ this.creationDate = creationDate;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionBusinessRuleValidator.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionBusinessRuleValidator.java
new file mode 100644
index 000000000..b47f617a0
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionBusinessRuleValidator.java
@@ -0,0 +1,23 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
+
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.execution.aggregate.Execution;
+
+public class ExecutionBusinessRuleValidator implements ConstraintValidator {
+
+ @Override
+ public void initialize(ValidExecutionBusinessRule constraintAnnotation) {
+ }
+
+ @Override
+ public boolean isValid(Execution value, ConstraintValidatorContext context) {
+ if (value == null) {
+ return true; // Let @NotNull handle null validation
+ }
+
+ // Implement business rule validation logic for Execution
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionInvariants.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionInvariants.java
new file mode 100644
index 000000000..06da36c9e
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionInvariants.java
@@ -0,0 +1,92 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.execution.aggregate.Execution;
+
+/**
+ * Invariant validation methods for Execution
+ */
+public class ExecutionInvariants {
+
+ /**
+ * Acronym cannot be null
+ */
+ public static void invariantAcronymNotNull(Execution entity) {
+ if (entity.getAcronym() == null) {
+ throw new IllegalStateException("Acronym cannot be null");
+ }
+ }
+
+ /**
+ * Acronym cannot be blank
+ */
+ public static void invariantAcronymNotBlank(Execution entity) {
+ if (entity.getAcronym() == null || entity.getAcronym().trim().isEmpty()) {
+ throw new IllegalStateException("Acronym cannot be blank");
+ }
+ }
+
+ /**
+ * AcademicTerm cannot be null
+ */
+ public static void invariantAcademicTermNotNull(Execution entity) {
+ if (entity.getAcademicTerm() == null) {
+ throw new IllegalStateException("AcademicTerm cannot be null");
+ }
+ }
+
+ /**
+ * AcademicTerm cannot be blank
+ */
+ public static void invariantAcademicTermNotBlank(Execution entity) {
+ if (entity.getAcademicTerm() == null || entity.getAcademicTerm().trim().isEmpty()) {
+ throw new IllegalStateException("AcademicTerm cannot be blank");
+ }
+ }
+
+ /**
+ * EndDate cannot be null
+ */
+ public static void invariantEndDateNotNull(Execution entity) {
+ if (entity.getEndDate() == null) {
+ throw new IllegalStateException("EndDate cannot be null");
+ }
+ }
+
+ /**
+ * Course cannot be null
+ */
+ public static void invariantCourseNotNull(Execution entity) {
+ if (entity.getCourse() == null) {
+ throw new IllegalStateException("Course cannot be null");
+ }
+ }
+
+ /**
+ * Users cannot be null
+ */
+ public static void invariantUsersNotNull(Execution entity) {
+ if (entity.getUsers() == null) {
+ throw new IllegalStateException("Users cannot be null");
+ }
+ }
+
+ /**
+ * Users cannot be empty
+ */
+ public static void invariantUsersNotEmpty(Execution entity) {
+ if (entity.getUsers() == null || ((java.util.Collection) entity.getUsers()).isEmpty()) {
+ throw new IllegalStateException("Users cannot be empty");
+ }
+ }
+
+ /**
+ * Execution aggregate must be in a valid state
+ */
+ public static void invariantExecutionValid(Execution entity) {
+ // Aggregate-level validation logic
+ // Validate business rules that span multiple properties
+ // Example: startDate must be before endDate
+ // Note: Aggregate-specific invariants should be defined in DSL invariants block
+ }
+
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionValidationAnnotations.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionValidationAnnotations.java
new file mode 100644
index 000000000..f5843c7f8
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/ExecutionValidationAnnotations.java
@@ -0,0 +1,80 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import java.time.LocalDateTime;
+import java.util.Set;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.execution.aggregate.ExecutionCourse;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.execution.aggregate.ExecutionUser;
+
+public class ExecutionValidationAnnotations {
+
+ public static class AcronymValidation {
+ @NotNull
+ @NotBlank
+ private String acronym;
+
+ public String getAcronym() {
+ return acronym;
+ }
+
+ public void setAcronym(String acronym) {
+ this.acronym = acronym;
+ }
+ }
+
+ public static class AcademicTermValidation {
+ @NotNull
+ @NotBlank
+ private String academicTerm;
+
+ public String getAcademicTerm() {
+ return academicTerm;
+ }
+
+ public void setAcademicTerm(String academicTerm) {
+ this.academicTerm = academicTerm;
+ }
+ }
+
+ public static class EndDateValidation {
+ @NotNull
+ private LocalDateTime endDate;
+
+ public LocalDateTime getEndDate() {
+ return endDate;
+ }
+
+ public void setEndDate(LocalDateTime endDate) {
+ this.endDate = endDate;
+ }
+ }
+
+ public static class CourseValidation {
+ @NotNull
+ private ExecutionCourse course;
+
+ public ExecutionCourse getCourse() {
+ return course;
+ }
+
+ public void setCourse(ExecutionCourse course) {
+ this.course = course;
+ }
+ }
+
+ public static class UsersValidation {
+ @NotNull
+ @NotEmpty
+ private Set users;
+
+ public Set getUsers() {
+ return users;
+ }
+
+ public void setUsers(Set users) {
+ this.users = users;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionBusinessRuleValidator.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionBusinessRuleValidator.java
new file mode 100644
index 000000000..2e1e612d0
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionBusinessRuleValidator.java
@@ -0,0 +1,23 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
+
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.question.aggregate.Question;
+
+public class QuestionBusinessRuleValidator implements ConstraintValidator {
+
+ @Override
+ public void initialize(ValidQuestionBusinessRule constraintAnnotation) {
+ }
+
+ @Override
+ public boolean isValid(Question value, ConstraintValidatorContext context) {
+ if (value == null) {
+ return true; // Let @NotNull handle null validation
+ }
+
+ // Implement business rule validation logic for Question
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionInvariants.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionInvariants.java
new file mode 100644
index 000000000..472006fdd
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionInvariants.java
@@ -0,0 +1,110 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.question.aggregate.Question;
+
+/**
+ * Invariant validation methods for Question
+ */
+public class QuestionInvariants {
+
+ /**
+ * Title cannot be null
+ */
+ public static void invariantTitleNotNull(Question entity) {
+ if (entity.getTitle() == null) {
+ throw new IllegalStateException("Title cannot be null");
+ }
+ }
+
+ /**
+ * Title cannot be blank
+ */
+ public static void invariantTitleNotBlank(Question entity) {
+ if (entity.getTitle() == null || entity.getTitle().trim().isEmpty()) {
+ throw new IllegalStateException("Title cannot be blank");
+ }
+ }
+
+ /**
+ * Content cannot be null
+ */
+ public static void invariantContentNotNull(Question entity) {
+ if (entity.getContent() == null) {
+ throw new IllegalStateException("Content cannot be null");
+ }
+ }
+
+ /**
+ * Content cannot be blank
+ */
+ public static void invariantContentNotBlank(Question entity) {
+ if (entity.getContent() == null || entity.getContent().trim().isEmpty()) {
+ throw new IllegalStateException("Content cannot be blank");
+ }
+ }
+
+ /**
+ * CreationDate cannot be null
+ */
+ public static void invariantCreationDateNotNull(Question entity) {
+ if (entity.getCreationDate() == null) {
+ throw new IllegalStateException("CreationDate cannot be null");
+ }
+ }
+
+ /**
+ * Course cannot be null
+ */
+ public static void invariantCourseNotNull(Question entity) {
+ if (entity.getCourse() == null) {
+ throw new IllegalStateException("Course cannot be null");
+ }
+ }
+
+ /**
+ * Topics cannot be null
+ */
+ public static void invariantTopicsNotNull(Question entity) {
+ if (entity.getTopics() == null) {
+ throw new IllegalStateException("Topics cannot be null");
+ }
+ }
+
+ /**
+ * Topics cannot be empty
+ */
+ public static void invariantTopicsNotEmpty(Question entity) {
+ if (entity.getTopics() == null || ((java.util.Collection) entity.getTopics()).isEmpty()) {
+ throw new IllegalStateException("Topics cannot be empty");
+ }
+ }
+
+ /**
+ * Options cannot be null
+ */
+ public static void invariantOptionsNotNull(Question entity) {
+ if (entity.getOptions() == null) {
+ throw new IllegalStateException("Options cannot be null");
+ }
+ }
+
+ /**
+ * Options cannot be empty
+ */
+ public static void invariantOptionsNotEmpty(Question entity) {
+ if (entity.getOptions() == null || ((java.util.Collection) entity.getOptions()).isEmpty()) {
+ throw new IllegalStateException("Options cannot be empty");
+ }
+ }
+
+ /**
+ * Question aggregate must be in a valid state
+ */
+ public static void invariantQuestionValid(Question entity) {
+ // Aggregate-level validation logic
+ // Validate business rules that span multiple properties
+ // Example: startDate must be before endDate
+ // Note: Aggregate-specific invariants should be defined in DSL invariants block
+ }
+
+}
\ No newline at end of file
diff --git a/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionValidationAnnotations.java b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionValidationAnnotations.java
new file mode 100644
index 000000000..70d2f0bb8
--- /dev/null
+++ b/applications/answers/src/main/java/pt/ulisboa/tecnico/socialsoftware/answers/coordination/validation/QuestionValidationAnnotations.java
@@ -0,0 +1,96 @@
+package pt.ulisboa.tecnico.socialsoftware.answers.coordination.validation;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Set;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.question.aggregate.Option;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.question.aggregate.QuestionCourse;
+import pt.ulisboa.tecnico.socialsoftware.answers.microservices.question.aggregate.QuestionTopic;
+
+public class QuestionValidationAnnotations {
+
+ public static class TitleValidation {
+ @NotNull
+ @NotBlank
+ private String title;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ }
+
+ public static class ContentValidation {
+ @NotNull
+ @NotBlank
+ private String content;
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+ }
+
+ public static class CreationDateValidation {
+ @NotNull
+ private LocalDateTime creationDate;
+
+ public LocalDateTime getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(LocalDateTime creationDate) {
+ this.creationDate = creationDate;
+ }
+ }
+
+ public static class CourseValidation {
+ @NotNull
+ private QuestionCourse course;
+
+ public QuestionCourse getCourse() {
+ return course;
+ }
+
+ public void setCourse(QuestionCourse course) {
+ this.course = course;
+ }
+ }
+
+ public static class TopicsValidation {
+ @NotNull
+ @NotEmpty
+ private Set topics;
+
+ public Set getTopics() {
+ return topics;
+ }
+
+ public void setTopics(Set topics) {
+ this.topics = topics;
+ }
+ }
+
+ public static class OptionsValidation {
+ @NotNull
+ @NotEmpty
+ private List