From 052918f601f9a356271f9f90ce11bce275a50764 Mon Sep 17 00:00:00 2001 From: n8n IEC 62304 Bot Date: Sun, 28 Jun 2026 22:59:38 +0200 Subject: [PATCH] docs: apply curated AI doc review updates for 1.0.2 Documentation branch: docs/rc-1.0.2 Technical branch: release/rc-1.0.2 Scope: - Technical changed files: 13 - Technical changed C# files: 2 - Curated review markers: 33 - Kept review markers before apply: 32 - Removed false positives during curation: 1 Applied review files: - adas-core.Infrastructure/Repositories/MasterListRepository.cs Generated by n8n IEC 62304 documentation workflow. --- .n8n-docs-rc-flow/state.json | 7 ++ .../Repositories/MasterListRepository.cs | 75 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 .n8n-docs-rc-flow/state.json diff --git a/.n8n-docs-rc-flow/state.json b/.n8n-docs-rc-flow/state.json new file mode 100644 index 00000000..dfd427c6 --- /dev/null +++ b/.n8n-docs-rc-flow/state.json @@ -0,0 +1,7 @@ +{ + "ok": false, + "flow": "A_prepare_documentation_release", + "stage": "apply_reviews_commit_push", + "error": "[Errno 2] No such file or directory: '/repos/adas/.n8n-docs-rc-flow/state.json'", + "traceback": "Traceback (most recent call last):\n File \"\", line 54, in \n File \"/usr/lib/python3.12/pathlib.py\", line 1027, in read_text\n with self.open(mode='r', encoding=encoding, errors=errors) as f:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/pathlib.py\", line 1013, in open\n return io.open(self, mode, buffering, encoding, errors, newline)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: '/repos/adas/.n8n-docs-rc-flow/state.json'\n" +} \ No newline at end of file diff --git a/adas-core.Infrastructure/Repositories/MasterListRepository.cs b/adas-core.Infrastructure/Repositories/MasterListRepository.cs index a16f76be..4c2522af 100644 --- a/adas-core.Infrastructure/Repositories/MasterListRepository.cs +++ b/adas-core.Infrastructure/Repositories/MasterListRepository.cs @@ -20,6 +20,7 @@ namespace adas_core.Infrastructure.Repositories; /// options lists, diagnoses, allergies, procedures, treatments, and other reference data. /// /// The type of MasterList entity to manage. +/// public class MasterListRepository : MongoRepository, IMasterListRepository where T : MasterList { private readonly ApiSettings _apiSettings; @@ -30,6 +31,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// API settings containing collection names configuration. /// The MongoDB database instance. /// Thrown when apiSettings is null. + /// public MasterListRepository(IOptions apiSettings, IMongoDatabase database) : base(database) { if (apiSettings == null) throw new ArgumentNullException(nameof(apiSettings)); @@ -41,6 +43,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// Maps different MasterList subtypes to their corresponding MongoDB collection names. /// /// The collection name for the current MasterList type. + /// public override string GetCollectionName() { return typeof(T) switch @@ -76,6 +79,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// The entity to insert. /// Throws and re-throws exceptions after logging. + /// public override async Task InsertOneAsync(T entity) { try @@ -94,6 +98,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// The ObjectId of the entity to delete. /// Throws and re-throws exceptions after logging. + /// public async Task Delete(ObjectId id) { try @@ -113,6 +118,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// The entity with updated values. /// Throws and re-throws exceptions after logging. + /// public async Task Update(T entity) { try @@ -133,6 +140,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The ObjectId of the master list. /// The OptionList with updated values. /// The updated OptionList if found; otherwise, null. + /// public async Task UpdateFullMasterListOption(ObjectId id, OptionList newOpt) { var filter = Builders.Filter.Where(o => o.Id == id && o.Options.Any(opt => opt.Id == newOpt.Id) @@ -166,6 +174,12 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The ObjectId of the entity to retrieve. /// The MasterList entity if found; otherwise, null. /// Logs errors and returns null on failure. + /// + /// + /// public async Task FindById(ObjectId id) { try @@ -197,6 +211,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The locale for translation. /// The OptionList with translated fields if found; otherwise, null. /// Logs errors and returns null on failure. + /// public async Task FindOptionItemById(ObjectId masterId, ObjectId optionId, LocaleEnum locale) { try @@ -342,6 +358,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The ObjectId of the option to retrieve. /// The OptionList if found; otherwise, null. /// Logs errors and returns null on failure. + /// public async Task FindOptionItemById(ObjectId masterId, ObjectId optionId) { try @@ -374,6 +392,10 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// Optional locale for translated option names. /// The MasterList entity with translated options if found; otherwise, null. /// Logs errors and returns null on failure. + /// + /// public async Task FindById(ObjectId id, LocaleEnum? locale) { try @@ -556,6 +578,12 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The name of the master list to retrieve. /// The MasterList entity if found; otherwise, null. /// Logs errors and returns null on failure. + /// + /// + /// public async Task FindByName(string name) { try @@ -584,6 +612,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The ObjectId of the master list. /// Optional text to search within options. /// A list of matching OptionList items. + /// public async Task> GetMasterListByIdAndTextSearchContaining(ObjectId id, string? textSearch) { return await GetOptionsByTextSearch(textSearch, id); @@ -594,6 +623,10 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// The pagination and filtering parameters. /// A fluent queryable for MasterList results. + /// + /// public IFindFluent GetPaginatedMasterList(PaginationFilter filter) { var filterBuilder = Builders.Filter; @@ -621,6 +654,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The pagination and filtering parameters. /// The ObjectId of the master list. /// A list of filtered OptionList items. + /// public async Task> GetPaginatedOptions(PaginationFilter filter, ObjectId listId) { //TODO: LOCALE @@ -646,6 +681,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The option element to add. /// The newly created OptionList if successful; otherwise, null if duplicate exists. /// Logs errors and returns null on failure. + /// public async Task AddOptionToMasterList(ObjectId id, FilterOptionListElement opt) { var exist = await GetMasterListByIdAndSearchOptions(id, opt); @@ -689,6 +726,12 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// An enumerable of all MasterList entities. /// Logs errors and returns empty list on failure. + /// + /// + /// public async Task> GetAll() { try @@ -708,6 +751,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// An enumerable of MasterListDto containing id, name, description, listType, and options count. /// Logs errors and returns empty list on failure. + /// public async Task> GetAllWithoutOptions() { try @@ -736,6 +781,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// The total count of entities. /// Logs errors and returns 0 on failure. + /// public async Task Count() { try @@ -758,6 +805,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// 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. + /// public async Task> GetMasterListByIdAndSearchOptions(ObjectId id, FilterOptionListElement? filters) { try @@ -973,6 +1022,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The locale for translation updates. /// The updated OptionList if successful; otherwise, null. /// Logs errors and returns null on failure. + /// public async Task UpdateMasterListOption(ObjectId id, OptionList newOpt, LocaleEnum locale) { // 1. Evitar duplicados @@ -1073,6 +1124,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The OptionList with updated values. /// The updated OptionList if successful; otherwise, null. /// Logs errors and returns null on failure. + /// public async Task UpdateMasterListOption(ObjectId id, OptionList newOpt) { var master = await FindById(id); @@ -1108,6 +1161,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The ObjectId of the master list. /// The ObjectId of the option to delete. /// True if the option was deleted; otherwise, false. + /// public async Task DeleteMasterListOption(ObjectId id, ObjectId deleteOptId) { // Define el filtro para encontrar el documento por su _id @@ -1132,6 +1186,10 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The UpdateMasterListDetailsDto with updated values. /// The updated UpdateMasterListDetailsDto if successful; otherwise, null. /// Logs errors and returns null on failure. + /// + /// public async Task UpdateOptionDetailsToMasterList(ObjectId id, UpdateMasterListDetailsDto opt) { @@ -1167,6 +1225,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The new name. /// True if the update was successful; otherwise, false. /// Logs errors and returns false on failure. + /// public async Task UpdateMasterListName(ObjectId id, string name) { var filter = Builders.Filter.And( @@ -1193,6 +1253,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The new description. /// True if the update was successful; otherwise, false. /// Logs errors and returns false on failure. + /// public async Task UpdateMasterListDescription(ObjectId id, string description) { var filter = Builders.Filter.And( @@ -1219,6 +1281,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The OptionList to remove. /// True if the option was removed; otherwise, false. /// Logs errors and returns false on failure. + /// public async Task RemoveMasterListOption(ObjectId id, OptionList oldOpt) { var filter = Builders.Filter.Eq("_id", id); @@ -1250,6 +1314,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// Creates necessary indexes for the MasterList collection. /// Currently creates text indexes for DiagnosisList on options.name, options.description, and options._id. /// + /// public override async Task CreateIndexes() { if (typeof(T) == typeof(DiagnosisList)) @@ -1275,6 +1341,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// Optional text to search within options. /// A list of matching OptionList items. + /// public async Task> GetMasterListByTextSearch(string? textSearch) { return await GetOptionsByTextSearch(textSearch); @@ -1287,6 +1354,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// Optional master list ObjectId to filter results. /// A list of matching OptionList items ordered by name. /// Logs errors and returns empty list on failure. + /// private async Task> GetOptionsByTextSearch(string? textSearch, ObjectId? id = null) { try @@ -1364,6 +1433,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// List of filter definitions to apply. /// Sort definition for the query results. /// A fluent queryable for T results. + /// private IFindFluent CreateFindFluent(List> filters, SortDefinition sort) { var combinedFilter = filters.Any() @@ -1379,6 +1449,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The default locale to exclude from translations. /// The option name to use as default translation. /// A Locale object with translations for all other locales. + /// private Locale GetNewItemLocale(LocaleEnum localeList, string opt) { var newLocale = new Locale(); @@ -1418,6 +1490,7 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// /// The input string to build the pattern from. /// A regex-compatible pattern string. + /// private static string BuildRegexPattern(string input) { var regexPattern = new StringBuilder(); @@ -1459,6 +1532,8 @@ public class MasterListRepository : MongoRepository, IMasterListRepository /// The locale for translation. /// A list of matching OptionList items ordered by name. /// Logs errors and returns empty list on failure. + /// private async Task> GetMasterListByIdAndTextSearch( ObjectId id, string newOptName, LocaleEnum locale) {