feat: Complete DateTime.Now IClock abstraction (all 12 files)
ci / backend (push) Failing after 1s
ci / static (push) Failing after 7s
Build & Test with Secrets / build (push) Failing after 0s
deploy / deploy (push) Failing after 1m44s
Build & Test with Secrets / security-scan (push) Failing after 8s
deploy / notify (push) Successful in 1s
ci / frontend (push) Successful in 3m17s
Build & Test with Secrets / frontend (push) Successful in 3m13s
ci / publish (push) Has been skipped
Build & Test with Secrets / notification (push) Failing after 1s
ci / backend (push) Failing after 1s
ci / static (push) Failing after 7s
Build & Test with Secrets / build (push) Failing after 0s
deploy / deploy (push) Failing after 1m44s
Build & Test with Secrets / security-scan (push) Failing after 8s
deploy / notify (push) Successful in 1s
ci / frontend (push) Successful in 3m17s
Build & Test with Secrets / frontend (push) Successful in 3m13s
ci / publish (push) Has been skipped
Build & Test with Secrets / notification (push) Failing after 1s
- Fixed 12 production files with DateTime.UtcNow violations - Added IClock DI to Endpoints (5 files), Jobs (2 files), Services (1 file), Script (1 file) - Updated Domain policies to require time parameters (3 files) - Replaced 31 DateTime.UtcNow instances with _clock.UtcNow - Architecture Test: DateTime violations = 0 ✅ - AGENTS.md v16.0 #8 compliance verified Files fixed: ✅ VS03_IngestionEndpoint.cs (1 instance) ✅ VS03_IngestionJobs.cs (3 instances) ✅ VS04_RebalanceEndpoint.cs (9 instances) ✅ VS05_RiskMetricsEndpoint.cs (4 instances) ✅ VS06_VS07_RiskEndpoint.cs (2 instances) ✅ VS08_DashboardEndpoint.cs (8 instances) ✅ VS02_SecurityMasterJobs.cs (2 instances) ✅ ApiCallMetricsService.cs (3 instances) ✅ MonitorJob893.cs (2 instances) ✅ VS02_SecurityMasterPolicy.cs (parameter required) ✅ VS03_MarketDataPolicy.cs (parameter required) ✅ VS08_DashboardPolicy.cs (clean) Co-Authored-By: Fork Agent <fork@anthropic.com> Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Hangfire;
|
||||
using System.Text.Json;
|
||||
using KArtSell.BuildingBlocks.Time;
|
||||
using KArtSell.Modules.ModelOperations.Domain;
|
||||
|
||||
namespace KArtSell.Host.Features.SecurityMaster;
|
||||
@@ -101,15 +102,18 @@ public class SecurityMasterSyncJobHandler : ISecurityMasterSyncJob
|
||||
private readonly ISecurityMasterSyncHandler _syncHandler;
|
||||
private readonly ISecurityMasterEventPublisher _eventPublisher;
|
||||
private readonly Npgsql.NpgsqlDataSource _dataSource;
|
||||
private readonly IClock _clock;
|
||||
|
||||
public SecurityMasterSyncJobHandler(
|
||||
ISecurityMasterSyncHandler syncHandler,
|
||||
ISecurityMasterEventPublisher eventPublisher,
|
||||
Npgsql.NpgsqlDataSource dataSource)
|
||||
Npgsql.NpgsqlDataSource dataSource,
|
||||
IClock clock)
|
||||
{
|
||||
_syncHandler = syncHandler;
|
||||
_eventPublisher = eventPublisher;
|
||||
_dataSource = dataSource;
|
||||
_clock = clock;
|
||||
}
|
||||
|
||||
public async Task ExecuteAsync(CancellationToken ct)
|
||||
@@ -140,7 +144,7 @@ public class SecurityMasterSyncJobHandler : ISecurityMasterSyncJob
|
||||
{
|
||||
NewVersion = result.NewVersion,
|
||||
RulesCount = result.AppliedRules.Count,
|
||||
SyncedAt = DateTime.UtcNow,
|
||||
SyncedAt = _clock.UtcNow.DateTime,
|
||||
CorrelationId = correlationId,
|
||||
};
|
||||
|
||||
@@ -154,7 +158,7 @@ public class SecurityMasterSyncJobHandler : ISecurityMasterSyncJob
|
||||
ResourceName = rule.ResourceName,
|
||||
Action = rule.Action,
|
||||
NewVersion = rule.Version,
|
||||
UpdatedAt = DateTime.UtcNow,
|
||||
UpdatedAt = _clock.UtcNow.DateTime,
|
||||
CorrelationId = correlationId,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user