Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions CapstoneMaui.Core/CapstoneMaui.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor ">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<UseMaui>true</UseMaui>
<TargetFrameworks>net8.0;</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -23,4 +22,11 @@

</ItemGroup>

<ItemGroup>
<Folder Include="Services/Utilites/" />
</ItemGroup>

<ItemGroup>
</ItemGroup>

</Project>
80 changes: 0 additions & 80 deletions CapstoneMaui.Core/Components/Pages/Employee/EmployeeRequest.razor

This file was deleted.

6 changes: 0 additions & 6 deletions CapstoneMaui.Core/Components/Pages/Employee/Payroll.razor

This file was deleted.

34 changes: 0 additions & 34 deletions CapstoneMaui.Core/Components/Pages/Login.razor

This file was deleted.

36 changes: 0 additions & 36 deletions CapstoneMaui.Core/Components/Pages/Manager/ManagerBottomBar.razor

This file was deleted.

58 changes: 0 additions & 58 deletions CapstoneMaui.Core/Components/Pages/Manager/ManagerView.razor

This file was deleted.

21 changes: 21 additions & 0 deletions CapstoneMaui.Core/Dtos/AuthResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*

Success response object for all /auth endpoints
--------------------------------------------------------------------------------------
Defines what the API sends back to the client when authentication
succeeds either after registration, login, or refresh

*/

namespace CapstoneMaui.Core.Dtos
{
public class AuthResponse
{
public string AccessToken { get; set; } = null!; // short-lived JWT
public DateTimeOffset AccessTokenExpiresAt { get; set; } // client can preemptively refresh
public string RefreshToken { get; set; } = null!; // random string, used to get a new access token after expiration
public DateTimeOffset RefreshTokenExpiresAt { get; set; } // tells exactly when the token will expire
public string Email { get; set; } = null!; // lets the client show which user is logged in
public string? DisplayName { get; set; }
}
}
4 changes: 4 additions & 0 deletions CapstoneMaui.Core/Dtos/JobsiteDtos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace CapstoneMaui.Core.Dtos;

public record AssignmentDto(int employeeId, string fullName, string role);
public record ToDoDto(string fullName, string text, bool done);
17 changes: 17 additions & 0 deletions CapstoneMaui.Core/Dtos/LoginRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*


--------------------------------------------------------------------------------------
Defines the data format that the frontend must send to the backend
when a user tries to log in, used my /auth/login endpoint

*/

namespace CapstoneMaui.Core.Dtos
{
public class LoginRequest
{
public string Email { get; set; } = null!;
public string Password { get; set; } = null!;
}
}
4 changes: 4 additions & 0 deletions CapstoneMaui.Core/Dtos/PayrollDtos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace CapstoneMaui.Core.Dtos;

public record PayStubDto(string period, decimal gross, decimal net);
public record PayEstimeDto(string periodToDate, decimal estimatedGross);
17 changes: 17 additions & 0 deletions CapstoneMaui.Core/Dtos/RefreshRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*


--------------------------------------------------------------------------------------
Defines the input format that the client must send to the API when it
wants to refresh tokens. the short lived Jwt token expires and the app needs
a new one without reentering a pwd

*/

namespace CapstoneMaui.Core.Dtos
{
public class RefreshRequest
{
public string RefreshToken { get; set; } = null!;
}
}
18 changes: 18 additions & 0 deletions CapstoneMaui.Core/Dtos/RegisterRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*


--------------------------------------------------------------------------------------
Defines the data structure that the frontend sends to the backend when
a user wants to create an account, used by auth/register endpoint

*/

namespace CapstoneMaui.Core.Dtos
{
public class RegisterRequest
{
public string Email { get; set; } = null!; // login name (citext in db => case-insensitive)
public string Password { get; set; } = null!; // raw password
public string? DisplayName { get; set; } // optional friendly name for UI
}
}
18 changes: 18 additions & 0 deletions CapstoneMaui.Core/Dtos/RequestOffDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;

namespace CapstoneMaui.DTOs
{
public record RequestOffCreateDto(
[Required] DateOnly StartDate,
[Required] DateOnly EndDate,
[MaxLength(500)] string? Note
);

public record RequestOffDto(
long RequestOffId,
int UserId,
DateOnly StartDate,
DateOnly EndDate,
string? Note
);
}
27 changes: 27 additions & 0 deletions CapstoneMaui.Core/Dtos/TimeEntryDtos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*


--------------------------------------------------------------------------------------
Define the data structure/payload the frontend needs when an
employee clocks in or clocks out

*/

namespace CapstoneMaui.Core.Dtos
{
// for POST /time-entries/clock-in
public sealed class ClockInRequest
{
public int EmployeeId { get; set; }
public int? AssignmentId { get; set; } // optional
public DateTimeOffset? StartTime { get; set; } // optional (defaults to UtcNow)
}

// for POST /time-entries/clock-out
public sealed class ClockOutRequest
{
public long? TimeEntryId { get; set; } // optional: close by id
public int? EmployeeId { get; set; } // optional: close latest open by employee
public DateTimeOffset? EndTime { get; set; } // optional (defaults to UtcNow)
}
}
4 changes: 4 additions & 0 deletions CapstoneMaui.Core/Dtos/TimeOffDtos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace CapstoneMaui.Core.Dtos;

public record TimeOffRequestDto(DateOnly start, DateOnly end, string reason);
public record TimeOffItemDto(int id, DateOnly start, DateOnly end, string status); // pending / approved / denied
Loading