fix(giving): map duplicate-date race to 409 + return zelle/paypal refs in session detail
This commit is contained in:
@@ -129,4 +129,27 @@ public class OfferingSessionServiceTests
|
||||
Assert.Equal(200m, after.SystemTotal);
|
||||
Assert.Equal(1, await db.Givings.CountAsync(g => g.OfferingSessionId == id));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetByIdAsync_ReturnsCheckZelleAndPayPalRefs()
|
||||
{
|
||||
using var db = BuildDb();
|
||||
var catId = await SeedCategoryAsync(db);
|
||||
var svc = new OfferingSessionService(db, BuildAccessor());
|
||||
var req = new CreateOfferingSessionRequest
|
||||
{
|
||||
SessionDate = new DateOnly(2026, 6, 7), CashTotal = 0m, CheckTotal = 100m,
|
||||
Givings = [ new() { GivingCategoryId = catId, Amount = 100m, PaymentMethod = "Zelle",
|
||||
ZelleReferenceCode = "Z-123", PayPalTransactionId = "PP-456", CheckNumber = "C-789" } ],
|
||||
};
|
||||
var id = await svc.CreateAsync(req);
|
||||
|
||||
var dto = await svc.GetByIdAsync(id);
|
||||
|
||||
Assert.NotNull(dto);
|
||||
var line = Assert.Single(dto!.Givings);
|
||||
Assert.Equal("Z-123", line.ZelleReferenceCode);
|
||||
Assert.Equal("PP-456", line.PayPalTransactionId);
|
||||
Assert.Equal("C-789", line.CheckNumber);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user