sprints work
This commit is contained in:
@@ -10,10 +10,12 @@ namespace StellaOps.Integrations.Persistence;
|
||||
public sealed class PostgresIntegrationRepository : IIntegrationRepository
|
||||
{
|
||||
private readonly IntegrationDbContext _context;
|
||||
private readonly TimeProvider _timeProvider;
|
||||
|
||||
public PostgresIntegrationRepository(IntegrationDbContext context)
|
||||
public PostgresIntegrationRepository(IntegrationDbContext context, TimeProvider? timeProvider = null)
|
||||
{
|
||||
_context = context;
|
||||
_timeProvider = timeProvider ?? TimeProvider.System;
|
||||
}
|
||||
|
||||
public async Task<Integration?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default)
|
||||
@@ -93,7 +95,7 @@ public sealed class PostgresIntegrationRepository : IIntegrationRepository
|
||||
{
|
||||
entity.IsDeleted = true;
|
||||
entity.Status = IntegrationStatus.Archived;
|
||||
entity.UpdatedAt = DateTimeOffset.UtcNow;
|
||||
entity.UpdatedAt = _timeProvider.GetUtcNow();
|
||||
await _context.SaveChangesAsync(cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user