First version
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
namespace cfs_tracker.Models
|
||||
{
|
||||
public class CalendarDaySummary
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public double? Average { get; set; } // null = kein Eintrag
|
||||
public int EntryCount { get; set; }
|
||||
|
||||
public HealthState? DisplayState { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace cfs_tracker.Models
|
||||
{
|
||||
public class DayDetailSummary
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public int GreenCount { get; set; }
|
||||
public int YellowCount { get; set; }
|
||||
public int RedCount { get; set; }
|
||||
public int GrayCount { get; set; }
|
||||
|
||||
public List<HealthEntry> Entries { get; set; } = new();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace cfs_tracker.Models;
|
||||
|
||||
public enum DayPart
|
||||
{
|
||||
Morning = 0,
|
||||
Afternoon = 1
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace cfs_tracker.Models
|
||||
{
|
||||
public enum EntrySource
|
||||
{
|
||||
App = 0,
|
||||
Notification = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using cfs_tracker.Models;
|
||||
using SQLite;
|
||||
|
||||
public class HealthEntry
|
||||
{
|
||||
[PrimaryKey, AutoIncrement]
|
||||
public int Id { get; set; }
|
||||
|
||||
public DateTime Timestamp { get; set; }
|
||||
|
||||
public HealthState State { get; set; }
|
||||
|
||||
public EntrySource Source { get; set; }
|
||||
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace cfs_tracker.Models
|
||||
{
|
||||
public enum HealthState
|
||||
{
|
||||
Gray = 0, // Totalausfall
|
||||
Red = 1, // schlecht
|
||||
Yellow = 2, // so lala
|
||||
Green = 3 // gut
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace cfs_tracker.Models;
|
||||
|
||||
public static class HealthStateExtensions
|
||||
{
|
||||
public static Color ToColor(this HealthState state)
|
||||
{
|
||||
return state switch
|
||||
{
|
||||
HealthState.Green => Color.FromArgb("#4CAF50"),
|
||||
HealthState.Yellow => Color.FromArgb("#FBC02D"),
|
||||
HealthState.Red => Color.FromArgb("#E53935"),
|
||||
HealthState.Gray => Color.FromArgb("#757575"),
|
||||
_ => Colors.Transparent
|
||||
};
|
||||
}
|
||||
|
||||
public static string ToLabel(this HealthState state)
|
||||
{
|
||||
return state switch
|
||||
{
|
||||
HealthState.Green => "Gut",
|
||||
HealthState.Yellow => "So lala",
|
||||
HealthState.Red => "Schlecht",
|
||||
HealthState.Gray => "Totalausfall",
|
||||
_ => ""
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace cfs_tracker.Models
|
||||
{
|
||||
public class WeekDaySummary
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public double? MorningAverage { get; set; } // vor 12 Uhr
|
||||
public double? AfternoonAverage { get; set; } // ab 12 Uhr
|
||||
|
||||
public int MorningCount { get; set; }
|
||||
public int AfternoonCount { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user