Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2a12058
readded table and tab views
meganchun Feb 15, 2025
1c355eb
simplified task model
meganchun Feb 18, 2025
3f72b41
task implementation
meganchun Feb 22, 2025
9bdc539
added enums
meganchun Feb 22, 2025
e0362b8
fixing mutations
meganchun Feb 22, 2025
499d744
database functionality
meganchun Feb 25, 2025
f59ea7b
connected backend to frontend
meganchun Mar 1, 2025
3bffea6
fixed table rendering, added a default endDate of Jan 1 2030
eric-mxrtin Mar 4, 2025
4327f63
fixing task modal
meganchun Mar 4, 2025
497ad95
merged table updates into modal updates
meganchun Mar 4, 2025
ff5fd26
adding recurrence and time selection to new schema model
meganchun Mar 11, 2025
b71192c
updated modal for new schema
meganchun Mar 11, 2025
2eab508
fixing modal restrictions
meganchun Mar 11, 2025
54875a5
task table cleanup
eric-mxrtin Mar 22, 2025
9cd773e
fixed table rendering
eric-mxrtin Mar 27, 2025
857ca0d
updated modal to create task
meganchun Mar 27, 2025
fadb191
merged changes
meganchun Mar 27, 2025
4c8acdc
fixed editing modal but need to resolve render bug and auto-populatin…
eric-mxrtin Mar 28, 2025
70d9d67
custom data mapping
meganchun Mar 28, 2025
1c9bb21
fixed refetch and updated table values
meganchun Mar 28, 2025
c7d6289
removed page
meganchun Mar 28, 2025
43ca37f
fixing consecutive day selection
meganchun Apr 1, 2025
e27a6df
added toast notification for CUD operations, fixed deletion modal bugs
eric-mxrtin Apr 3, 2025
078484c
csv download and delete button on table
meganchun Apr 5, 2025
fb4865c
fixed custom tasks and column headers
eric-mxrtin Apr 5, 2025
b5bbd35
fixed merge conflicts
eric-mxrtin Apr 5, 2025
5db1358
clean up
meganchun Apr 5, 2025
ee87518
merge
applepie7864 Apr 11, 2025
03b40f1
fix post merge
applepie7864 Apr 11, 2025
af9f207
fixes post merge
applepie7864 Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
**/*.cache
**/*.egg-info
**/prisma/migrations
**/.eslintcache
**/.eslintcache
.idea
4 changes: 3 additions & 1 deletion backend/graphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
import participantResolvers from "./resolvers/participantResolver";
import noteResolvers from "./resolvers/noteResolver";
import authResolver from "./resolvers/auth";
import taskResolvers from "./resolvers/taskResolver";

const schema = makeExecutableSchema({
typeDefs: [...scalarTypeDefs, dataModels, customTypes, resolverTypes],
resolvers: merge(
scalarResolvers,

Check failure on line 22 in backend/graphql/index.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
participantResolvers,

Check failure on line 23 in backend/graphql/index.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
noteResolvers,

Check failure on line 24 in backend/graphql/index.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
authResolver
authResolver,

Check failure on line 25 in backend/graphql/index.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
taskResolvers

Check failure on line 26 in backend/graphql/index.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `··taskResolvers` with `taskResolvers,`
),
});

Expand Down
232 changes: 129 additions & 103 deletions backend/graphql/resolvers/taskResolver.ts
Original file line number Diff line number Diff line change
@@ -1,106 +1,132 @@
// import { Status, TaskType } from "../../prisma";
// import TaskService from "../../services/implementations/taskService";
// import ITaskService, {
// TaskDTO,
// InputTaskDTO,
// InputTaskAssignedDTO,
// TaskAssignedDTO,
// } from "../../services/interfaces/taskService";
import {
DaysOfWeek,
RecurrenceFrequency,
Task,
TaskType,
TimeOption,
} from "@prisma/client";
import TaskService from "../../services/implementation/taskImplementation";
import ITaskService from "../../services/interface/taskInterface";

// const taskService: ITaskService = new TaskService();
const taskService: ITaskService = new TaskService();

// const taskResolvers = {
// Query: {
// getTaskById: async (
// _parent: undefined,
// { taskId }: { taskId: number },
// ): Promise<TaskDTO> => {
// const task = await taskService.getTaskById(taskId);
// return task;
// },
// getTasksByType: async (
// _parent: undefined,
// { type }: { type: TaskType },
// ): Promise<Array<TaskDTO>> => {
// const tasks = await taskService.getTasksByType(type);
// return tasks;
// },
// getTasksByAssigneeId: async (
// _parent: undefined,
// { assigneeId }: { assigneeId: number },
// ): Promise<TaskAssignedDTO[]> => {
// const tasks = await taskService.getTasksByAssigneeId(assigneeId);
// return tasks;
// },
// getTasksByAssignerId: async (
// _parent: undefined,
// { assignerId }: { assignerId: number },
// ): Promise<TaskAssignedDTO[]> => {
// const tasks = await taskService.getTasksByAssignerId(assignerId);
// return tasks;
// },
// getTasksByStartDate: async (
// _parent: undefined,
// { startDate }: { startDate: Date },
// ): Promise<TaskAssignedDTO[]> => {
// const tasks = await taskService.getTasksByStartDate(startDate);
// return tasks;
// },
// // getTasksByEndDate: async (
// // _parent: undefined,
// // { endDate }: { endDate: Date },
// // ): Promise<TaskAssignedDTO[]> => {
// // const tasks = await taskService.getTasksByEndDate(endDate);
// // return tasks;
// // },
// getTasksByStatus: async (
// _parent: undefined,
// { status }: { status: Status },
// ): Promise<TaskAssignedDTO[]> => {
// const tasks = await taskService.getTasksByStatus(status);
// return tasks;
// },
// },
// Mutation: {
// createTask: async (
// _parent: undefined,
// { task }: { task: InputTaskDTO },
// ): Promise<TaskDTO> => {
// const newTask = await taskService.createTask(task);
// return newTask;
// },
// updateTask: async (
// _parent: undefined,
// { taskId, task }: { taskId: number; task: InputTaskDTO },
// ): Promise<TaskDTO> => {
// const updatedTask = await taskService.updateTaskById(taskId, task);
// return updatedTask;
// },
// deleteTask: async (
// _parent: undefined,
// { taskId }: { taskId: number },
// ): Promise<TaskDTO> => {
// const deletedTask = await taskService.deleteTaskById(taskId);
// return deletedTask;
// },
// assignTask: async (
// _parent: undefined,
// { taskAssigned }: { taskAssigned: InputTaskAssignedDTO },
// ): Promise<TaskAssignedDTO> => {
// const newTask = await taskService.assignTask(taskAssigned);
// return newTask;
// },
// changeTaskStatus: async (
// _parent: undefined,
// { taskAssignedId, status }: { taskAssignedId: number; status: Status },
// ): Promise<TaskAssignedDTO> => {
// const updatedTask = await taskService.changeTaskStatus(
// taskAssignedId,
// status,
// );
// return updatedTask;
// },
// },
// };
const taskResolvers = {
Query: {
getTaskById: async (
_parent: undefined,
{ taskId }: { taskId: number },
): Promise<Task> => {
const task = await taskService.getTaskById(taskId);
return task;
},
getTasksByType: async (
_parent: undefined,
{ type }: { type: TaskType },
): Promise<Array<Task>> => {
const tasks = await taskService.getTasksByType(type);
return tasks;
},
getTasksByRecurrenceFrequency: async (
_parent: undefined,
{ recurrencePreference }: { recurrencePreference: RecurrenceFrequency },
): Promise<Task[]> => {
const tasks =

Check failure on line 33 in backend/graphql/resolvers/taskResolver.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `⏎········await·taskService.getTasksByRecurrenceFrequency(recurrencePreference` with `·await·taskService.getTasksByRecurrenceFrequency(⏎········recurrencePreference,⏎······`
await taskService.getTasksByRecurrenceFrequency(recurrencePreference);
return tasks;
},
},
Mutation: {
createTask: async (
_parent: undefined,
{
type,
name,
recurrencePreference,
repeatDays,
timePreference,
credit,
deduction,
start,
end,
comment,
}: {
type: TaskType;
name: string;
recurrencePreference: RecurrenceFrequency;
repeatDays: DaysOfWeek[];
timePreference: TimeOption;
credit: number;
deduction: number;
start: string;
end: string;
comment: string;
},
): Promise<Task> => {
const newTask = await taskService.createTask(
type,
name,
recurrencePreference,
repeatDays,
timePreference,
credit,
deduction,
start,
end,
comment,
);
return newTask;
},
updateTask: async (
_parent: undefined,
{
taskId,
type,
name,
recurrencePreference,
repeatDays,
timePreference,
credit,
deduction,
start,
end,
comment,
}: {
taskId: number;
type: TaskType;
name: string;
recurrencePreference: RecurrenceFrequency;
repeatDays: DaysOfWeek[];
timePreference: TimeOption;
credit: number;
deduction: number;
start: string;
end: string;
comment: string;
},
): Promise<Task> => {
const updatedTask = await taskService.updateTaskById(
taskId,
type,
name,
recurrencePreference,
repeatDays,
timePreference,
credit,
deduction,
start,
end,
comment,
);
return updatedTask;
},
deleteTask: async (
_parent: undefined,
{ taskId }: { taskId: number },
): Promise<Task> => {
const deletedTask = await taskService.deleteTaskById(taskId);
return deletedTask;
},
},
};

// export default taskResolvers;
export default taskResolvers;
23 changes: 23 additions & 0 deletions backend/graphql/types/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
enum TaskType {
REQUIRED
OPTIONAL
CUSTOM
}

enum TaskStatus {
Expand All @@ -19,6 +20,28 @@
COMPLETE
EXCUSED
}

enum DaysOfWeek {
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
}

enum RecurrenceFrequency {
DAILY
EVERY_SELECTED_DAYS
ANY_SELECTED_DAYS
}

enum TimeOption {
ANYTIME
SPECIFIC
}

Check failure on line 44 in backend/graphql/types/enums.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `⏎`
`;

export default customTypes;
21 changes: 11 additions & 10 deletions backend/graphql/types/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
}

type Task {
taskId: Int!
roomNumber: Int
type: TaskType!
status: TaskStatus!
name: String!
isRecurring: Boolean!
start: String!
end: String!
credit: Int!
comment: String
taskId: Int!

Check failure on line 22 in backend/graphql/types/models.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
type: TaskType!

Check failure on line 23 in backend/graphql/types/models.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
name: String!
recurrencePreference: RecurrenceFrequency!
repeatDays: [DaysOfWeek!]!
timePreference: TimeOption!
credit: Int!
deduction: Int!
start: String
end: String
comment: String
}

type Note {
Expand Down
Loading
Loading