diff --git a/adas-core.Infrastructure/Repositories/MasterListRepository.cs b/adas-core.Infrastructure/Repositories/MasterListRepository.cs index 4a4b3aa1..c56dc8b4 100644 --- a/adas-core.Infrastructure/Repositories/MasterListRepository.cs +++ b/adas-core.Infrastructure/Repositories/MasterListRepository.cs @@ -168,13 +168,14 @@ public class MasterListRepository : MongoRepository, IMasterListRepository } /// - /// Asynchronously finds an entity by its , returning the first matching document with its "options" array limited to 100 elements via projection. If no document matches or an exception is thrown, the error is logged and null is returned. + /// Asynchronously retrieves an entity of type matching the supplied , + /// applying a projection that limits the options field to 100 elements. + /// Exceptions raised during the lookup are logged and surfaced as a null result. /// - /// The used to build the equality filter against the entity's identifier. - /// A that yields the matching entity, or null when no document is found or the operation fails. + /// The document type stored in the collection, expected to expose an Id property. + /// The that uniquely identifies the entity to find. + /// A containing the matching entity, or null when no document is found or the operation fails. /// - /// public async Task FindById(ObjectId id) { try @@ -344,15 +345,12 @@ public class MasterListRepository : MongoRepository, IMasterListRepository } /// - /// Finds a specific option within a master list by master and option IDs without locale translation. + /// Retrieves a single entry from the master document that matches the given and . Returns null when no matching document is found, no option matches, or when the operation fails. /// - /// The ObjectId of the master list. - /// The ObjectId of the option to retrieve. - /// The OptionList if found; otherwise, null. - /// Logs errors and returns null on failure. + /// The of the master document that owns the options array. + /// The of the specific option to locate within the master's options array. + /// A that resolves to the matching , or null if no match is found or an error occurs. /// - /// public async Task FindOptionItemById(ObjectId masterId, ObjectId optionId) { try @@ -603,14 +601,11 @@ public class MasterListRepository : MongoRepository, IMasterListRepository } /// - /// Builds a sorted master-list query for documents of type , returning all documents ordered ascending by the name field, or only those whose Name matches 's search text via a case-insensitive regex (with special characters escaped) when provided. - /// If is null, its FilteredRequest is null, or FilteredRequest.Text is null or empty, no additional filter is applied and the unfiltered, sorted result is returned. + /// Retrieves a paginated master list of items sorted by name in ascending order, applying an optional case-insensitive regex filter on the Name property when a text filter is provided. If no filter request is specified, returns all items without additional filters. /// - /// The containing the optional FilteredRequest.Text used to match the Name field. - /// An representing the sorted, filtered query against the collection of . + /// The containing the pagination and optional text filtering criteria. + /// An representing the queryable collection of matching items, sorted by name. /// - /// public IFindFluent GetPaginatedMasterList(PaginationFilter filter) { var filterBuilder = Builders.Filter; @@ -774,18 +769,12 @@ public class MasterListRepository : MongoRepository, IMasterListRepository } /// - /// Searches for options within a master list using multiple filter criteria. - /// Uses MongoDB aggregation pipeline to apply filters and locale translations. + /// Retrieves a filtered, locale-aware list of options from the master list document identified by , applying the optional search criteria supplied in . When is null or an error occurs during execution, an empty list is returned; translations are resolved per option for the requested locale, falling back to the original name and description when no localized value is available. /// - /// The ObjectId of the master list. - /// The filter criteria including text, name, description, and optionType. - /// A list of matching OptionList items ordered by name. - /// Logs errors and returns empty list on failure. + /// The of the master list document to query. + /// The optional containing the search criteria (option type, text, name, description, and locale) used to filter the resulting options. + /// A containing the matching options ordered by name, or an empty list when no options match, the filters are null, or the operation fails. /// - /// - /// public async Task> GetMasterListByIdAndSearchOptions(ObjectId id, FilterOptionListElement? filters) { try @@ -994,16 +983,13 @@ public class MasterListRepository : MongoRepository, IMasterListRepository } /// - /// Updates a specific option within a master list with locale-aware field updates. + /// Updates an option of the master list identified by , applying locale-aware handling so that is written to the default field when equals the master default locale and to the per-locale translation entry otherwise, and persisting the remaining presentation fields (icons, colors, description, dates, ) only when they are supplied and, where applicable, allowed by the master configuration. Returns the existing duplicate when a name collision is found, the updated on success, or null when no field qualifies, no document is modified, or the operation throws. /// - /// The ObjectId of the master list. - /// The OptionList with updated values. - /// The locale for translation updates. - /// The updated OptionList if successful; otherwise, null. - /// Logs errors and returns null on failure. + /// Identifier of the master list that owns the option being updated. + /// Option carrying the new values; only non-null members are applied, and and are additionally gated by the required flags defined on the master configuration. + /// Target used to decide whether to update the default field or the locale-specific translation entry. + /// A resolving to the existing or updated , or null when no update is performed or the caught error is logged. /// - /// public async Task UpdateMasterListOption(ObjectId id, OptionList newOpt, LocaleEnum locale) { // 1. Evitar duplicados @@ -1098,15 +1084,13 @@ public class MasterListRepository : MongoRepository, IMasterListRepository } /// - /// Updates a specific option within a master list with full replacement. + /// Updates an option within the master list identified by , replacing it with . + /// Returns if the master list cannot be found, if no document is modified, or if an exception occurs during the update (which is logged). /// - /// The ObjectId of the master list. - /// The OptionList with updated values. - /// The updated OptionList if successful; otherwise, null. - /// Logs errors and returns null on failure. + /// The identifier of the master list that contains the option to update. + /// The new that will replace the existing option in the master list. + /// The updated retrieved after a successful update, or if the master list is missing, the update had no effect, or an error was raised. /// - /// public async Task UpdateMasterListOption(ObjectId id, OptionList newOpt) { var master = await FindById(id); @@ -1324,15 +1308,14 @@ public class MasterListRepository : MongoRepository, IMasterListRepository } /// - /// Searches for options within a master list using text search with accent-aware regex. + /// Asynchronously retrieves a list of entries whose name or description matches the provided search text within the document identified by . + /// Returns an empty list when is null, empty, or whitespace, or when an error occurs during execution. + /// Matching is performed case-insensitively using a regex pattern, and the resulting options are ordered by name. /// - /// Optional text to search within options. - /// Optional master list ObjectId to filter results. - /// A list of matching OptionList items ordered by name. - /// Logs errors and returns empty list on failure. + /// The text to search for in the option's name and description. If null, empty, or whitespace, the method returns an empty list. + /// The optional of the document whose options will be filtered. Defaults to . + /// A that yields a of matching the search criteria, ordered by name, or an empty list if no matches are found or an error occurs. /// - /// private async Task> GetOptionsByTextSearch(string? textSearch, ObjectId? id = null) { try @@ -1499,20 +1482,15 @@ public class MasterListRepository : MongoRepository, IMasterListRepository } /// - /// Retrieves the options of a master list document identified by , applying locale-aware - /// translation of the option name and filtering the results to those whose translated name matches - /// . When the requested matches the document's default - /// locale the original name is used; otherwise the translated name is preferred and falls back to the original - /// when no translation exists. Returns the matching options ordered by name, or an empty list when the - /// document is not found, no option matches, or an error is logged. + /// Retrieves the options of a master list document identified by , filtering those whose resolved name equals using the supplied . + /// The aggregation resolves each option's name by preferring the translation for from the locale-specific items, falling back to the original name when no translation is present, and always using the original name when matches the document's default locale. + /// Matching options are returned ordered by name; an empty list is returned when the document is not found, no option matches, or an error is logged. /// - /// The of the master list document to query. - /// The option name to match against the locale-resolved name of each option. - /// The value used to select the translated name for each option. - /// A containing a of matching options ordered by name, or an empty list when no options match or an error occurs. + /// The of the master list document to match. + /// The option name to filter by after locale resolution. + /// The locale used to select the translated name field. + /// A containing a of matching options ordered by name, or an empty list when no matches are found or an error is logged. /// - /// private async Task> GetMasterListByIdAndTextSearch( ObjectId id, string newOptName, LocaleEnum locale) { diff --git a/adas-core.LdapLogin/LdapLoginService.cs b/adas-core.LdapLogin/LdapLoginService.cs index 0d5b24ff..08143b5c 100644 --- a/adas-core.LdapLogin/LdapLoginService.cs +++ b/adas-core.LdapLogin/LdapLoginService.cs @@ -167,15 +167,13 @@ public class LdapLoginService : ILoginService => throw new LoginServicesException("Not implemented"); /// - /// Authenticates a user with the provided and . + /// Authenticates a user with the specified and credentials. /// - /// The username of the user attempting to authenticate. - /// The password of the user attempting to authenticate. - /// A that represents the asynchronous authentication operation, yielding the authenticated on success. - /// Thrown because the authentication operation is not yet implemented. + /// The username of the user to authenticate. + /// The password of the user to authenticate. + /// A that resolves to the authenticated . + /// Thrown when the method is invoked, as authentication is not implemented. /// - /// public Task Authenticate(string username, string password) => throw new LoginServicesException("Not implemented"); @@ -190,14 +188,13 @@ public class LdapLoginService : ILoginService => throw new LoginServicesException("Not implemented"); /// - /// Retrieves a matching the supplied email address, or when no user is found. + /// Retrieves a identified by the supplied email address. + /// The method is not implemented and always throws a . /// - /// The email address used to look up the . - /// A that resolves to the matching , or if no user exists for the given . - /// Thrown because the operation is not implemented. + /// The email address used to look up the user. + /// A task that resolves to the matching , or null if no user is found with the given email. + /// Thrown because the method is not implemented. /// - /// public Task GetByEmail(string email) => throw new LoginServicesException("Not implemented");