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:
@@ -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; } = [];
|
||||
|
||||
Reference in New Issue
Block a user