Aanbod: RESTful routes zonder /admin, één OfferingDto en herordenen via PUT /offerings/order

Admin en bezoeker gebruiken dezelfde resource; alleen GET is anoniem, de rest vereist AdminOnly. OfferingAdminDto vervalt (displayOrder zit nu in OfferingDto), move-up/move-down zijn vervangen door de order-route die een onbekende of onvolledige lijst met 400 afwijst. De admin-frontend en alle tests zijn mee aangepast.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 13:06:08 +01:00
co-authored by Claude Sonnet 5.5
parent e6710781e5
commit bc763c8ef6
39 changed files with 968 additions and 395 deletions
@@ -105,53 +105,6 @@ public class OfferingRepositoryTests : IDisposable
result.Should().BeNull();
}
[Fact]
public async Task GetPreviousAsync_ReturnsClosestLowerDisplayOrder()
{
await _sut.AddAsync(Offering("First", displayOrder: 0));
await _sut.AddAsync(Offering("Second", displayOrder: 1));
await _sut.AddAsync(Offering("Third", displayOrder: 2));
await _sut.SaveChangesAsync();
var result = await _sut.GetPreviousAsync(2);
result!.Title.Should().Be("Second");
}
[Fact]
public async Task GetPreviousAsync_ReturnsNull_WhenFirst()
{
await _sut.AddAsync(Offering("First", displayOrder: 0));
await _sut.SaveChangesAsync();
var result = await _sut.GetPreviousAsync(0);
result.Should().BeNull();
}
[Fact]
public async Task GetNextAsync_ReturnsClosestHigherDisplayOrder()
{
await _sut.AddAsync(Offering("First", displayOrder: 0));
await _sut.AddAsync(Offering("Second", displayOrder: 1));
await _sut.SaveChangesAsync();
var result = await _sut.GetNextAsync(0);
result!.Title.Should().Be("Second");
}
[Fact]
public async Task GetNextAsync_ReturnsNull_WhenLast()
{
await _sut.AddAsync(Offering("Last", displayOrder: 0));
await _sut.SaveChangesAsync();
var result = await _sut.GetNextAsync(0);
result.Should().BeNull();
}
[Fact]
public async Task ExistsBySlugAsync_ReturnsTrue_WhenSlugTaken()
{