Adding priority
This commit is contained in:
@@ -80,6 +80,9 @@ public class TodosController : ApiController
|
||||
|
||||
[JsonPropertyName("created")]
|
||||
public long Created { get; init; } = 0;
|
||||
|
||||
[JsonPropertyName("priority")]
|
||||
public string? Priority { get; init; }
|
||||
|
||||
internal ReplaceTodoCommand To(string id) => new(
|
||||
id,
|
||||
@@ -87,6 +90,7 @@ public class TodosController : ApiController
|
||||
Project,
|
||||
Description,
|
||||
Status,
|
||||
Created);
|
||||
Created,
|
||||
Priority);
|
||||
}
|
||||
}
|
@@ -11,7 +11,8 @@ namespace Todo.Core.Application.Commands.Todo;
|
||||
public record CreateTodoCommand(
|
||||
[Required] string TodoTitle,
|
||||
string? TodoProject,
|
||||
string? TodoDescription) : IRequest<TodoViewModel>
|
||||
string? TodoDescription,
|
||||
string? Priority) : IRequest<TodoViewModel>
|
||||
{
|
||||
internal class Handler : IRequestHandler<CreateTodoCommand, TodoViewModel>
|
||||
{
|
||||
@@ -41,6 +42,7 @@ public record CreateTodoCommand(
|
||||
request.TodoTitle,
|
||||
request.TodoProject,
|
||||
request.TodoDescription,
|
||||
request.Priority
|
||||
userId,
|
||||
DateTimeOffset.UtcNow.ToUnixTimeMilliseconds());
|
||||
|
||||
|
@@ -12,7 +12,8 @@ public record ReplaceTodoCommand(
|
||||
string? Project,
|
||||
string? Description,
|
||||
bool Status,
|
||||
long Created) : IRequest<Unit>
|
||||
long Created,
|
||||
string? Priority) : IRequest<Unit>
|
||||
{
|
||||
internal class Handler : IRequestHandler<ReplaceTodoCommand, Unit>
|
||||
{
|
||||
@@ -51,5 +52,6 @@ public record ReplaceTodoCommand(
|
||||
Project,
|
||||
authorId,
|
||||
Description,
|
||||
Created);
|
||||
Created,
|
||||
Priority);
|
||||
}
|
@@ -7,4 +7,5 @@ public record Todo(
|
||||
string? Project,
|
||||
string AuthorId,
|
||||
string? Description,
|
||||
long Created);
|
||||
long Created,
|
||||
string? Priority);
|
@@ -8,6 +8,7 @@ public interface ITodoRepository
|
||||
string title,
|
||||
string? projectName,
|
||||
string? description,
|
||||
string? priority,
|
||||
string userId,
|
||||
long created);
|
||||
|
||||
|
@@ -20,6 +20,7 @@ public record MongoTodo
|
||||
public string? ProjectName { get; set; } = string.Empty;
|
||||
public string AuthorId { get; set; }
|
||||
public long Created { get; set; } = 0;
|
||||
public string? Priority { get; set; } = string.Empty;
|
||||
|
||||
public Core.Entities.Todo To() => new(
|
||||
Id,
|
||||
@@ -28,5 +29,6 @@ public record MongoTodo
|
||||
ProjectName,
|
||||
AuthorId,
|
||||
Description,
|
||||
Created);
|
||||
Created,
|
||||
Priority);
|
||||
}
|
Reference in New Issue
Block a user