Skip to content

Commit

Permalink
Merge branch 'main' into Use_case_test
Browse files Browse the repository at this point in the history
  • Loading branch information
wennapengooin authored Aug 10, 2023
2 parents 4ca7544 + 230e7f5 commit d94d626
Show file tree
Hide file tree
Showing 100 changed files with 5,375 additions and 2,701 deletions.
29 changes: 15 additions & 14 deletions src/main/java/a_enterprise_business_rules/entities/Column.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,8 @@ public String toString() {
return columnStringRepresentation;
}

// TODO:turn this into its own class
// private UUID getValidColumnID(){
// this.ID = UUID.randomUUID();
// DBManagerInsertController dbManagerInsertController = new
// DBManagerInsertController();
// while(uuidMap.containsKey(this.ID.toString())){
// this.ID = UUID.randomUUID();
// }
// dbManagerInsertController.DBInsert(this.ID);
// return this.ID;
// }



/**
* Returns whether this Column and another object are equal.
Expand All @@ -258,11 +249,11 @@ public boolean equals(Object o) {
}

/**
* Searches an List of columns and returns one that has the same ID as the given
* Searches a List of columns and returns one that has the same ID as the given
* ID. Otherwise, returns null.
*
* @param columnID
* @param listOfColumns
* @param columnID UUID ID of column searched.
* @param listOfColumns List of column entities to do the search in.
*/
public static Column IDToColumn(UUID columnID, List<Column> listOfColumns) {
int i = 0;
Expand All @@ -287,5 +278,15 @@ public static Column IDToColumn(UUID columnID, List<Column> listOfColumns) {
// Column found = Column.IDToColumn(id2, listOfColumns);
// System.out.println(c2.equals(found));
// }
// private UUID getValidColumnID(){
// this.ID = UUID.randomUUID();
// DBManagerInsertController dbManagerInsertController = new
// DBManagerInsertController();
// while(uuidMap.containsKey(this.ID.toString())){
// this.ID = UUID.randomUUID();
// }
// dbManagerInsertController.DBInsert(this.ID);
// return this.ID;
// }

}
7 changes: 4 additions & 3 deletions src/main/java/a_enterprise_business_rules/entities/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ public boolean equals(Object o) {
}

/**
*
* @param taskID
* @param listOfTasks
* Searches a List of tasks and returns one that has the same ID as the given
* * ID. Otherwise, returns null.
* @param taskID UUID ID of task searched.
* @param listOfTasks List of task entities to do the search in.
* @return
*/
public static Task IDToTask(UUID taskID, ArrayList<Task> listOfTasks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class AdapterConvertString {
* @return
*/
public static List<String> toStringIDsList(String inputString){
// Split the inputString using delimiter ", "
String[] stringArray = inputString.split(", ");
// Split the inputString using delimiter ","
String[] stringArray = inputString.split(",");

// Convert array to a list using
List<String> stringList = Arrays.asList(stringArray);
Expand All @@ -27,7 +27,7 @@ public static List<String> toStringIDsList(String inputString){
*/
public static List<UUID> toIDsList(String inputString){
// Split the inputString using delimiter ", "
String[] stringArray = inputString.split(", ");
String[] stringArray = inputString.split(",");
List<UUID> idList = new ArrayList<>();
for (String s : stringArray){
idList.add(UUID.fromString(s));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import b_application_business_rules.entity_models.ProjectModel;

import java.io.IOException;

public interface ProjectSelectionOutputBoundary {

void displayCurrentProject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
//
//this boundary will be responsable for telling the outer classes what to do and what to show

import a_enterprise_business_rules.entities.Column;
import a_enterprise_business_rules.entities.Project;
import a_enterprise_business_rules.entities.Task;
import b_application_business_rules.entity_models.ColumnModel;
import b_application_business_rules.entity_models.TaskModel;
import c_interface_adapters.view_models.ProjectViewModel;
import c_interface_adapters.view_models.ColumnViewModel;
import c_interface_adapters.view_models.TaskViewModel;


Expand All @@ -27,20 +22,14 @@ public interface ProjectViewingAndModificationOutputBoundary {

void displayNewTask(UUID columnBoxID, TaskViewModel newTask);

void displayRenamedTask(UUID taskID, TaskViewModel task);

void displayRemovedTask(UUID taskID, TaskViewModel task);

void displayRenamedColumn(ColumnModel columnModel);

void displayDeletedColumn(ColumnModel columnModel);

//void displayRenamedColumn(ColumnModel column);

void displayChangedTaskDetails(UUID taskID, TaskViewModel task, HBox hbox);
void displayChangedTaskDetails(UUID taskID, TaskViewModel task, UUID columnID);

void dislayChangedTaskDate(UUID taskID, TaskViewModel task);
void displayRenamedProject(ProjectViewModel project, UUID projectId);
void displayDeleteProject(ProjectViewModel project, UUID projectId);

void displayNewColumn(ColumnModel c);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ public interface IDBInsert {

void DBInsert(UUID uuid);

void DBInsert(TaskModel taskModel, UUID parent);
void DBInsert(TaskModel taskModel);
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package b_application_business_rules.use_cases.project_selection_use_cases;

import b_application_business_rules.entity_models.ProjectModel;
import b_application_business_rules.use_cases.interfaces.ProjectRepository;
import b_application_business_rules.use_cases.project_selection_gateways.IDBRemove;
import d_frameworks_and_drivers.database_management.DBControllers.DBManagerRemoveController;

import java.util.UUID;

import a_enterprise_business_rules.entities.Project;

public class DeleteProject implements DeleteProjectUseCase {
private ProjectRepository projectRepository;
public class DeleteProject {
/**
* Empty constructor (would be autogenerated by Java if not included anyways)
*/
public DeleteProject() {
this.projectRepository = projectRepository;

}

/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void setDescription(String newDescription) {
IDBRemove databaseRemover = new DBManagerRemoveController();
databaseRemover.DBRemove(this.currentProjectModel, this.currentProjectModel.getID());

this.currentProjectModel.setName(newDescription);
this.currentProjectModel.setDescription(newDescription);

IDBInsert databaseInserter = new DBManagerInsertController();
databaseInserter.DBInsert(this.currentProjectModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ public void createProject(ProjectModel projectModel) {
@Override
public void openProject(UUID currentProjectID) {
IDbIdToModel iDbIdToModel = new DbIDToModel();
// TODO: Pass the ProjectModel of the Project with the given UUID to the
// presenter.
// TODO: i.e. presenter.displayCurrentProjct(projectModel);

// Temporary implementation for testing purposes.
List<TaskModel> TaskList = Arrays.asList(
new TaskModel("Task1", UUID.randomUUID(), "Task1", true,
LocalDateTime.now()),
new TaskModel("Task2", UUID.randomUUID(), "Task2", true,
LocalDateTime.now()));
List<ColumnModel> ColumnsList = Arrays.asList(
new ColumnModel("COLUMN 1", TaskList, UUID.randomUUID()),
new ColumnModel("COLUMN 2", new ArrayList<>(), UUID.randomUUID()));
ProjectModel projectModel = new ProjectModel(
"Project P1", UUID.randomUUID(), "", ColumnsList);
// // TODO: Pass the ProjectModel of the Project with the given UUID to the
// // presenter.
// // TODO: i.e. presenter.displayCurrentProjct(projectModel);
//
// // Temporary implementation for testing purposes.
// List<TaskModel> TaskList = Arrays.asList(
// new TaskModel("Task1", UUID.randomUUID(), "Task1", true,
// LocalDateTime.now()),
// new TaskModel("Task2", UUID.randomUUID(), "Task2", true,
// LocalDateTime.now()));
// List<ColumnModel> ColumnsList = Arrays.asList(
// new ColumnModel("COLUMN 1", TaskList, UUID.randomUUID()),
// new ColumnModel("COLUMN 2", new ArrayList<>(), UUID.randomUUID()));
// ProjectModel projectModel = new ProjectModel(
// "Project P1", UUID.randomUUID(), "", ColumnsList);
ProjectModel ProjectFromDB = iDbIdToModel.IdToProjectModel(currentProjectID.toString());
setCurrentProject(ProjectFromDB);
presenter.displayCurrentProject(ProjectFromDB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void addTask(UUID idOfColumn, TaskModel taskModel) {
// Initializing the required controllers and calls method that adds task to the
// database
IDBInsert insertTask = new DBManagerInsertController();
insertTask.DBInsert(taskModel, idOfColumn);
insertTask.DBInsert(taskModel);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import d_frameworks_and_drivers.database_management.DBControllers.DBManagerSearchController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.UUID;

Expand Down Expand Up @@ -64,15 +65,17 @@ public void updateTaskDetail(UUID taskID, TaskModel updatedTask, UUID parentColu
String oldTaskName = oldTaskInfo.get(1);
String oldTaskDescription = oldTaskInfo.get(2);
boolean oldTaskStatus = Boolean.parseBoolean(oldTaskInfo.get(3));
LocalDateTime oldTaskDate = LocalDateTime.parse(oldTaskInfo.get(4));
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime oldTaskDate = LocalDateTime.parse(oldTaskInfo.get(4), formatter);
// LocalDateTime oldTaskDate = LocalDateTime.parse(oldTaskInfo.get(4));
TaskModel oldTask = TaskModelFactory.create(oldTaskName, taskID,
oldTaskDescription, oldTaskStatus, oldTaskDate);

// Removing the old task
removeTask.DBRemove(oldTask, taskID);

// Inserting the new task
insertTask.DBInsert(updatedTask, parentColumn);
insertTask.DBInsert(updatedTask);

}

Expand Down
42 changes: 0 additions & 42 deletions src/main/java/c_interface_adapters/CSVColumnRepository.java

This file was deleted.

Loading

0 comments on commit d94d626

Please sign in to comment.