Skip to content

Commit 0f86e50

Browse files
authored
Merge pull request #60 from Jackpieking/F15
fix(F15): Refactor f15 at some logic
2 parents 5b386c4 + 1f0f526 commit 0f86e50

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

Src/Core/F15/BusinessLogic/F15Service.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ CancellationToken ct
3939
Id = request.TodoTaskId,
4040
Content = taskDetail.Content,
4141
DueDate = taskDetail.DueDate,
42-
IsFinished = taskDetail.IsFinished,
42+
IsCompleted = taskDetail.IsCompleted,
4343
IsImportant = taskDetail.IsImportant,
4444
IsInMyDay = taskDetail.IsInMyDay,
4545
Note = taskDetail.Note,

Src/Core/F15/DataAccess/F15Repository.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,18 @@ public Task<bool> DoesTodoTaskExistAsync(long taskId, CancellationToken ct)
2424

2525
public async Task<F15TodoTaskModel> GetTaskDetailByIdAsync(long taskId, CancellationToken ct)
2626
{
27-
var foundTask = await _appContext
27+
return await _appContext
2828
.Set<TodoTaskEntity>()
29-
.AsNoTracking()
3029
.Where(entity => entity.Id == taskId)
31-
.Select(entity => new TodoTaskEntity
30+
.Select(entity => new F15TodoTaskModel
3231
{
3332
Content = entity.Content,
3433
DueDate = entity.DueDate,
3534
IsInMyDay = entity.IsInMyDay,
3635
IsImportant = entity.IsImportant,
3736
Note = entity.Note,
38-
IsFinished = entity.IsFinished,
37+
IsCompleted = entity.IsFinished,
3938
})
4039
.FirstOrDefaultAsync(ct);
41-
42-
return new()
43-
{
44-
Content = foundTask.Content,
45-
DueDate = foundTask.DueDate,
46-
IsInMyDay = foundTask.IsInMyDay,
47-
IsImportant = foundTask.IsImportant,
48-
Note = foundTask.Note,
49-
IsFinished = foundTask.IsFinished,
50-
};
5140
}
5241
}

Src/Core/F15/Mapper/F15HttpResponseMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private static void Init()
3535
Id = appResponse.Body.TodoTask.Id,
3636
Content = appResponse.Body.TodoTask.Content,
3737
DueDate = appResponse.Body.TodoTask.DueDate,
38-
IsFinished = appResponse.Body.TodoTask.IsFinished,
38+
IsCompleted = appResponse.Body.TodoTask.IsCompleted,
3939
IsImportant = appResponse.Body.TodoTask.IsImportant,
4040
IsInMyDay = appResponse.Body.TodoTask.IsInMyDay,
4141
Note = appResponse.Body.TodoTask.Note,

Src/Core/F15/Models/F15AppResponseModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed class TodoTaskModel
2828

2929
public string Note { get; set; }
3030

31-
public bool IsFinished { get; set; }
31+
public bool IsCompleted { get; set; }
3232
}
3333
}
3434
}

Src/Core/F15/Models/F15TodoTaskModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ public sealed class F15TodoTaskModel
1616

1717
public string Note { get; set; }
1818

19-
public bool IsFinished { get; set; }
19+
public bool IsCompleted { get; set; }
2020
}

Src/Core/F15/Presentation/F15Response.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public sealed class TodoTaskDto
3030

3131
public string Note { get; set; }
3232

33-
public bool IsFinished { get; set; }
33+
public bool IsCompleted { get; set; }
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)