-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from cowienduckie/dev
feat: add interaction endpoints with Kanban board
- Loading branch information
Showing
45 changed files
with
2,751 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/Portal/Portal/Boundaries/GraphQL/Dtos/Projects/KanbanProjectDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Portal.Boundaries.GraphQL.Dtos.Sections; | ||
using Portal.Boundaries.GraphQL.Dtos.Tasks; | ||
using Portal.Domain; | ||
|
||
namespace Portal.Boundaries.GraphQL.Dtos.Projects; | ||
|
||
public class KanbanProjectDto | ||
{ | ||
public string Id { get; set; } = default!; | ||
public string Name { get; set; } = default!; | ||
public string? Notes { get; set; } | ||
public string Color { get; set; } = default!; | ||
public DateTime? DueDate { get; set; } | ||
public DateTime CreatedOn { get; set; } | ||
public DateTime? LastModifiedOn { get; set; } | ||
|
||
public IReadOnlyDictionary<string, object> Tasks { get; set; } = default!; | ||
public IReadOnlyDictionary<string, object> Columns { get; set; } = default!; | ||
|
||
public List<string> ColumnOrder { get; set; } = default!; | ||
} | ||
|
||
public static partial class DtoConverter | ||
{ | ||
public static KanbanProjectDto ToKanbanProjectDto(this Project project) | ||
{ | ||
var columnOrder = project.Sections | ||
.OrderBy(s => s.OrderIndex) | ||
.Select(s => s.Id.ToString()) | ||
.ToList(); | ||
|
||
var tasks = project.Tasks | ||
.Select(t => t.ToKanbanTaskDto()) | ||
.ToDictionary(t => t.Id, t => t as object); | ||
|
||
var columns = project.Sections | ||
.Select(s => s.ToKanbanSectionDto()) | ||
.ToDictionary(s => s.Id, t => t as object); | ||
|
||
return new KanbanProjectDto | ||
{ | ||
Id = project.Id.ToString(), | ||
Name = project.Name, | ||
Notes = project.Notes, | ||
Color = project.Color, | ||
DueDate = project.DueDate, | ||
CreatedOn = project.CreatedOn, | ||
LastModifiedOn = project.LastModifiedOn, | ||
|
||
Tasks = tasks, | ||
Columns = columns, | ||
|
||
ColumnOrder = columnOrder | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Portal/Portal/Boundaries/GraphQL/Dtos/Sections/KanbanSectionDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Portal.Domain; | ||
|
||
namespace Portal.Boundaries.GraphQL.Dtos.Sections; | ||
|
||
public class KanbanSectionDto | ||
{ | ||
public string Id { get; set; } = default!; | ||
public string Name { get; set; } = default!; | ||
public List<string> TaskIds { get; set; } = default!; | ||
} | ||
|
||
public static class DtoConverter | ||
{ | ||
public static KanbanSectionDto ToKanbanSectionDto(this Section section) | ||
{ | ||
var taskIds = section.Tasks.Select(t => t.Id.ToString()).ToList(); | ||
|
||
return new KanbanSectionDto | ||
{ | ||
Id = section.Id.ToString(), | ||
Name = section.Name, | ||
TaskIds = taskIds | ||
}; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/Portal/Portal/Boundaries/GraphQL/Dtos/Tasks/KanbanTaskDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Task = Portal.Domain.Task; | ||
|
||
namespace Portal.Boundaries.GraphQL.Dtos.Tasks; | ||
|
||
public class KanbanTaskDto | ||
{ | ||
public string Id { get; set; } = default!; | ||
public string Name { get; set; } = default!; | ||
public string? Notes { get; set; } | ||
|
||
public bool IsCompleted { get; set; } | ||
public DateTime? CompletedOn { get; set; } | ||
public string? CompletedBy { get; set; } | ||
|
||
public DateTime? StartOn { get; set; } | ||
public DateTime? DueOn { get; set; } | ||
|
||
public bool Liked { get; set; } | ||
public int LikesCount { get; set; } | ||
|
||
public string? Assignee { get; set; } | ||
|
||
public string Column { get; set; } = default!; | ||
} | ||
|
||
public static class DtoConverter | ||
{ | ||
public static KanbanTaskDto ToKanbanTaskDto(this Task task) | ||
{ | ||
return new KanbanTaskDto | ||
{ | ||
Id = task.Id.ToString(), | ||
Name = task.Name, | ||
Notes = task.Notes, | ||
IsCompleted = task.Completed, | ||
CompletedOn = task.CompletedOn, | ||
CompletedBy = task.CompletedBy.ToString(), | ||
StartOn = task.StartOn, | ||
DueOn = task.DueOn, | ||
Liked = task.Liked, | ||
LikesCount = task.LikesCount, | ||
Assignee = task.AssigneeId.ToString(), | ||
Column = task.SectionId.ToString() | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
src/Portal/Portal/Boundaries/GraphQL/InputTypes/CreateProjectInputType.cs
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
src/Portal/Portal/Boundaries/GraphQL/InputTypes/UpdateKanbanProjectInputType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using HotChocolate.Types; | ||
using Portal.UseCases.Mutations; | ||
|
||
namespace Portal.Boundaries.GraphQL.InputTypes; | ||
|
||
public class UpdateKanbanProjectInputType : InputObjectType<UpdateKanbanProjectCommand> | ||
{ | ||
protected override void Configure(IInputObjectTypeDescriptor<UpdateKanbanProjectCommand> descriptor) | ||
{ | ||
descriptor.Field(x => x.Tasks).Type<AnyType>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Portal/Portal/Boundaries/GraphQL/ObjectTypes/KanbanProjectType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using HotChocolate.Types; | ||
using Portal.Boundaries.GraphQL.Dtos.Projects; | ||
|
||
namespace Portal.Boundaries.GraphQL.ObjectTypes; | ||
|
||
public class KanbanProjectType : ObjectType<KanbanProjectDto> | ||
{ | ||
protected override void Configure(IObjectTypeDescriptor<KanbanProjectDto> descriptor) | ||
{ | ||
descriptor.Field(x => x.Tasks).Type<AnyType>(); | ||
descriptor.Field(x => x.Columns).Type<AnyType>(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Portal/Portal/Boundaries/GraphQL/ObjectTypes/KanbanSectionType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using HotChocolate.Types; | ||
using Portal.Boundaries.GraphQL.Dtos.Sections; | ||
|
||
namespace Portal.Boundaries.GraphQL.ObjectTypes; | ||
|
||
public class KanbanSectionType : ObjectType<KanbanSectionDto> | ||
{ | ||
protected override void Configure(IObjectTypeDescriptor<KanbanSectionDto> descriptor) | ||
{ | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Portal/Portal/Boundaries/GraphQL/ObjectTypes/KanbanTaskType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using HotChocolate.Types; | ||
using Portal.Boundaries.GraphQL.Dtos.Tasks; | ||
|
||
namespace Portal.Boundaries.GraphQL.ObjectTypes; | ||
|
||
public class KanbanTaskType : ObjectType<KanbanTaskDto> | ||
{ | ||
protected override void Configure(IObjectTypeDescriptor<KanbanTaskDto> descriptor) | ||
{ | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/Portal/Portal/Boundaries/GraphQL/ObjectTypes/SimplifiedProjectType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/Portal/Portal/Boundaries/GraphQL/ResponseTypes/CreateTaskResponseType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using HotChocolate.Types; | ||
using Portal.UseCases.Responses; | ||
|
||
namespace Portal.Boundaries.GraphQL.ResponseTypes; | ||
|
||
public class CreateTaskResponseType : ObjectType<CreateTaskResponse> | ||
{ | ||
protected override void Configure(IObjectTypeDescriptor<CreateTaskResponse> descriptor) | ||
{ | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Portal/Portal/Boundaries/GraphQL/ResponseTypes/UpdateKanbanProjectResponseType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using HotChocolate.Types; | ||
using Portal.UseCases.Responses; | ||
|
||
namespace Portal.Boundaries.GraphQL.ResponseTypes; | ||
|
||
public class UpdateKanbanProjectResponseType : ObjectType<UpdateKanbanProjectResponse> | ||
{ | ||
protected override void Configure(IObjectTypeDescriptor<UpdateKanbanProjectResponse> descriptor) | ||
{ | ||
} | ||
} |
Oops, something went wrong.