WASM Mode activated
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public double DailyTargetHours { get; set; } = 7.5;
|
||||
public int MinimumBreakMinutes { get; set; } = 30;
|
||||
public int VacationDaysPerYear { get; set; } = 30;
|
||||
public string? GermanState { get; set; }
|
||||
public DateOnly? FlexTimeStartDate { get; set; }
|
||||
public double FlexTimeStartingBalanceHours { get; set; } = 0.0;
|
||||
|
||||
// Arbeitstage
|
||||
public bool WorkMonday { get; set; } = true;
|
||||
public bool WorkTuesday { get; set; } = true;
|
||||
public bool WorkWednesday { get; set; } = true;
|
||||
public bool WorkThursday { get; set; } = true;
|
||||
public bool WorkFriday { get; set; } = true;
|
||||
public bool WorkSaturday { get; set; } = false;
|
||||
public bool WorkSunday { get; set; } = false;
|
||||
|
||||
public bool IsWorkDay(DayOfWeek day) => day switch
|
||||
{
|
||||
DayOfWeek.Monday => WorkMonday,
|
||||
DayOfWeek.Tuesday => WorkTuesday,
|
||||
DayOfWeek.Wednesday => WorkWednesday,
|
||||
DayOfWeek.Thursday => WorkThursday,
|
||||
DayOfWeek.Friday => WorkFriday,
|
||||
DayOfWeek.Saturday => WorkSaturday,
|
||||
DayOfWeek.Sunday => WorkSunday,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public class BreakEntry
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int WorkDayId { get; set; }
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public WorkDay WorkDay { get; set; } = null!;
|
||||
public TimeOnly? StartTime { get; set; }
|
||||
public TimeOnly? EndTime { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public interface IAuthService
|
||||
{
|
||||
Task<User?> LoginAsync(string username, string password);
|
||||
Task<List<User>> GetAllUsersAsync();
|
||||
Task DeleteUserAsync(int userId);
|
||||
Task<string?> RenameUserAsync(int userId, string newUsername);
|
||||
Task<(User? User, string? Error)> RegisterAsync(string username, string password);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public interface IHolidayService
|
||||
{
|
||||
Task<List<PublicHoliday>> GetHolidaysAsync(int year, string? stateCode = null);
|
||||
Task<(bool Success, string Message)> FetchAndStoreAsync(int year);
|
||||
Task DeleteAsync(int id);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public interface ITimetrackerService
|
||||
{
|
||||
Task<List<WorkDay>> GetWeekAsync(int userId, DateOnly monday);
|
||||
Task UpsertWorkDayAsync(WorkDay workDay);
|
||||
Task<AppSettings> GetSettingsAsync(int userId);
|
||||
Task SaveSettingsAsync(AppSettings settings);
|
||||
Task<List<VacationDay>> GetVacationDaysAsync(int userId, int year);
|
||||
Task AddVacationDayAsync(VacationDay vacationDay);
|
||||
Task RemoveVacationDayAsync(int userId, int id);
|
||||
Task<TimeSpan> GetTotalOvertimeAsync(int userId, AppSettings settings);
|
||||
Task<List<WorkDay>> GetMonthAsync(int userId, int year, int month);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public interface IUserNotificationService
|
||||
{
|
||||
event Func<Task>? OnUsersChanged;
|
||||
event Func<int, Task>? OnUserDeleted;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public class PublicHoliday
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateOnly Date { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public string? Counties { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public class User
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Username { get; set; } = "";
|
||||
public string PasswordHash { get; set; } = "";
|
||||
public string PasswordSalt { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public class UserInfo
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Username { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public class VacationDay
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public DateOnly Date { get; set; }
|
||||
public string? Note { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace timetracker.Shared;
|
||||
|
||||
public class WorkDay
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public DateOnly Date { get; set; }
|
||||
public TimeOnly? StartTime { get; set; }
|
||||
public TimeOnly? EndTime { get; set; }
|
||||
public List<BreakEntry> Breaks { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user