Phase 1-4: Add soft delete, concurrency token, update EF config and controllers

- Add ISoftDeletable interface with IsDeleted/DeletedAt
- Implement on Budget, Income, Outgo, BudgetShare; add RowVersion (xmin) to Budget
- Configure EF global query filters and xmin concurrency token
- Replace Remove() with soft delete in all delete endpoints
- Wrap Budget.Update SaveChanges in DbUpdateConcurrencyException catch
This commit is contained in:
Spencer Twaddle
2026-05-02 17:14:28 -05:00
parent da6eb547ce
commit 2908397b1e
10 changed files with 45 additions and 9 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
namespace Budget.Core.Models;
public class Budget
public class Budget : ISoftDeletable
{
public Guid Id { get; set; }
public required string Name { get; set; }
@@ -8,6 +8,9 @@ public class Budget
public decimal EffectiveTaxRate { get; set; } = 0.25m;
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset UpdatedAt { get; set; }
public bool IsDeleted { get; set; }
public DateTimeOffset? DeletedAt { get; set; }
public byte[] RowVersion { get; set; } = [];
public List<Income> Incomes { get; set; } = [];
public List<Outgo> Outgos { get; set; } = [];