Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
e38fcd7
chore(deps): bump Microsoft.Extensions.Diagnostics.HealthChecks
dependabot[bot] Jan 15, 2025
bfecde0
Merge pull request #562 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
75a59b3
chore(deps): bump Microsoft.EntityFrameworkCore, Microsoft.Extensions…
dependabot[bot] Jan 15, 2025
8aacef6
Merge pull request #563 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
d888dab
chore(deps): bump Microsoft.AspNetCore.Authentication.MicrosoftAccount
dependabot[bot] Jan 15, 2025
32c616a
chore(deps): bump Microsoft.AspNetCore.Authorization
dependabot[bot] Jan 15, 2025
7140eca
Merge pull request #565 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
7746789
Merge pull request #566 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
9f905f1
chore(deps): bump Microsoft.Data.Sqlite.Core
dependabot[bot] Jan 15, 2025
5ca48c0
Merge pull request #570 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
79a7560
chore(deps): bump Microsoft.AspNetCore.Authentication.MicrosoftAccount
dependabot[bot] Jan 15, 2025
41fd6e5
Merge pull request #571 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
a67d961
chore(deps): bump Microsoft.Extensions.Diagnostics.HealthChecks
dependabot[bot] Jan 15, 2025
36936dd
chore(deps): bump Microsoft.AspNetCore.Authorization
dependabot[bot] Jan 15, 2025
92b2e06
Merge pull request #572 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
6478306
chore(deps): bump Microsoft.EntityFrameworkCore.InMemory
dependabot[bot] Jan 15, 2025
3f2bcda
Merge pull request #573 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
d451122
Merge pull request #574 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
fa85f39
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer
dependabot[bot] Jan 15, 2025
89caa23
Merge pull request #567 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 15, 2025
040b5f2
chore(deps): bump Microsoft.Data.Sqlite.Core and Microsoft.EntityFram…
dependabot[bot] Jan 16, 2025
ebf7727
Merge pull request #575 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 16, 2025
462f90f
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer and M…
dependabot[bot] Jan 20, 2025
a826f46
Merge pull request #576 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 20, 2025
b2d590a
chore(deps): bump coverlet.msbuild in /PathfinderHonorManager.Tests
dependabot[bot] Jan 20, 2025
b1c5313
Merge pull request #577 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 20, 2025
bec1b9a
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer and M…
dependabot[bot] Jan 20, 2025
521cbde
Merge pull request #578 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 20, 2025
fb511c9
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer and M…
dependabot[bot] Jan 22, 2025
468e3d5
Merge pull request #579 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 22, 2025
b58df2b
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer and M…
dependabot[bot] Jan 22, 2025
1e624ed
Merge pull request #580 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 22, 2025
eb55a2f
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer and M…
dependabot[bot] Jan 23, 2025
d707b6f
Merge pull request #581 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 23, 2025
b7d3320
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer and M…
dependabot[bot] Jan 23, 2025
9796b01
Merge pull request #582 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Jan 23, 2025
5519a1c
ci(deps): bump dependabot/fetch-metadata from 2.2.0 to 2.3.0
dependabot[bot] Jan 27, 2025
8e48d3e
Merge pull request #583 from PathfinderHonorManager/dependabot/github…
github-actions[bot] Jan 27, 2025
d5ac5bc
chore(deps): bump Microsoft.AspNetCore.Authorization
dependabot[bot] Feb 12, 2025
0494181
Merge pull request #584 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 12, 2025
ff38090
chore(deps): bump Microsoft.Extensions.DependencyInjection and Micros…
dependabot[bot] Feb 12, 2025
aaebb40
Merge pull request #585 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 12, 2025
2a499d5
chore(deps): bump Microsoft.AspNetCore.Authentication.MicrosoftAccount
dependabot[bot] Feb 12, 2025
b93eedf
Merge pull request #586 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 12, 2025
f8e2e09
chore(deps): bump Microsoft.Extensions.Diagnostics.HealthChecks
dependabot[bot] Feb 12, 2025
b027774
Merge pull request #587 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 12, 2025
a82a8ae
chore(deps): bump Microsoft.AspNetCore.Authentication.MicrosoftAccount
dependabot[bot] Feb 12, 2025
88cc70d
Merge pull request #589 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 12, 2025
a220b84
chore(deps): bump Microsoft.Extensions.DependencyInjection and Micros…
dependabot[bot] Feb 12, 2025
4ed7528
Merge pull request #590 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 12, 2025
b300af6
chore(deps): bump Microsoft.AspNetCore.Authorization
dependabot[bot] Feb 12, 2025
33c1b6f
Merge pull request #591 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 12, 2025
e237333
chore(deps): bump Microsoft.Extensions.Diagnostics.HealthChecks
dependabot[bot] Feb 12, 2025
4866117
Merge pull request #593 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 12, 2025
0647199
chore(deps): bump Microsoft.Extensions.DependencyInjection, Microsoft…
dependabot[bot] Feb 13, 2025
65c9217
Merge pull request #594 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 13, 2025
6830e49
chore(deps): bump Microsoft.Extensions.DependencyInjection, Microsoft…
dependabot[bot] Feb 13, 2025
a075aed
Merge pull request #595 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 13, 2025
5f564ba
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer
dependabot[bot] Feb 13, 2025
21db1b0
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer
dependabot[bot] Feb 13, 2025
20dd327
Merge pull request #588 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 13, 2025
c2ed37c
Merge pull request #592 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 13, 2025
e6bc8ee
chore(deps): bump Microsoft.EntityFrameworkCore, Microsoft.Extensions…
dependabot[bot] Feb 20, 2025
f863bc5
Merge pull request #596 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 20, 2025
5703327
chore(deps): bump Microsoft.EntityFrameworkCore.InMemory
dependabot[bot] Feb 20, 2025
efbc50c
Merge pull request #598 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 20, 2025
da6cf8d
chore(deps): bump Microsoft.EntityFrameworkCore, Microsoft.EntityFram…
dependabot[bot] Feb 20, 2025
9c2c32e
Merge pull request #599 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 20, 2025
348af1d
chore(deps): bump Microsoft.Data.Sqlite.Core
dependabot[bot] Feb 20, 2025
b366dff
Merge pull request #602 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 20, 2025
11ded04
chore(deps): bump Microsoft.Data.Sqlite.Core and Microsoft.EntityFram…
dependabot[bot] Feb 21, 2025
a67a5d6
Merge pull request #604 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 21, 2025
a4d582b
chore(deps): bump Microsoft.NET.Test.Sdk
dependabot[bot] Feb 21, 2025
eb6948f
Merge pull request #603 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 21, 2025
1bcd2b7
chore(deps): bump NUnit3TestAdapter in /PathfinderHonorManager.Tests
dependabot[bot] Feb 21, 2025
cb53f6d
chore(deps): bump Npgsql from 9.0.2 to 9.0.3 in /PathfinderHonorManager
dependabot[bot] Feb 25, 2025
c99e8eb
Merge pull request #605 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 25, 2025
e3ed38d
chore(deps): bump Npgsql in /PathfinderHonorManager.Tests
dependabot[bot] Feb 25, 2025
a5a03cc
Merge pull request #606 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 25, 2025
0555172
chore(deps): bump Microsoft.ApplicationInsights
dependabot[bot] Feb 25, 2025
cf6f591
Merge pull request #608 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 25, 2025
71d88f1
chore(deps): bump Swashbuckle.AspNetCore in /PathfinderHonorManager
dependabot[bot] Feb 26, 2025
59240e5
Merge pull request #609 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 26, 2025
7d78b50
chore(deps): bump Swashbuckle.AspNetCore
dependabot[bot] Feb 26, 2025
0ac6978
Merge pull request #610 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 26, 2025
8e1167c
Merge pull request #601 from PathfinderHonorManager/dependabot/nuget/…
brian-cummings Feb 26, 2025
c2290d2
chore(deps): bump Swashbuckle.AspNetCore in /PathfinderHonorManager
dependabot[bot] Feb 28, 2025
9b6b186
Merge pull request #611 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 28, 2025
d8ed345
chore(deps): bump Swashbuckle.AspNetCore
dependabot[bot] Feb 28, 2025
ac5e6dd
Merge pull request #612 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Feb 28, 2025
fb79f5c
chore(deps): bump Microsoft.EntityFrameworkCore, Microsoft.EntityFram…
dependabot[bot] Mar 12, 2025
5e194d4
Merge pull request #613 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 12, 2025
326f530
chore(deps): bump Microsoft.AspNetCore.Authentication.MicrosoftAccount
dependabot[bot] Mar 12, 2025
016b063
Merge pull request #614 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 12, 2025
5c731fa
chore(deps): bump Microsoft.AspNetCore.Authorization
dependabot[bot] Mar 12, 2025
4465f3b
Merge pull request #616 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 12, 2025
4839cb3
chore(deps): bump Microsoft.Extensions.Diagnostics.HealthChecks
dependabot[bot] Mar 12, 2025
77c3d29
Merge pull request #617 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 12, 2025
9c6b2ad
chore(deps): bump Microsoft.Data.Sqlite.Core and Microsoft.EntityFram…
dependabot[bot] Mar 12, 2025
8bb002e
Merge pull request #619 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 12, 2025
d56094f
chore(deps): bump Microsoft.AspNetCore.Authentication.JwtBearer
dependabot[bot] Mar 12, 2025
7eb799e
Merge pull request #615 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 12, 2025
3b3e14c
chore(deps): bump Microsoft.EntityFrameworkCore.InMemory
dependabot[bot] Mar 12, 2025
53faedc
Merge pull request #622 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 12, 2025
0b992b5
chore(deps): bump Microsoft.Extensions.Diagnostics.HealthChecks
dependabot[bot] Mar 12, 2025
02af1f6
Merge pull request #624 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 12, 2025
29d97e3
chore(deps): bump Swashbuckle.AspNetCore in /PathfinderHonorManager
dependabot[bot] Mar 18, 2025
f7eff98
Merge pull request #627 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 18, 2025
77e2115
chore(deps): bump Swashbuckle.AspNetCore
dependabot[bot] Mar 18, 2025
06c9f1d
Merge pull request #628 from PathfinderHonorManager/dependabot/nuget/…
github-actions[bot] Mar 18, 2025
901c93a
chore(deps): bump Swashbuckle.AspNetCore in /PathfinderHonorManager
dependabot[bot] Mar 31, 2025
d4317a0
Merge pull request #631 from PathfinderHonorManager/dependabot/nuget/…
brian-cummings Apr 2, 2025
43fac93
Added invariantculture to time converter
Apr 3, 2025
fd10abe
Made program static
Apr 3, 2025
fe291bc
Added more comprehensive logging
Apr 4, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.2.0
uses: dependabot/fetch-metadata@v2.3.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
Expand Down
12 changes: 6 additions & 6 deletions PathfinderHonorManager.Tests/PathfinderHonorManager.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.3">
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentValidation" Version="11.11.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
<PackageReference Include="FluentValidation.Validators.UnitTestExtension" Version="1.11.0.2" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 14 additions & 1 deletion PathfinderHonorManager/Controllers/ClubController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using Microsoft.AspNetCore.Mvc;
using PathfinderHonorManager.Model;
using PathfinderHonorManager.Service.Interfaces;
using Microsoft.Extensions.Logging;
using System.Linq;

namespace PathfinderHonorManager.Controllers
{
Expand All @@ -20,10 +22,12 @@ namespace PathfinderHonorManager.Controllers
public class ClubsController : ControllerBase
{
private readonly IClubService _clubService;
private readonly ILogger<ClubsController> _logger;

public ClubsController(IClubService clubService)
public ClubsController(IClubService clubService, ILogger<ClubsController> logger)
{
_clubService = clubService;
_logger = logger;
}

// GET Clubs
Expand All @@ -39,24 +43,30 @@ public async Task<ActionResult<IEnumerable<Club>>> GetClubs(CancellationToken to
{
if (clubcode == null)
{
_logger.LogInformation("Getting all clubs");
var clubs = await _clubService.GetAllAsync(token);

if (clubs == default)
{
_logger.LogWarning("No clubs found");
return NotFound();
}

_logger.LogInformation("Retrieved {Count} clubs", clubs.Count());
return Ok(clubs);
}
else
{
_logger.LogInformation("Getting club with code {ClubCode}", clubcode);
var club = await _clubService.GetByCodeAsync(clubcode.ToUpper(), token);

if (club == default)
{
_logger.LogWarning("Club with code {ClubCode} not found", clubcode);
return NotFound();
}

_logger.LogInformation("Retrieved club with code {ClubCode}", clubcode);
return Ok(club);
}
}
Expand All @@ -73,13 +83,16 @@ public async Task<ActionResult<IEnumerable<Club>>> GetClubs(CancellationToken to
[HttpGet("{id:guid}")]
public async Task<IActionResult> GetByIdAsync(Guid id, CancellationToken token)
{
_logger.LogInformation("Getting club with ID {ClubId}", id);
var club = await _clubService.GetByIdAsync(id, token);

if (club == default)
{
_logger.LogWarning("Club with ID {ClubId} not found", id);
return NotFound();
}

_logger.LogInformation("Retrieved club with ID {ClubId}", id);
return Ok(club);
}
}
Expand Down
43 changes: 37 additions & 6 deletions PathfinderHonorManager/Controllers/HonorsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using PathfinderHonorManager.Service.Interfaces;
using Incoming = PathfinderHonorManager.Dto.Incoming;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Logging;
using System.Linq;

namespace PathfinderHonorManager.Controllers
{
Expand All @@ -22,10 +24,12 @@ namespace PathfinderHonorManager.Controllers
public class HonorsController : CustomApiController
{
private readonly IHonorService _honorService;
private readonly ILogger<HonorsController> _logger;

public HonorsController(IHonorService honorService)
public HonorsController(IHonorService honorService, ILogger<HonorsController> logger)
{
_honorService = honorService;
_logger = logger;
}

// GET Honors
Expand All @@ -38,13 +42,16 @@ public HonorsController(IHonorService honorService)
[HttpGet]
public async Task<ActionResult<IEnumerable<Honor>>> GetHonors(CancellationToken token)
{
_logger.LogInformation("Getting all honors");
var honors = await this._honorService.GetAllAsync(token);

if (honors == default)
{
_logger.LogWarning("No honors found");
return NotFound();
}

_logger.LogInformation("Retrieved {Count} honors", honors.Count());
return Ok(honors);
}

Expand All @@ -60,13 +67,16 @@ public async Task<ActionResult<IEnumerable<Honor>>> GetHonors(CancellationToken
[HttpGet("{id:guid}")]
public async Task<IActionResult> GetByIdAsync(Guid id, CancellationToken token)
{
_logger.LogInformation("Getting honor with ID {HonorId}", id);
var honor = await this._honorService.GetByIdAsync(id, token);

if (honor == default)
{
_logger.LogWarning("Honor with ID {HonorId} not found", id);
return NotFound();
}

_logger.LogInformation("Retrieved honor with ID {HonorId}", id);
return Ok(new { id = honor.HonorID, honor });
}

Expand All @@ -83,21 +93,25 @@ public async Task<IActionResult> GetByIdAsync(Guid id, CancellationToken token)
[HttpPost]
public async Task<ActionResult<Honor>> Post([FromBody] Incoming.HonorDto newHonor, CancellationToken token)
{
_logger.LogInformation("Creating new honor");
try
{
var honor = await _honorService.AddAsync(newHonor, token);

_logger.LogInformation("Created honor with ID {HonorId}", honor.HonorID);
return CreatedAtRoute(
routeValues: GetByIdAsync(honor.HonorID, token),
honor);
}
catch (FluentValidation.ValidationException ex)
{
_logger.LogWarning(ex, "Validation failed while creating honor");
UpdateModelState(ex);
return ValidationProblem(ModelState);
}
catch (DbUpdateException ex)
{
_logger.LogError(ex, "Database error while creating honor");
return ValidationProblem(ex.Message);
}
}
Expand All @@ -116,20 +130,37 @@ public async Task<ActionResult<Honor>> Post([FromBody] Incoming.HonorDto newHono
[HttpPut("{id:guid}")]
public async Task<IActionResult> Put(Guid id, [FromBody] Incoming.HonorDto updatedHonor, CancellationToken token)
{
_logger.LogInformation("Updating honor with ID {HonorId}", id);
var honor = await _honorService.GetByIdAsync(id, token);

if (honor == default)
{
_logger.LogWarning("Honor with ID {HonorId} not found", id);
return NotFound();
}

await _honorService.UpdateAsync(id, updatedHonor, token);
try
{
await _honorService.UpdateAsync(id, updatedHonor, token);

honor = await _honorService.GetByIdAsync(id, token);
honor = await _honorService.GetByIdAsync(id, token);
_logger.LogInformation("Updated honor with ID {HonorId}", id);

return honor != default
? Ok(honor)
: NotFound();
return honor != default
? Ok(honor)
: NotFound();
}
catch (FluentValidation.ValidationException ex)
{
_logger.LogWarning(ex, "Validation failed while updating honor with ID {HonorId}", id);
UpdateModelState(ex);
return ValidationProblem(ModelState);
}
catch (DbUpdateException ex)
{
_logger.LogError(ex, "Database error while updating honor with ID {HonorId}", id);
return ValidationProblem(ex.Message);
}
}
}
}
Loading