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

@@ -21,6 +21,7 @@ public class UpdateBreweryHandlerTests
{
UpdateBreweryCommand command = new(
Guid.NewGuid(),
[0x01, 0x02],
Guid.NewGuid(),
"Renamed",
"New description",
@@ -31,7 +32,7 @@ public class UpdateBreweryHandlerTests
_repoMock
.Setup(r => r.UpdateAsync(It.IsAny<BreweryPost>()))
.Callback<BreweryPost>(b => persisted = b)
.Returns(Task.CompletedTask);
.ReturnsAsync(() => persisted!);
DateTime before = DateTime.UtcNow;
await _handler.Handle(command, CancellationToken.None);
@@ -42,6 +43,7 @@ public class UpdateBreweryHandlerTests
persisted.PostedById.Should().Be(command.PostedById);
persisted.BreweryName.Should().Be("Renamed");
persisted.Description.Should().Be("New description");
persisted.Timer.Should().Equal(command.Timer);
persisted.UpdatedAt.Should().NotBeNull();
persisted.UpdatedAt!.Value.Should().BeOnOrAfter(before).And.BeOnOrBefore(after);
}
@@ -51,6 +53,7 @@ public class UpdateBreweryHandlerTests
{
UpdateBreweryCommand command = new(
Guid.NewGuid(),
[0x01, 0x02],
Guid.NewGuid(),
"Name",
"Description",
@@ -61,7 +64,7 @@ public class UpdateBreweryHandlerTests
_repoMock
.Setup(r => r.UpdateAsync(It.IsAny<BreweryPost>()))
.Callback<BreweryPost>(b => persisted = b)
.Returns(Task.CompletedTask);
.ReturnsAsync(() => persisted!);
await _handler.Handle(command, CancellationToken.None);
@@ -81,6 +84,7 @@ public class UpdateBreweryHandlerTests
);
UpdateBreweryCommand command = new(
Guid.NewGuid(),
[0x01, 0x02],
Guid.NewGuid(),
"Name",
"Description",
@@ -91,7 +95,7 @@ public class UpdateBreweryHandlerTests
_repoMock
.Setup(r => r.UpdateAsync(It.IsAny<BreweryPost>()))
.Callback<BreweryPost>(b => persisted = b)
.Returns(Task.CompletedTask);
.ReturnsAsync(() => persisted!);
await _handler.Handle(command, CancellationToken.None);