=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===

This commit is contained in:
julian
2026-06-28 02:50:05 -07:00
parent a19fb90902
commit 586f02a2ca
654 changed files with 5260 additions and 0 deletions
@@ -30,6 +30,7 @@ public class HistoricalConfigChangesService(
/// Deletes a historical configuration change record by its identifier and creates an audit log entry recording the deletion.
/// </summary>
/// <param name="id">The unique identifier of the historical configuration change to delete.</param>
/// <!-- aidoc:v1 sig=86555ed body=001920f -->
public async Task DeleteHistoricalConfigChange(ObjectId id)
{
var filter = Builders<HistoricalConfigChanges>.Filter.Eq("_id", id);
@@ -44,6 +45,7 @@ public class HistoricalConfigChangesService(
/// </summary>
/// <param name="configType">The configuration type used to look up the last historical change.</param>
/// <returns>The most recent <see cref="HistoricalConfigChanges"/> entry, or <c>null</c> if no changes exist for the given type.</returns>
/// <!-- aidoc:v1 sig=c35ac55 body=bbcde5b -->
public async Task<HistoricalConfigChanges?> FindLastConfigChanges(DisplayConfigEnums.ConfigTypes configType)
{
var result = await historicalConfigChangesRepository.FindLastHistoricalConfigChangesByType(configType);
@@ -57,6 +59,7 @@ public class HistoricalConfigChangesService(
/// </summary>
/// <param name="id">The unique identifier of the historical configuration change to retrieve.</param>
/// <returns>The matching <see cref="HistoricalConfigChanges"/> record, or null if no record is found.</returns>
/// <!-- aidoc:v1 sig=7f8de28 body=46df3de -->
public async Task<HistoricalConfigChanges?> Get(ObjectId id)
{
return await historicalConfigChangesRepository.FindById(id);
@@ -66,6 +69,7 @@ public class HistoricalConfigChangesService(
/// Retrieves all historical configuration changes from the repository.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing a collection of all <see cref="HistoricalConfigChanges"/> records.</returns>
/// <!-- aidoc:v1 sig=f0919e8 body=6a8aec9 -->
public async Task<ICollection<HistoricalConfigChanges>> GetAll()
{
return await historicalConfigChangesRepository.FindAll();
@@ -77,6 +81,7 @@ public class HistoricalConfigChangesService(
/// <param name="type">The configuration type used to filter the historical changes.</param>
/// <param name="num">The maximum number of recent changes to return. Defaults to 10.</param>
/// <returns>A collection of the latest <see cref="HistoricalConfigChanges"/> entries matching the specified type.</returns>
/// <!-- aidoc:v1 sig=eb58afd body=9a8ae02 -->
public async Task<ICollection<HistoricalConfigChanges>> GetByType(DisplayConfigEnums.ConfigTypes type, int num = 10)
{
return await historicalConfigChangesRepository.FindLastHistoricalConfigChangesByType(type, num);
@@ -90,6 +95,7 @@ public class HistoricalConfigChangesService(
/// <param name="configTypes">Optional filter for the configuration type; when null, all configuration types are included.</param>
/// <param name="num">The maximum number of historical change entries to return. Defaults to 10.</param>
/// <returns>A task that represents the asynchronous operation, containing a collection of the user's historical configuration changes.</returns>
/// <!-- aidoc:v1 sig=a9c5b43 body=8f686c3 -->
public async Task<ICollection<HistoricalConfigChanges>> GetByUser(string user,
DisplayConfigEnums.ConfigTypes? configTypes = null, int num = 10)
{
@@ -103,6 +109,7 @@ public class HistoricalConfigChangesService(
/// <param name="historicalConfigChanges">The historical configuration change entity to insert.</param>
/// <returns>The inserted <see cref="HistoricalConfigChanges"/> entity, or null if the operation fails.</returns>
/// <exception cref="ConflictException">Thrown when the repository returns null after the insert operation.</exception>
/// <!-- aidoc:v1 sig=06deefb body=1a2682f -->
public async Task<HistoricalConfigChanges?> InsertOne(HistoricalConfigChanges historicalConfigChanges)
{
try
@@ -127,6 +134,10 @@ public class HistoricalConfigChangesService(
/// <param name="historicalConfigChanges">The historical configuration change entity containing the updated values to persist.</param>
/// <returns>The updated <see cref="HistoricalConfigChanges"/> entity on success, or <c>null</c> if an error occurs during the operation.</returns>
/// <exception cref="ConflictException">Thrown when no existing historical configuration change is found with the specified <c>Id</c>.</exception>
/// <!-- aidoc-review:v1 severity=high kind=wrong_exception
/// "ConflictException is thrown inside the try block but immediately caught by the outer catch (Exception ex), which logs and returns null. The exception never propagates to callers, so documenting it as thrown is misleading." -->
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
/// "Summary states 'If the record is not found, a ConflictException is thrown', but in practice the throw is swallowed by the catch block and the method returns null with a logged error." -->
public async Task<HistoricalConfigChanges?> UpdateHistoricalConfigChange(
HistoricalConfigChanges historicalConfigChanges)
{
@@ -155,6 +166,7 @@ public class HistoricalConfigChangesService(
/// <param name="configType">The type of configuration that was changed.</param>
/// <param name="newConfig">The new configuration value after the change.</param>
/// <param name="oldConfig">The previous configuration value before the change.</param>
/// <!-- aidoc:v1 sig=dd55e13 body=56cb363 -->
public async Task LogConfigChanged(string user, DisplayConfigEnums.ConfigTypes configType, string newConfig,
string oldConfig)
{