Replace stored-procedure repositories with Dapper-based repositories

Removes the USP_* stored procedures for Auth, Location, and Brewery
data access in favour of services built with Dapper.

Adds a new Features.Locations slice and optimistic concurrency support
for the Brewery slice.
This commit is contained in:
Aaron Po
2026-08-17 20:50:44 -04:00
parent e8499181cb
commit cac6d7f193
81 changed files with 1656 additions and 1401 deletions

View File

@@ -12,14 +12,12 @@ namespace Infrastructure.Jwt;
/// </summary>
public class JwtInfrastructure : ITokenInfrastructure
{
/// <summary>
/// Generates a signed JWT, signed using HMAC-SHA256 with the provided secret.
/// </summary>
/// <inheritdoc />
/// <remarks>
/// Sets registered claims <c>sub</c> (userId), <c>unique_name</c> (username), <c>iat</c> (current UTC time),
/// <c>exp</c> (expiry), and <c>jti</c> (a newly generated GUID).
/// </remarks>
/// <param name="secret">The symmetric secret used to sign the token (encoded as UTF-8 bytes).</param>
/// <param name="secret">The symmetric secret used to sign the token, encoded as UTF-8 bytes.</param>
public string GenerateJwt(Guid userId, string username, DateTime expiry, string secret)
{
JsonWebTokenHandler handler = new();
@@ -52,11 +50,9 @@ public class JwtInfrastructure : ITokenInfrastructure
return handler.CreateToken(tokenDescriptor);
}
/// <summary>
/// Validates a JWT's signature and lifetime (issuer and audience validation are disabled),
/// using the provided secret as the HMAC-SHA256 symmetric signing key.
/// </summary>
/// <param name="secret">The symmetric secret used to verify the token's signature (encoded as UTF-8 bytes).</param>
/// <inheritdoc />
/// <remarks>Issuer and audience validation are disabled; only the signature and lifetime are validated.</remarks>
/// <param name="secret">The symmetric secret used to verify the token's signature, encoded as UTF-8 bytes.</param>
/// <exception cref="UnauthorizedException">
/// Thrown when the token is invalid, has no claims identity, is expired, or otherwise fails validation.
/// </exception>