Skip to content

Commit d816d40

Browse files
refactor: Remove legacy properties from BanFileMonitor and CentralBanFileStatus models and related mappings
1 parent b218fa9 commit d816d40

12 files changed

Lines changed: 6 additions & 418 deletions

File tree

src/XtremeIdiots.Portal.Repository.Abstractions.V1/Models/V1/BanFileMonitors/BanFileMonitorDto.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,6 @@ public record BanFileMonitorDto : IDto
4545
[JsonProperty]
4646
public long? RemoteFileSize { get; internal set; }
4747

48-
[JsonProperty]
49-
public DateTime? LegacyLastCheckUtc { get; internal set; }
50-
51-
[JsonProperty]
52-
public string? LegacyLastCheckResult { get; internal set; }
53-
54-
[JsonProperty]
55-
public string? LegacyLastCheckErrorMessage { get; internal set; }
56-
57-
[JsonProperty]
58-
public string? LegacyRemoteFilePath { get; internal set; }
59-
60-
[JsonProperty]
61-
public string? LegacyResolvedForMod { get; internal set; }
62-
63-
[JsonProperty]
64-
public long? LegacyRemoteFileSize { get; internal set; }
65-
66-
[JsonProperty]
67-
public DateTime? LegacyLastPushUtc { get; internal set; }
68-
69-
[JsonProperty]
70-
public string? LegacyLastPushedETag { get; internal set; }
71-
72-
[JsonProperty]
73-
public long? LegacyLastPushedSize { get; internal set; }
74-
7548
// === Last import (manual ban detection) ===
7649

7750
[JsonProperty]
@@ -103,12 +76,6 @@ public record BanFileMonitorDto : IDto
10376
[JsonProperty]
10477
public DateTime? LastCentralBlobUtc { get; internal set; }
10578

106-
[JsonProperty]
107-
public string? LegacyLastCentralBlobETag { get; internal set; }
108-
109-
[JsonProperty]
110-
public DateTime? LegacyLastCentralBlobUtc { get; internal set; }
111-
11279
// === Failure tracking ===
11380

11481
[JsonProperty]
@@ -128,18 +95,6 @@ public record BanFileMonitorDto : IDto
12895
[JsonProperty]
12996
public int? RemoteExternalCount { get; internal set; }
13097

131-
[JsonProperty]
132-
public int? LegacyRemoteTotalLineCount { get; internal set; }
133-
134-
[JsonProperty]
135-
public int? LegacyRemoteUntaggedCount { get; internal set; }
136-
137-
[JsonProperty]
138-
public int? LegacyRemoteBanSyncCount { get; internal set; }
139-
140-
[JsonProperty]
141-
public int? LegacyRemoteExternalCount { get; internal set; }
142-
14398
[JsonProperty]
14499
#pragma warning disable CS8618
145100
public GameServerDto GameServer { get; internal set; }

src/XtremeIdiots.Portal.Repository.Abstractions.V1/Models/V1/BanFileMonitors/UpsertBanFileMonitorStatusDto.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,6 @@ public UpsertBanFileMonitorStatusDto(Guid gameServerId)
4040
[JsonProperty]
4141
public long? RemoteFileSize { get; set; }
4242

43-
[JsonProperty]
44-
public DateTime? LegacyLastCheckUtc { get; set; }
45-
46-
[JsonProperty]
47-
public string? LegacyLastCheckResult { get; set; }
48-
49-
[JsonProperty]
50-
public string? LegacyLastCheckErrorMessage { get; set; }
51-
52-
[JsonProperty]
53-
public string? LegacyRemoteFilePath { get; set; }
54-
55-
[JsonProperty]
56-
public string? LegacyResolvedForMod { get; set; }
57-
58-
[JsonProperty]
59-
public long? LegacyRemoteFileSize { get; set; }
60-
61-
[JsonProperty]
62-
public DateTime? LegacyLastPushUtc { get; set; }
63-
64-
[JsonProperty]
65-
public string? LegacyLastPushedETag { get; set; }
66-
67-
[JsonProperty]
68-
public long? LegacyLastPushedSize { get; set; }
69-
7043
// Import
7144
[JsonProperty]
7245
public DateTime? LastImportUtc { get; set; }
@@ -94,12 +67,6 @@ public UpsertBanFileMonitorStatusDto(Guid gameServerId)
9467
[JsonProperty]
9568
public DateTime? LastCentralBlobUtc { get; set; }
9669

97-
[JsonProperty]
98-
public string? LegacyLastCentralBlobETag { get; set; }
99-
100-
[JsonProperty]
101-
public DateTime? LegacyLastCentralBlobUtc { get; set; }
102-
10370
// Failure tracking — when set, replaces the value (does not increment).
10471
// Pass 0 on success to clear, or the new running total on failure.
10572
[JsonProperty]
@@ -118,18 +85,6 @@ public UpsertBanFileMonitorStatusDto(Guid gameServerId)
11885
[JsonProperty]
11986
public int? RemoteExternalCount { get; set; }
12087

121-
[JsonProperty]
122-
public int? LegacyRemoteTotalLineCount { get; set; }
123-
124-
[JsonProperty]
125-
public int? LegacyRemoteUntaggedCount { get; set; }
126-
127-
[JsonProperty]
128-
public int? LegacyRemoteBanSyncCount { get; set; }
129-
130-
[JsonProperty]
131-
public int? LegacyRemoteExternalCount { get; set; }
132-
13388
[JsonIgnore]
13489
public Dictionary<string, string> TelemetryProperties => new()
13590
{

src/XtremeIdiots.Portal.Repository.Abstractions.V1/Models/V1/CentralBanFileStatus/CentralBanFileStatusDto.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,6 @@ public record CentralBanFileStatusDto : IDto
5656
[JsonProperty]
5757
public string? ActiveBanSetHash { get; internal set; }
5858

59-
[JsonProperty]
60-
public DateTime? LegacyBlobLastRegeneratedUtc { get; internal set; }
61-
62-
[JsonProperty]
63-
public string? LegacyBlobETag { get; internal set; }
64-
65-
[JsonProperty]
66-
public long? LegacyBlobSizeBytes { get; internal set; }
67-
68-
[JsonProperty]
69-
public int? LegacyTotalLineCount { get; internal set; }
70-
71-
[JsonProperty]
72-
public int? LegacyBanSyncLineCount { get; internal set; }
73-
74-
[JsonProperty]
75-
public int? LegacyExternalLineCount { get; internal set; }
76-
77-
[JsonProperty]
78-
public DateTime? LegacyExternalSourceLastModifiedUtc { get; internal set; }
79-
80-
[JsonProperty]
81-
public int? LegacyLastRegenerationDurationMs { get; internal set; }
82-
83-
[JsonProperty]
84-
public string? LegacyLastRegenerationError { get; internal set; }
85-
86-
[JsonProperty]
87-
public string? LegacyActiveBanSetHash { get; internal set; }
88-
8959
[JsonProperty]
9060
public DateTime LastUpdatedUtc { get; internal set; }
9161

src/XtremeIdiots.Portal.Repository.Abstractions.V1/Models/V1/CentralBanFileStatus/UpsertCentralBanFileStatusDto.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,36 +57,6 @@ public UpsertCentralBanFileStatusDto(GameType gameType)
5757
[JsonProperty]
5858
public string? ActiveBanSetHash { get; set; }
5959

60-
[JsonProperty]
61-
public DateTime? LegacyBlobLastRegeneratedUtc { get; set; }
62-
63-
[JsonProperty]
64-
public string? LegacyBlobETag { get; set; }
65-
66-
[JsonProperty]
67-
public long? LegacyBlobSizeBytes { get; set; }
68-
69-
[JsonProperty]
70-
public int? LegacyTotalLineCount { get; set; }
71-
72-
[JsonProperty]
73-
public int? LegacyBanSyncLineCount { get; set; }
74-
75-
[JsonProperty]
76-
public int? LegacyExternalLineCount { get; set; }
77-
78-
[JsonProperty]
79-
public DateTime? LegacyExternalSourceLastModifiedUtc { get; set; }
80-
81-
[JsonProperty]
82-
public int? LegacyLastRegenerationDurationMs { get; set; }
83-
84-
[JsonProperty]
85-
public string? LegacyLastRegenerationError { get; set; }
86-
87-
[JsonProperty]
88-
public string? LegacyActiveBanSetHash { get; set; }
89-
9060
[JsonIgnore]
9161
public Dictionary<string, string> TelemetryProperties => new()
9262
{

src/XtremeIdiots.Portal.Repository.Api.Client.Testing/Fakes/FakeBanFileMonitorsApi.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,7 @@ public Task<ApiResult<BanFileMonitorDto>> UpsertBanFileMonitorStatus(UpsertBanFi
7777
RemoteTotalLineCount = upsertDto.RemoteTotalLineCount ?? existing.RemoteTotalLineCount,
7878
RemoteUntaggedCount = upsertDto.RemoteUntaggedCount ?? existing.RemoteUntaggedCount,
7979
RemoteBanSyncCount = upsertDto.RemoteBanSyncCount ?? existing.RemoteBanSyncCount,
80-
RemoteExternalCount = upsertDto.RemoteExternalCount ?? existing.RemoteExternalCount,
81-
LegacyLastCheckUtc = upsertDto.LegacyLastCheckUtc ?? existing.LegacyLastCheckUtc,
82-
LegacyLastCheckResult = upsertDto.LegacyLastCheckResult ?? existing.LegacyLastCheckResult,
83-
LegacyLastCheckErrorMessage = upsertDto.LegacyLastCheckErrorMessage ?? existing.LegacyLastCheckErrorMessage,
84-
LegacyRemoteFilePath = upsertDto.LegacyRemoteFilePath ?? existing.LegacyRemoteFilePath,
85-
LegacyResolvedForMod = upsertDto.LegacyResolvedForMod ?? existing.LegacyResolvedForMod,
86-
LegacyRemoteFileSize = upsertDto.LegacyRemoteFileSize ?? existing.LegacyRemoteFileSize,
87-
LegacyLastPushUtc = upsertDto.LegacyLastPushUtc ?? existing.LegacyLastPushUtc,
88-
LegacyLastPushedETag = upsertDto.LegacyLastPushedETag ?? existing.LegacyLastPushedETag,
89-
LegacyLastPushedSize = upsertDto.LegacyLastPushedSize ?? existing.LegacyLastPushedSize,
90-
LegacyLastCentralBlobETag = upsertDto.LegacyLastCentralBlobETag ?? existing.LegacyLastCentralBlobETag,
91-
LegacyLastCentralBlobUtc = upsertDto.LegacyLastCentralBlobUtc ?? existing.LegacyLastCentralBlobUtc,
92-
LegacyRemoteTotalLineCount = upsertDto.LegacyRemoteTotalLineCount ?? existing.LegacyRemoteTotalLineCount,
93-
LegacyRemoteUntaggedCount = upsertDto.LegacyRemoteUntaggedCount ?? existing.LegacyRemoteUntaggedCount,
94-
LegacyRemoteBanSyncCount = upsertDto.LegacyRemoteBanSyncCount ?? existing.LegacyRemoteBanSyncCount,
95-
LegacyRemoteExternalCount = upsertDto.LegacyRemoteExternalCount ?? existing.LegacyRemoteExternalCount
80+
RemoteExternalCount = upsertDto.RemoteExternalCount ?? existing.RemoteExternalCount
9681
};
9782

9883
_monitors[updated.BanFileMonitorId] = updated;

src/XtremeIdiots.Portal.Repository.Api.Client.Testing/Fakes/FakeCentralBanFileStatusApi.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,12 @@ public Task<ApiResult<CentralBanFileStatusDto>> UpsertCentralBanFileStatus(Upser
6060
ExternalLineCount = upsertDto.ExternalLineCount ?? existing.ExternalLineCount,
6161
ExternalSourceLastModifiedUtc = upsertDto.ExternalSourceLastModifiedUtc ?? existing.ExternalSourceLastModifiedUtc,
6262
LastRegenerationDurationMs = upsertDto.LastRegenerationDurationMs ?? existing.LastRegenerationDurationMs,
63-
LastRegenerationError = upsertDto.LastRegenerationError ?? existing.LastRegenerationError,
63+
LastRegenerationError = upsertDto.LastRegenerationError is null
64+
? existing.LastRegenerationError
65+
: upsertDto.LastRegenerationError.Length == 0
66+
? null
67+
: upsertDto.LastRegenerationError,
6468
ActiveBanSetHash = upsertDto.ActiveBanSetHash ?? existing.ActiveBanSetHash,
65-
LegacyBlobLastRegeneratedUtc = upsertDto.LegacyBlobLastRegeneratedUtc ?? existing.LegacyBlobLastRegeneratedUtc,
66-
LegacyBlobETag = upsertDto.LegacyBlobETag ?? existing.LegacyBlobETag,
67-
LegacyBlobSizeBytes = upsertDto.LegacyBlobSizeBytes ?? existing.LegacyBlobSizeBytes,
68-
LegacyTotalLineCount = upsertDto.LegacyTotalLineCount ?? existing.LegacyTotalLineCount,
69-
LegacyBanSyncLineCount = upsertDto.LegacyBanSyncLineCount ?? existing.LegacyBanSyncLineCount,
70-
LegacyExternalLineCount = upsertDto.LegacyExternalLineCount ?? existing.LegacyExternalLineCount,
71-
LegacyExternalSourceLastModifiedUtc = upsertDto.LegacyExternalSourceLastModifiedUtc ?? existing.LegacyExternalSourceLastModifiedUtc,
72-
LegacyLastRegenerationDurationMs = upsertDto.LegacyLastRegenerationDurationMs ?? existing.LegacyLastRegenerationDurationMs,
73-
LegacyLastRegenerationError = upsertDto.LegacyLastRegenerationError ?? existing.LegacyLastRegenerationError,
74-
LegacyActiveBanSetHash = upsertDto.LegacyActiveBanSetHash ?? existing.LegacyActiveBanSetHash,
7569
LastUpdatedUtc = DateTime.UtcNow
7670
};
7771

src/XtremeIdiots.Portal.Repository.Api.V1/Mapping/BanFileMonitorsMappingExtensions.cs

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,6 @@ public static BanFileMonitorDto ToDto(this BanFileMonitor entity, bool expand =
4141
RemoteUntaggedCount = entity.RemoteUntaggedCount,
4242
RemoteBanSyncCount = entity.RemoteBanSyncCount,
4343
RemoteExternalCount = entity.RemoteExternalCount,
44-
LegacyLastCheckUtc = entity.LegacyLastCheckUtc,
45-
LegacyLastCheckResult = entity.LegacyLastCheckResult,
46-
LegacyLastCheckErrorMessage = entity.LegacyLastCheckErrorMessage,
47-
LegacyRemoteFilePath = entity.LegacyRemoteFilePath,
48-
LegacyResolvedForMod = entity.LegacyResolvedForMod,
49-
LegacyRemoteFileSize = entity.LegacyRemoteFileSize,
50-
LegacyLastPushUtc = entity.LegacyLastPushUtc,
51-
LegacyLastPushedETag = entity.LegacyLastPushedEtag,
52-
LegacyLastPushedSize = entity.LegacyLastPushedSize,
53-
LegacyLastCentralBlobETag = entity.LegacyLastCentralBlobEtag,
54-
LegacyLastCentralBlobUtc = entity.LegacyLastCentralBlobUtc,
55-
LegacyRemoteTotalLineCount = entity.LegacyRemoteTotalLineCount,
56-
LegacyRemoteUntaggedCount = entity.LegacyRemoteUntaggedCount,
57-
LegacyRemoteBanSyncCount = entity.LegacyRemoteBanSyncCount,
58-
LegacyRemoteExternalCount = entity.LegacyRemoteExternalCount,
5944
GameServer = expand && entity.GameServer is not null ? entity.GameServer.ToDto(false) : null!
6045
};
6146
}
@@ -164,81 +149,6 @@ public static void ApplyStatus(this UpsertBanFileMonitorStatusDto dto, BanFileMo
164149
{
165150
entity.RemoteExternalCount = dto.RemoteExternalCount.Value;
166151
}
167-
168-
if (dto.LegacyLastCheckUtc.HasValue)
169-
{
170-
entity.LegacyLastCheckUtc = dto.LegacyLastCheckUtc.Value;
171-
}
172-
173-
if (dto.LegacyLastCheckResult is not null)
174-
{
175-
entity.LegacyLastCheckResult = dto.LegacyLastCheckResult;
176-
}
177-
178-
if (dto.LegacyLastCheckErrorMessage is not null)
179-
{
180-
entity.LegacyLastCheckErrorMessage = dto.LegacyLastCheckErrorMessage;
181-
}
182-
183-
if (dto.LegacyRemoteFilePath is not null)
184-
{
185-
entity.LegacyRemoteFilePath = dto.LegacyRemoteFilePath;
186-
}
187-
188-
if (dto.LegacyResolvedForMod is not null)
189-
{
190-
entity.LegacyResolvedForMod = dto.LegacyResolvedForMod;
191-
}
192-
193-
if (dto.LegacyRemoteFileSize.HasValue)
194-
{
195-
entity.LegacyRemoteFileSize = dto.LegacyRemoteFileSize.Value;
196-
}
197-
198-
if (dto.LegacyLastPushUtc.HasValue)
199-
{
200-
entity.LegacyLastPushUtc = dto.LegacyLastPushUtc.Value;
201-
}
202-
203-
if (dto.LegacyLastPushedETag is not null)
204-
{
205-
entity.LegacyLastPushedEtag = dto.LegacyLastPushedETag;
206-
}
207-
208-
if (dto.LegacyLastPushedSize.HasValue)
209-
{
210-
entity.LegacyLastPushedSize = dto.LegacyLastPushedSize.Value;
211-
}
212-
213-
if (dto.LegacyLastCentralBlobETag is not null)
214-
{
215-
entity.LegacyLastCentralBlobEtag = dto.LegacyLastCentralBlobETag;
216-
}
217-
218-
if (dto.LegacyLastCentralBlobUtc.HasValue)
219-
{
220-
entity.LegacyLastCentralBlobUtc = dto.LegacyLastCentralBlobUtc.Value;
221-
}
222-
223-
if (dto.LegacyRemoteTotalLineCount.HasValue)
224-
{
225-
entity.LegacyRemoteTotalLineCount = dto.LegacyRemoteTotalLineCount.Value;
226-
}
227-
228-
if (dto.LegacyRemoteUntaggedCount.HasValue)
229-
{
230-
entity.LegacyRemoteUntaggedCount = dto.LegacyRemoteUntaggedCount.Value;
231-
}
232-
233-
if (dto.LegacyRemoteBanSyncCount.HasValue)
234-
{
235-
entity.LegacyRemoteBanSyncCount = dto.LegacyRemoteBanSyncCount.Value;
236-
}
237-
238-
if (dto.LegacyRemoteExternalCount.HasValue)
239-
{
240-
entity.LegacyRemoteExternalCount = dto.LegacyRemoteExternalCount.Value;
241-
}
242152
}
243153
}
244154
}

0 commit comments

Comments
 (0)