Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Reformatted code and fixed usings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannes Kaspar-Müller committed Sep 1, 2022
1 parent 2747655 commit c6d5a20
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 29 deletions.
3 changes: 2 additions & 1 deletion Clockodo.NET/ClockodoService.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using System.Collections.Immutable;
using Clockodo.NET.DataContracts;
using Clockodo.NET.Filter;
using Newtonsoft.Json;

namespace Clockodo.NET;

public class ClockodoService : ITimeEntryService
{
private readonly JsonSerializerSettings _jsonSettings;
private readonly HttpClient _client;
private readonly JsonSerializerSettings _jsonSettings;

public ClockodoService(Credentials credentials)
{
Expand Down
4 changes: 3 additions & 1 deletion Clockodo.NET/DataContracts/RawTimeEntry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Clockodo.NET.DataContracts;
using Newtonsoft.Json;

namespace Clockodo.NET.DataContracts;

public class RawTimeEntry
{
Expand Down
21 changes: 8 additions & 13 deletions Clockodo.NET/DataContracts/TimeEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@ internal TimeEntry(RawTimeEntry rawTimeEntry)
ServicesName = rawTimeEntry.ServiceName;
}

public TimeEntry()
{

}

public DateTime Start { get; set; }
public DateTime End { get; set; }
public int Duration { get; set; }
public DateTime Start { get; }
public DateTime End { get; }
public int Duration { get; }

public string CustomerName { get; set; }
public string ProjectName { get; set; }
public string EmployeeName { get; set; }
public decimal Revenue { get; set; }
public string ServicesName { get; set; }
public string CustomerName { get; }
public string ProjectName { get; }
public string EmployeeName { get; }
public decimal Revenue { get; }
public string ServicesName { get; }
}
4 changes: 3 additions & 1 deletion Clockodo.NET/DataContracts/TimeEntryPaging.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Clockodo.NET.DataContracts
using Newtonsoft.Json;

namespace Clockodo.NET.DataContracts
{
internal class TimeEntryPaging
{
Expand Down
25 changes: 12 additions & 13 deletions Clockodo.NET/Filter/YearFilter.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using Clockodo.NET.DataContracts;

namespace Clockodo.NET.Filter
namespace Clockodo.NET.Filter;

public class YearFilter : IFilterTimeEntries
{
public class YearFilter : IFilterTimeEntries
{
private readonly string _year;
private readonly string _year;

public YearFilter(string year)
{
_year = year;
}
public YearFilter(string year)
{
_year = year;
}

public IEnumerable<TimeEntry> Filter(IEnumerable<TimeEntry> source)
{
return source.Where(entry => entry.Start.Year.ToString() == _year);
}
public IEnumerable<TimeEntry> Filter(IEnumerable<TimeEntry> source)
{
return source.Where(entry => entry.Start.Year.ToString() == _year);
}
}
}

0 comments on commit c6d5a20

Please sign in to comment.