=== 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:
@@ -13,6 +13,7 @@ namespace adas_core.Infrastructure.Repositories;
|
||||
/// Repository implementation for managing CardDetailsConfig entities in MongoDB.
|
||||
/// Provides CRUD operations for display detail configurations used in nurse and smart displays.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=34c7058 -->
|
||||
public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>, IDisplayDetailConfigRepository
|
||||
{
|
||||
private readonly ApiSettings _apiSettings;
|
||||
@@ -24,6 +25,7 @@ public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>,
|
||||
/// <param name="database">The MongoDB database instance.</param>
|
||||
/// <param name="apiSettings">API settings containing collection names configuration.</param>
|
||||
/// <param name="logger">Logger for repository operations.</param>
|
||||
/// <!-- aidoc:v1 sig=ad18f30 body=7dde119 -->
|
||||
public DisplayDetailConfigRepository(
|
||||
IMongoDatabase database,
|
||||
ApiSettings apiSettings,
|
||||
@@ -38,6 +40,7 @@ public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>,
|
||||
/// Gets the name of the collection for display detail configurations.
|
||||
/// </summary>
|
||||
/// <returns>The collection name from API settings.</returns>
|
||||
/// <!-- aidoc:v1 sig=94e22ff body=957e9fe -->
|
||||
public override string GetCollectionName()
|
||||
{
|
||||
return _apiSettings.DisplayDetailConfig;
|
||||
@@ -47,6 +50,7 @@ public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>,
|
||||
/// Retrieves all display detail configurations from the database.
|
||||
/// </summary>
|
||||
/// <returns>A list of all CardDetailsConfig entities.</returns>
|
||||
/// <!-- aidoc:v1 sig=7f19149 body=555d3e4 -->
|
||||
public async Task<List<CardDetailsConfig>> GetAll()
|
||||
{
|
||||
var result = await Collection.Find(Builders<CardDetailsConfig>.Filter.Empty).ToListAsync();
|
||||
@@ -59,6 +63,8 @@ public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>,
|
||||
/// <param name="configId">The ObjectId of the detail configuration to retrieve.</param>
|
||||
/// <returns>The CardDetailsConfig if found; otherwise, null.</returns>
|
||||
/// <exception cref="Exception">Throws an exception if MongoDB query fails; returns null instead.</exception>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_exception
|
||||
/// "The method catches all exceptions and returns null; it never throws. The exception tag incorrectly states 'Throws an exception if MongoDB query fails' and is internally contradictory ('returns null instead')." -->
|
||||
public async Task<CardDetailsConfig?> GetById(ObjectId configId)
|
||||
{
|
||||
try
|
||||
@@ -78,6 +84,7 @@ public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>,
|
||||
/// </summary>
|
||||
/// <param name="config">The CardDetailsConfig to insert.</param>
|
||||
/// <returns>The inserted CardDetailsConfig, or null if insertion fails.</returns>
|
||||
/// <!-- aidoc:v1 sig=269dde2 body=b92e5d6 -->
|
||||
public async Task<CardDetailsConfig?> InsertOneAsyncAndReturn(CardDetailsConfig config)
|
||||
{
|
||||
try
|
||||
@@ -98,6 +105,8 @@ public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>,
|
||||
/// <param name="config">The CardDetailsConfig with updated values.</param>
|
||||
/// <returns>An UpdateResponse containing the modified count and the updated document.</returns>
|
||||
/// <exception cref="Exception">Throws an exception if MongoDB update fails; returns UpdateResponse with null document.</exception>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_exception
|
||||
/// "The <exception> tag states the method throws an exception on MongoDB failure, but the catch block catches Exception and never rethrows it; the method always returns an UpdateResponse." -->
|
||||
public async Task<UpdateResponse<CardDetailsConfig?>> UpdateOne(CardDetailsConfig? config)
|
||||
{
|
||||
try
|
||||
@@ -130,6 +139,7 @@ public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>,
|
||||
/// </summary>
|
||||
/// <param name="configId">The ObjectId of the configuration to delete.</param>
|
||||
/// <returns>The deleted CardDetailsConfig if found; otherwise, null.</returns>
|
||||
/// <!-- aidoc:v1 sig=84fe430 body=47fbf6b -->
|
||||
public async Task<CardDetailsConfig?> DeleteOne(ObjectId configId)
|
||||
{
|
||||
return await DeleteAsync(configId);
|
||||
@@ -142,6 +152,8 @@ public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>,
|
||||
/// <param name="resultId">The new reference ID to set.</param>
|
||||
/// <returns>Always throws NotImplementedException.</returns>
|
||||
/// <exception cref="NotImplementedException">This method is not implemented.</exception>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=stale_summary
|
||||
/// "Summary only mentions updating 'the display configuration ID reference' but the method (UpdateCardConfigId) also takes a resultId parameter, indicating it updates more than just the display config ID" -->
|
||||
public Task<object> UpdateCardConfigId(ObjectId? displayConfigId, ObjectId? resultId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
Reference in New Issue
Block a user