=== 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
@@ -17,6 +17,8 @@ namespace adas_core.Infrastructure.Repositories;
/// </summary>
/// <typeparam name="Relay">The type of the entity managed by the repository.</typeparam>
/// <remarks>This class combines a concrete MongoDB repository implementation with a domain-specific interface, enabling standardized persistence operations for relay entities.</remarks>
/// <!-- aidoc-review:v1 severity=high kind=extra_param
/// "RelayRepository is not a generic class (declared as 'public class RelayRepository : MongoRepository<Relay>, IRelayRepository'), so the <typeparam name='Relay'> tag is invalid. Relay is a concrete type used as the type argument to the base class, not a type parameter of RelayRepository." -->
public class RelayRepository : MongoRepository<Relay>, IRelayRepository
{
private readonly ApiSettings _apiSettings;
@@ -38,6 +40,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// Retrieves the collection name for relays from the API settings configuration.
/// </summary>
/// <returns>The configured relays collection name as specified in the API settings.</returns>
/// <!-- aidoc:v1 sig=94e22ff body=c6df698 -->
public override string GetCollectionName()
{
return _apiSettings.Relays;
@@ -48,6 +51,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// </summary>
/// <param name="relayId">The unique identifier of the relay to look up.</param>
/// <returns>The matching <see cref="Relay"/>, or <c>null</c> if no document matches the identifier or the query fails.</returns>
/// <!-- aidoc:v1 sig=3807664 body=f06b9f2 -->
public async Task<Relay?> GetById(ObjectId relayId)
{
try
@@ -69,6 +73,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// <param name="configurationRelayList">The collection of relay identifiers used to filter relays by their Id field.</param>
/// <param name="type">The relay type used as an equality filter on the Type field.</param>
/// <returns>A list of <see cref="Relay"/> instances matching both the identifier and type filters; an empty list is returned when no relays match.</returns>
/// <!-- aidoc:v1 sig=ef9043b body=3a8764d -->
public List<Relay> GetRelayByTypeInList(List<ObjectId> configurationRelayList, RelayEnum.Type type)
{
var filterBuilder = Builders<Relay>.Filter;
@@ -86,6 +91,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// </summary>
/// <param name="configurationRelayList">The collection of <see cref="ObjectId"/> values used to match relays by their <c>Id</c> field.</param>
/// <returns>A <see cref="List{Relay}"/> containing the relays whose identifiers are found in <paramref name="configurationRelayList"/>; an empty list is returned when no matching relays exist.</returns>
/// <!-- aidoc:v1 sig=262306c body=ab06cc9 -->
public List<Relay> GetRelayInList(List<ObjectId> configurationRelayList)
{
var filterBuilder = Builders<Relay>.Filter;
@@ -102,6 +108,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// </summary>
/// <param name="filter">The pagination criteria containing the optional text filter applied against the relay name.</param>
/// <returns>A fluent find query for <see cref="Relay"/> entities, ordered by relay name in ascending order, ready for further pagination.</returns>
/// <!-- aidoc:v1 sig=6da9abe body=35a5fce -->
public IFindFluent<Relay, Relay> GetPaginatedRelays(PaginationFilter filter)
{
var filterBuilder = Builders<Relay>.Filter;
@@ -132,6 +139,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// </summary>
/// <param name="request">The relay entity to insert into the collection.</param>
/// <returns>The inserted relay retrieved by its identifier, or <c>null</c> if the insertion fails.</returns>
/// <!-- aidoc:v1 sig=79b3c83 body=60b6b6c -->
public async Task<Relay?> InsertOneRelayAsync(Relay request)
{
try
@@ -154,6 +162,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// <param name="objectId">The unique identifier of the relay document to update in the collection.</param>
/// <param name="relay">The relay instance containing the new values to apply to the existing document.</param>
/// <returns>A task that represents the asynchronous operation, containing the updated <see cref="Relay"/> after the update, or <c>null</c> if no matching document was found.</returns>
/// <!-- aidoc:v1 sig=2ca072d body=5a785d8 -->
public async Task<Relay?> UpdateRelayAsync(ObjectId objectId, Relay relay)
{
var filter = Builders<Relay>.Filter.Eq("_id", objectId);
@@ -176,6 +185,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// </summary>
/// <param name="requestRelayName">The name of the relay to look up. May be <c>null</c>, in which case the query matches relays with a null name.</param>
/// <returns>A <see cref="Task{TResult}"/> containing the matching <see cref="Relay"/>, or <c>null</c> if no relay with the specified name is found.</returns>
/// <!-- aidoc:v1 sig=22f1a02 body=1a92d9a -->
public async Task<Relay?> GetByName(string? requestRelayName)
{
var filterBuilder = Builders<Relay>.Filter;
@@ -191,6 +201,7 @@ public class RelayRepository : MongoRepository<Relay>, IRelayRepository
/// <param name="filters">The list of filter definitions to combine; when empty, an empty filter is used to match all documents.</param>
/// <param name="sort">The sort definition applied to the query results.</param>
/// <returns>An <see cref="IFindFluent{TDocument, TProjection}"/> representing the filtered and sorted Relay query.</returns>
/// <!-- aidoc:v1 sig=e3578fc body=a377885 -->
private IFindFluent<Relay, Relay> CreateFindFluent(List<FilterDefinition<Relay>> filters, SortDefinition<Relay> sort)
{
var combinedFilter = filters.Any()