=== 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
@@ -15,6 +15,7 @@ namespace adas_core.Infrastructure.Repositories;
/// Repository implementation for managing <see cref="LightBeacon"/> entities in MongoDB.
/// Provides CRUD operations and query capabilities specific to light beacons.
/// </summary>
/// <!-- aidoc:v1 sig=f6a410c -->
public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconRepository
{
private readonly ApiSettings _apiSettings;
@@ -25,6 +26,7 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// </summary>
/// <param name="database">The MongoDB database instance used to access the collection.</param>
/// <param name="apiSettings">The application API settings containing configuration values, including the collection name.</param>
/// <!-- aidoc:v1 sig=005180d body=12fddac -->
public LightBeaconRepository(IMongoDatabase database, IOptions<ApiSettings> apiSettings) : base(database)
{
_apiSettings = apiSettings.Value;
@@ -34,6 +36,7 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// Gets the name of the MongoDB collection used to store light beacons.
/// </summary>
/// <returns>The collection name retrieved from the API settings.</returns>
/// <!-- aidoc:v1 sig=94e22ff body=b7c9492 -->
public override string GetCollectionName()
{
return _apiSettings.LightBeacons;
@@ -44,6 +47,7 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// </summary>
/// <param name="configurationRelayList">A list of <see cref="ObjectId"/> values representing the relay identifiers to filter by.</param>
/// <returns>A <see cref="List{LightBeacon}"/> containing the matching light beacons. Returns an empty list if no matches are found.</returns>
/// <!-- aidoc:v1 sig=c392d31 body=b387b94 -->
public List<LightBeacon> GetLightBeaconInList(List<ObjectId> configurationRelayList)
{
var filterBuilder = Builders<LightBeacon>.Filter;
@@ -62,6 +66,7 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// A <see cref="Task{LightBeacon}"/> representing the asynchronous operation.
/// The task result contains the <see cref="LightBeacon"/> if found; otherwise, <see langword="null"/>.
/// </returns>
/// <!-- aidoc:v1 sig=0f2f926 body=1b42ab2 -->
public async Task<LightBeacon?> GetById(ObjectId relayId)
{
try
@@ -85,6 +90,7 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// A <see cref="Task{LightBeacon}"/> representing the asynchronous operation.
/// The task result contains the <see cref="LightBeacon"/> if found; otherwise, <see langword="null"/>.
/// </returns>
/// <!-- aidoc:v1 sig=adf2a24 body=8e1d78c -->
public async Task<LightBeacon?> GetByName(string? requestRelayName)
{
var filterBuilder = Builders<LightBeacon>.Filter;
@@ -102,6 +108,8 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// A <see cref="Task{LightBeacon}"/> representing the asynchronous operation.
/// The task result contains the inserted <see cref="LightBeacon"/> if successful; otherwise, <see langword="null"/> if the operation fails.
/// </returns>
/// <!-- aidoc-review:v1 severity=low kind=wrong_returns
/// "The cref in the <returns> tag references Task{LightBeacon}, but the method's actual return type is Task<LightBeacon?} (nullable). The descriptive text correctly mentions the null case, so the semantic meaning is preserved, but the type reference is inaccurate." -->
public async Task<LightBeacon?> InsertOneAsyncAndReturn(LightBeacon beacon)
{
try
@@ -125,6 +133,7 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// An <see cref="IFindFluent{LightBeacon, LightBeacon}"/> instance that can be used to further refine and execute the query.
/// </returns>
/// <exception cref="BadRequestException">Thrown when the text filter exceeds 100 characters in length.</exception>
/// <!-- aidoc:v1 sig=07ed538 body=4c87ab2 -->
public IFindFluent<LightBeacon, LightBeacon> GetPaginatedRelays(PaginationFilter filter)
{
var filterBuilder = Builders<LightBeacon>.Filter;
@@ -163,6 +172,7 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// containing a list of matching <see cref="LightBeacon"/> objects.
/// </returns>
/// <exception cref="NotImplementedException">This method is not yet implemented.</exception>
/// <!-- aidoc:v1 sig=7342f3e body=bfa6f2f -->
public Task<List<LightBeacon>> GetSearchByName(string textToSearch)
{
throw new NotImplementedException();
@@ -175,6 +185,7 @@ public class LightBeaconRepository : MongoRepository<LightBeacon>, ILightBeaconR
/// <param name="filters">A list of <see cref="FilterDefinition{LightBeacon}"/> to be combined into the query.</param>
/// <param name="sort">The <see cref="SortDefinition{LightBeacon}"/> defining the sort order of the results.</param>
/// <returns>An <see cref="IFindFluent{LightBeacon, LightBeacon}"/> instance representing the constructed query.</returns>
/// <!-- aidoc:v1 sig=1b1403f body=e71d1c5 -->
private IFindFluent<LightBeacon, LightBeacon> CreateFindFluent(List<FilterDefinition<LightBeacon>> filters, SortDefinition<LightBeacon> sort)
{
var combinedFilter = filters.Any()