=== 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:
@@ -11,6 +11,7 @@ namespace adas_core.Infrastructure.Utils
|
||||
/// <summary>
|
||||
/// Provides extension methods for configuring or building cache host instances.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f280f01 -->
|
||||
public static class CacheHostBuilderExtension
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <remarks>
|
||||
/// This converter is designed to handle the serialization and deserialization logic specific to point of care entities, tailoring the behavior inherited from the <see cref="JsonConverter"/> base class.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=bdea055 -->
|
||||
public class CustomPointOfCareConverter : JsonConverter
|
||||
{
|
||||
/// <summary>
|
||||
@@ -17,6 +18,7 @@ public class CustomPointOfCareConverter : JsonConverter
|
||||
/// </summary>
|
||||
/// <param name="objectType">The type to evaluate for convertibility.</param>
|
||||
/// <returns><c>true</c> if <paramref name="objectType"/> equals <see cref="PointOfCare"/>; otherwise, <c>false</c>.</returns>
|
||||
/// <!-- aidoc:v1 sig=ee00023 body=8b20223 -->
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return objectType == typeof(PointOfCare);
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <summary>
|
||||
/// Provides extension methods for configuring MongoDB integration on a host builder.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c198c69 -->
|
||||
public static class MongoDbHostBuilderExtension
|
||||
{
|
||||
/// <summary>
|
||||
@@ -21,6 +22,7 @@ public static class MongoDbHostBuilderExtension
|
||||
/// </summary>
|
||||
/// <param name="hostBuilder">The host builder to extend with the MongoDB configuration.</param>
|
||||
/// <returns>The same <see cref="IHostBuilder"/> instance, allowing further fluent configuration.</returns>
|
||||
/// <!-- aidoc:v1 sig=e4bedf4 body=7ed0573 -->
|
||||
public static IHostBuilder UseMongo(this IHostBuilder hostBuilder)
|
||||
{
|
||||
ConfigureMongoDbConventions();
|
||||
@@ -34,6 +36,7 @@ public static class MongoDbHostBuilderExtension
|
||||
/// </summary>
|
||||
/// <param name="host">The host whose services are used to resolve the <see cref="IMongoDatabase"/> instance.</param>
|
||||
/// <returns>The same <see cref="IHost"/> instance, enabling fluent chaining.</returns>
|
||||
/// <!-- aidoc:v1 sig=c767d9c body=fff8138 -->
|
||||
public static IHost RunMongoMigrations(this IHost host)
|
||||
{
|
||||
using var scope = host.Services.CreateScope();
|
||||
@@ -63,6 +66,7 @@ public static class MongoDbHostBuilderExtension
|
||||
/// <returns>The configured <see cref="IMongoDatabase"/> instance.</returns>
|
||||
/// <exception cref="Exception">Thrown when the connection string or database name is null or empty.</exception>
|
||||
/// <exception cref="Exception">Thrown when the specified database does not exist.</exception>
|
||||
/// <!-- aidoc:v1 sig=302f4d6 body=0f9a4d3 -->
|
||||
private static IMongoDatabase ConfigureMongoDbConnection(IOptions<DatabaseSettings> dbSettings)
|
||||
{
|
||||
var connectionString = dbSettings.Value.ConnectionString;
|
||||
@@ -106,6 +110,7 @@ public static class MongoDbHostBuilderExtension
|
||||
/// Registers global MongoDB serialization conventions, including ignoring extra elements in BSON documents
|
||||
/// and using camelCase for element names, applied to all types in the application.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=470c959 body=7fdb696 -->
|
||||
public static void ConfigureMongoDbConventions()
|
||||
{
|
||||
var pack = new ConventionPack
|
||||
|
||||
@@ -13,11 +13,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// Represents a contributor that provides entity mapping configuration for Alarm entities.
|
||||
/// </summary>
|
||||
/// <remarks>Implements the <see cref="IEntityMapContributor"/> interface to participate in the entity mapping process.</remarks>
|
||||
/// <!-- aidoc:v1 sig=2e84ec1 -->
|
||||
public class AlarmMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for alarm-related domain types (including alarm configuration, audio, alarm items, patient observation alarms, inactivation states, sources, recording alerts, and performance), configuring enum serialization as strings, null-ignore behavior for optional members, default values where applicable, and unmapping members that should not be persisted. Registration is performed only when a class map for the type is not already registered, ensuring idempotent behavior.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=6fc7014 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(AlarmConfig)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Represents a contributor that provides entity mapping configuration for the <see cref="PatientAppointment"/> type as part of the mapping framework.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=bbe580f -->
|
||||
public class AppointmentMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the <see cref="PatientAppointment"/>, <see cref="PatientAppointmentResourceGroup"/>, and <see cref="Allergies"/> types, customizing the MongoDB serialization for their members. Registration is performed only if a class map for the type has not already been registered, making the call safe to invoke multiple times. Optional members are configured to be ignored when null, enum members are serialized as nullable string enums, and certain computed/action members are unmapped or assigned default collection values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=04cfbed -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(PatientAppointment)))
|
||||
|
||||
@@ -7,11 +7,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Represents an entity map contributor that provides authentication-related mapping logic.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=fe4f97f -->
|
||||
public class AuthMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the <see cref="User"/> and <see cref="Authorization"/> types when no class map has been registered yet, configuring field serialization rules such as ignoring null or empty values, mapping the identifier to the "_id" element name, and unmapping navigation properties not intended for persistence.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=c4e3897 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(User)))
|
||||
|
||||
@@ -13,11 +13,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Used as a contributor that participates in entity map configuration for banner-related data.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=143f37c -->
|
||||
public class BannerConfigMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for banner-related configuration types, including <see cref="BannerItem"/>, <see cref="BannerItemConfig"/>, <see cref="BannerItemTableConfig"/>, and <see cref="HeaderBannerItemTableConfig"/>. Each map is only registered when no existing registration is found, and applies custom serialization (enum values stored as strings), null-ignoring behavior for optional members, and default values where appropriate.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=2d4b26f -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(BannerItem)))
|
||||
|
||||
@@ -14,11 +14,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// Implements the <see cref="IEntityMapContributor"/> interface to contribute
|
||||
/// beacon-specific mapping logic.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=9538dbe -->
|
||||
public class BeaconMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for <see cref="LightBeacon"/>, <see cref="Options"/>, and <see cref="LightBeaconAbstract"/> types to configure their MongoDB serialization. Each registration is skipped if a class map for the type has already been registered, applying default values, element name mappings, and ignore-if-null settings to the respective members.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=b1eeb38 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(LightBeacon)))
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Provides configuration mapping contributions for box entities, implementing the <see cref="IEntityMapContributor"/> interface to participate in entity map setup.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1b5af6b -->
|
||||
public class BoxConfigMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -11,11 +11,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Implements the <see cref="IEntityMapContributor"/> interface to provide camera-specific mapping behavior within the entity mapping pipeline.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=fb656c1 -->
|
||||
public class CameraContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the <see cref="Camera"/> and <see cref="Domain.Models.MongoModels.Stream"/> types with MongoDB, applying custom mapping conventions such as element name overrides, default values, and ignore-if-null behavior. Registration is performed only once; the method guards against duplicate registration by checking <see cref="BsonClassMap.IsClassMapRegistered(Type)"/> before registering.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=6ea6233 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Camera)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Provides card-specific mapping contributions by implementing the <see cref="IEntityMapContributor"/> contract within the entity mapping pipeline.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b8c7213 -->
|
||||
public class CardMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the layout and configuration types used by the display configuration domain, including <see cref="SectionBoxLayout"/>, <see cref="CardDetailsConfig"/>, <see cref="CardRotatingLayout"/>, <see cref="Step"/>, and <see cref="HomeConfig"/>. Each map is only registered when no existing map is present, and the configuration establishes default values, enum-as-string serialization, and ignore-if-null behavior for nullable layout properties.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=75cdc8f -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(SectionBoxLayout)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Represents a contributor that participates in populating a cell-based map by implementing the entity map contribution contract.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=23355bf -->
|
||||
public class CellMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for <see cref="Cell"/>, <see cref="CellDetails"/>, <see cref="IconValueList"/>, <see cref="DialogConfig"/>, and <see cref="MedicalConfig"/> when they have not already been registered. Each registration configures default values, ignore-if-null behavior, and enum serialization for the corresponding type's members to control how instances are persisted in MongoDB.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=13b6118 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Cell)))
|
||||
|
||||
@@ -12,11 +12,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// Used as a pluggable component within the entity mapping pipeline to apply
|
||||
/// color-related configuration to mapped entities.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=1f5bb8d -->
|
||||
public class ColorConfigMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the <see cref="ColorConfig"/> type and its nested configuration types, providing default color and appearance values for properties such as levels, text, arrows, indicators, graphs, status boxes, therapy, tests, and procedures. Each class map is registered only if it has not already been registered, ensuring idempotent initialization of the MongoDB serialization mappings used by the color configuration system.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=c066e37 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(ColorConfig)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Represents a map contributor that provides mapping configuration for communication flow entities by implementing the <see cref="IEntityMapContributor"/> interface.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e2ee262 -->
|
||||
public class ComunicationFlowMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the application's MongoDB-serialized types, including <see cref="Message"/>, <see cref="Queue"/>, <see cref="ApiRequest"/>, <see cref="AdmPanelRequest"/>, <see cref="ApiClients"/>, and <see cref="VideoDto"/>, applying custom mapping rules such as unmapping the <c>Operation</c> member on <see cref="Message"/> and ignoring null values for <c>ObsertationData</c> on <see cref="AdmPanelRequest"/>. Each type is only registered if a class map has not already been registered, preventing duplicate registration.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=f163d5b -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Message)))
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// Represents a contributor that provides device-related mapping logic for entities.
|
||||
/// Implements the <see cref="IEntityMapContributor"/> interface to participate in the entity mapping process.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=46a00cb -->
|
||||
public class DeviceMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,6 +21,7 @@ public class DeviceMapContributor : IEntityMapContributor
|
||||
/// <remarks>
|
||||
/// Each map is only registered if no class map is already registered for the type. The registration applies auto-mapping and customizes serialization for enum members (stored as strings), applies default values for required properties, and configures nullable members to be ignored when null.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=3f2c953 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(DeviceActionType)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Represents a contributor that supplies entity map configuration related to display home functionality.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c0118a2 -->
|
||||
public class DisplayHomeConfigContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for <see cref="CardConfig"/> and <see cref="RowCardConfig"/> types if they are not already registered, configuring MongoDB serialization with custom element names, default values, null-ignore behavior, and string-based enum serialization.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=ede7ae5 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(CardConfig)))
|
||||
|
||||
@@ -14,12 +14,14 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Implements the <see cref="IEntityMapContributor"/> interface to participate in the entity mapping pipeline for display scenarios.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=82df8a4 -->
|
||||
public class DisplayMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for display-related types (Display, DisplayNurse, StandarDisplay, SmartDisplay, PumpDisplay, DisplayConfig, and GroupedField) used for MongoDB serialization.
|
||||
/// </summary>
|
||||
/// <remarks>Configures polymorphic deserialization for DisplayConfig by declaring its known subtypes, sets custom element names for identifiers, applies default values for enum and collection members, omits null or unmapped properties, and uses string-based enum serialization where applicable. Each registration is guarded so it only occurs when the corresponding class map has not already been registered.</remarks>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=de9db08 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Display)))
|
||||
|
||||
@@ -8,11 +8,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// Represents a contributor responsible for providing form-related mapping logic for entities.
|
||||
/// Implements the <see cref="IEntityMapContributor"/> interface to participate in the entity mapping process.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=307c91c -->
|
||||
public class FormMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for <see cref="FormConfig"/> and <see cref="FormItemOverview"/> types used during MongoDB serialization, configuring default values and conditional serialization rules for their members. Each class map is only registered if it has not already been registered, preventing duplicate registrations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=46140e0 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(FormConfig)))
|
||||
|
||||
@@ -13,11 +13,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Implements the <see cref="IEntityMapContributor"/> contract to participate in entity map configuration within a graph structure.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=014c988 -->
|
||||
public class GraphMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the application's chart, graph, and legend configuration types, configuring serialization behavior such as default values, null-ignoring, and enum string serialization. Each registration is guarded by an <see cref="BsonClassMap.IsClassMapRegistered"/> check so the method is idempotent and can be safely called multiple times.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=f960e13 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(GraphLayout)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Implements the <see cref="IEntityMapContributor"/> interface to contribute mapping behavior within the entity mapping pipeline.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=35165d0 -->
|
||||
public class HeaderMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the <see cref="HeaderConfig"/> type and its nested <see cref="HeaderConfig.HeaderItem"/> type with the MongoDB BsonClassMap serializer, configuring default values and null-ignore behavior for their members. Registration is performed only if a class map for the corresponding type has not already been registered, preventing duplicate registrations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=8e9a2db -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(HeaderConfig)))
|
||||
|
||||
@@ -8,5 +8,6 @@ public interface IEntityMapContributor
|
||||
/// <summary>
|
||||
/// Registers the object-to-object mappings used by the application.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7010724 -->
|
||||
void RegisterMaps();
|
||||
}
|
||||
@@ -13,11 +13,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Use this contributor when defining or extending the mapping configuration associated with master list entities.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=267a909 -->
|
||||
public class MasterListMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for domain types (such as <see cref="Element"/>, <see cref="OptionList"/>, <see cref="MasterList"/>, <see cref="Locale"/>, and their derived option lists) to control their MongoDB serialization. Each registration is performed only when no class map already exists for the type, and applies domain-specific settings including default values, null-ignore rules, discriminator naming, and custom serializers for enums, locale fields, and identifiers.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=2ab86d2 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Element)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Implements the <see cref="IEntityMapContributor"/> interface to participate in the entity mapping process.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=8f137ce -->
|
||||
public class NoticeControlMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the <see cref="Notice"/>, <see cref="StaffInfo"/>, and <see cref="MedicalStaffConfig"/> types if they have not already been registered, configuring element names, automatic mapping, and null-ignore behavior where applicable.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=396c412 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Notice)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Used to register or supply mapping logic specific to observation unit entities within the entity mapping framework.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=d230120 -->
|
||||
public class ObsUnitMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for <see cref="ConfigUnits"/> and <see cref="ConfigUnitItem"/> types if they have not already been registered, configuring how their members are serialized to MongoDB documents.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=1889b71 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(ConfigUnits)))
|
||||
|
||||
@@ -17,11 +17,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Implements the <see cref="IEntityMapContributor"/> interface to participate in the entity mapping process.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=523871d -->
|
||||
public class ObservationMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the observation-related domain types used by the application. Each registration is guarded by an <see cref="BsonClassMap.IsClassMapRegistered"/> check so the method is safe to invoke multiple times, configuring element names, ignoring null members, unmapping non-persisted members, and supplying custom enum and complex-object serializers where required.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=8d212dc -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(BasePatientObservation)))
|
||||
|
||||
@@ -12,11 +12,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Represents a contributor that participates in the mapping configuration of the <see cref="Patient"/> entity by implementing the <see cref="IEntityMapContributor"/> interface.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=8b04747 -->
|
||||
public class PatientMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for the domain model types (Patient, Person, PatientLocation, and related entities) to configure their MongoDB serialization, including auto-mapping, null-value handling, enum string serialization, dictionary serialization, and ID member mapping. Skips registration for types that already have a registered class map.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=641507d -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(HistoricalLocation)))
|
||||
|
||||
@@ -15,11 +15,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// This class serves as a demonstrative or experimental implementation of entity map contribution behavior, intended to validate the contract defined by <see cref="IEntityMapContributor"/>.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=83c8bce -->
|
||||
public class PoCMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for PointOfCare-related types (PointOfCare, PointOfCareConfiguration, PoCMapping, PoCMappingItem, and PoCSettings) with the MongoDB driver, configuring serialization options such as element names, default values, null handling, and enum string serialization. Each registration is performed only if a class map for the type has not already been registered.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=61fe9cc -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(PointOfCare)))
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace adas_core.Infrastructure.Utils.MongoMaps
|
||||
/// <summary>
|
||||
/// Represents a contributor that provides mapping logic for pump-related entities within an entity mapping context.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6c4bb57 -->
|
||||
public class PumpMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -11,11 +11,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// Provides an entity map contributor that relays or forwards mapping contributions from an underlying source.
|
||||
/// Implements the <see cref="IEntityMapContributor"/> contract to participate in entity mapping workflows.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f4d7c5f -->
|
||||
public class RelayContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers the BSON class map for the <see cref="Relay"/> type, defining how its properties are serialized and stored in MongoDB. The registration is performed only when no class map is already registered for the type, and it configures default values, string-based enum serialization, and null-ignoring behavior for optional members.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=ef76204 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Relay)))
|
||||
|
||||
@@ -10,11 +10,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Provides row-level mapping contributions to the entity mapping process by implementing the IEntityMapContributor interface.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=dd4ceaa -->
|
||||
public class RowMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for <see cref="RowBoxLayout"/>, <see cref="RowDetailsConfig"/>, and <see cref="ObservationRowBoxLayout"/>, configuring default values, enum string serialization, and null-ignoring behavior for nullable members. Each map is registered only if no class map has already been registered for the corresponding type.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=c469476 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(RowBoxLayout)))
|
||||
|
||||
@@ -11,11 +11,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Represents a contributor that participates in section-based entity mapping by implementing the <see cref="IEntityMapContributor"/> interface.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=aa1d4dc -->
|
||||
public class SectionMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers the BSON class maps for the <see cref="Section"/>, <see cref="Section.SectionItem"/>, <see cref="SectionConfig"/>, and <see cref="MinimalDisplaySection"/> types, configuring their MongoDB serialization behavior such as required fields, default values, null-ignoring members, and custom serializers. Each class map is registered only if it has not already been registered, preventing duplicate registrations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=affbd84 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Section)))
|
||||
|
||||
@@ -7,11 +7,13 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Represents an entity map contributor that provides mapping configuration for service configuration entities.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=519c23e -->
|
||||
public class ServiceConfigMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers BSON class maps for service configuration-related types, including <see cref="ServiceConfig"/>, <see cref="ServiceConfigService"/>, <see cref="ServiceConfigServiceSection"/>, <see cref="ServiceConfigTheme"/>, and <see cref="ServiceConfigThemeTimetable"/>, configuring their serialization elements, default values, and null-ignoring behavior. Each registration is guarded by a check that ensures the map is only registered if it has not been registered previously.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=1ad65b5 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(ServiceConfig)))
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <summary>
|
||||
/// Provides a standard implementation of the <see cref="IEntityMapContributor"/> interface.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=70505b3 -->
|
||||
public class StandardMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
@@ -15,6 +16,7 @@ public class StandardMapContributor : IEntityMapContributor
|
||||
/// <see cref="UiFontData"/>, several nullable UI configuration members are configured to be ignored
|
||||
/// when null to avoid persisting default values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=af00a54 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(HistoricalConfigChanges)))
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class is intended to be used as a mapping contributor within an entity mapping pipeline, providing configuration logic specific to treatment entities.</remarks>
|
||||
/// <!-- aidoc:v1 sig=a2b6bde -->
|
||||
public class TreatmentMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
@@ -23,6 +24,7 @@ public class TreatmentMapContributor : IEntityMapContributor
|
||||
/// define custom element names, default values, null-ignoring behavior, and specialized
|
||||
/// serializers for object identifiers and enum values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=1238a51 -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(PatientTreatment)))
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace adas_core.Infrastructure.Utils.MongoMaps;
|
||||
/// <remarks>
|
||||
/// Implements <see cref="IEntityMapContributor"/> to integrate unit-specific mapping logic into the entity mapping pipeline.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=a1e9636 -->
|
||||
public class UnitMapContributor : IEntityMapContributor
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,6 +21,7 @@ public class UnitMapContributor : IEntityMapContributor
|
||||
/// Each registration is performed only if no class map has been previously registered for the target type, and configures
|
||||
/// field-level mappings, default values, ignored properties, and custom serializers as required by the domain model.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d4dea7a body=13d9ecf -->
|
||||
public void RegisterMaps()
|
||||
{
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Unit)))
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <summary>
|
||||
/// Provides utility methods for interacting with MongoDB.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b90fd42 -->
|
||||
public class MongoUtils
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <remarks>
|
||||
/// Implements <see cref="IBsonSerializer"/> to provide BSON serialization and deserialization support for <see cref="PatientObservationAlarm"/> objects.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=a512928 -->
|
||||
public class PatientObservationAlarmConverter : JsonConverter<PatientObservationAlarm>, IBsonSerializer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -22,6 +23,7 @@ public class PatientObservationAlarmConverter : JsonConverter<PatientObservation
|
||||
/// <param name="args">The deserialization arguments that influence how the value is read and converted.</param>
|
||||
/// <returns>The deserialized .NET object produced from the BSON input.</returns>
|
||||
/// <exception cref="NotImplementedException">Always thrown because the deserialization logic has not been implemented yet.</exception>
|
||||
/// <!-- aidoc:v1 sig=2a74dda body=bfa6f2f -->
|
||||
public object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -34,6 +36,7 @@ public class PatientObservationAlarmConverter : JsonConverter<PatientObservation
|
||||
/// <param name="args">The BSON serialization arguments containing additional information that influences the serialization behavior.</param>
|
||||
/// <param name="value">The object to be serialized into BSON.</param>
|
||||
/// <exception cref="System.NotImplementedException">Thrown because the method has not yet been implemented.</exception>
|
||||
/// <!-- aidoc:v1 sig=bd1484e body=bfa6f2f -->
|
||||
public void Serialize(BsonSerializationContext context, BsonSerializationArgs args, object value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -50,6 +53,7 @@ public class PatientObservationAlarmConverter : JsonConverter<PatientObservation
|
||||
/// <param name="hasExistingValue">Indicates whether <paramref name="existingValue"/> contains a value to be used during deserialization.</param>
|
||||
/// <param name="serializer">The <see cref="JsonSerializer"/> used for nested object deserialization.</param>
|
||||
/// <returns>A <see cref="PatientObservationAlarm"/> populated from the JSON, or <c>null</c> if the JSON token is <see cref="JsonToken.Null"/>.</returns>
|
||||
/// <!-- aidoc:v1 sig=db7e773 body=9079bf3 -->
|
||||
public override PatientObservationAlarm? ReadJson(JsonReader reader, Type objectType,
|
||||
PatientObservationAlarm? existingValue,
|
||||
bool hasExistingValue, JsonSerializer serializer)
|
||||
@@ -77,6 +81,7 @@ public class PatientObservationAlarmConverter : JsonConverter<PatientObservation
|
||||
/// <param name="writer">The <see cref="JsonWriter"/> to which the JSON output is written.</param>
|
||||
/// <param name="value">The object to serialize; if <see langword="null"/>, the method performs no action.</param>
|
||||
/// <param name="serializer">The <see cref="JsonSerializer"/> used to assist with the conversion.</param>
|
||||
/// <!-- aidoc:v1 sig=9ef717f body=5f30748 -->
|
||||
public new void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
|
||||
{
|
||||
if (value != null)
|
||||
@@ -100,6 +105,7 @@ public class PatientObservationAlarmConverter : JsonConverter<PatientObservation
|
||||
/// </summary>
|
||||
/// <param name="value">The object instance whose type is inspected to locate the target property.</param>
|
||||
/// <param name="propertyName">The name of the property to which the <see cref="StringEnumConverter"/> attribute will be added.</param>
|
||||
/// <!-- aidoc:v1 sig=02b15d7 body=a196735 -->
|
||||
private static void AddStringEnumConverterAttribute(object value, string propertyName)
|
||||
{
|
||||
var prop = value.GetType().GetProperty(propertyName);
|
||||
@@ -132,6 +138,7 @@ public class PatientObservationAlarmConverter : JsonConverter<PatientObservation
|
||||
/// <param name="value">The PatientObservationAlarm value to serialize.</param>
|
||||
/// <param name="serializer">The JsonSerializer used during the serialization process.</param>
|
||||
/// <exception cref="NotImplementedException">The method has not been implemented.</exception>
|
||||
/// <!-- aidoc:v1 sig=1687013 body=bfa6f2f -->
|
||||
public override void WriteJson(JsonWriter writer, PatientObservationAlarm? value, JsonSerializer serializer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <remarks>
|
||||
/// The optional <see cref="Type"/> constructor parameter specifies the target value type used during conversion.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=b25ac53 -->
|
||||
public class PatientObservationConverter(Type? valueType) : JsonConverter<PatientObservation>, IBsonSerializer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -22,6 +23,8 @@ public class PatientObservationConverter(Type? valueType) : JsonConverter<Patien
|
||||
/// <param name="args">The deserialization arguments containing additional information for the operation.</param>
|
||||
/// <returns>An object representing the deserialized value.</returns>
|
||||
/// <exception cref="NotImplementedException">Always thrown because the method is not yet implemented.</exception>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=stale_summary
|
||||
/// "Summary states the method 'Deserializes a BSON value', but the implementation only throws NotImplementedException and does not perform any deserialization." -->
|
||||
public object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -34,6 +37,7 @@ public class PatientObservationConverter(Type? valueType) : JsonConverter<Patien
|
||||
/// <param name="args">The BSON serialization arguments containing additional information that may influence the serialization process.</param>
|
||||
/// <param name="value">The object to be serialized into BSON.</param>
|
||||
/// <exception cref="NotImplementedException">Thrown because the serialization logic has not been implemented.</exception>
|
||||
/// <!-- aidoc:v1 sig=bd1484e body=bfa6f2f -->
|
||||
public void Serialize(BsonSerializationContext context, BsonSerializationArgs args, object value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -47,6 +51,7 @@ public class PatientObservationConverter(Type? valueType) : JsonConverter<Patien
|
||||
/// <param name="writer">The JSON writer that receives the serialized output.</param>
|
||||
/// <param name="value">The patient observation to serialize. When <c>null</c>, the method performs no serialization.</param>
|
||||
/// <param name="serializer">The JSON serializer used during the conversion process.</param>
|
||||
/// <!-- aidoc:v1 sig=272998e body=b3fc129 -->
|
||||
public override void WriteJson(JsonWriter writer, PatientObservation? value, JsonSerializer serializer)
|
||||
{
|
||||
if (value != null)
|
||||
@@ -66,6 +71,7 @@ public class PatientObservationConverter(Type? valueType) : JsonConverter<Patien
|
||||
/// </summary>
|
||||
/// <param name="value">The object instance whose property should be annotated.</param>
|
||||
/// <param name="propertyName">The name of the property to which the StringEnumConverter attribute should be added.</param>
|
||||
/// <!-- aidoc:v1 sig=02b15d7 body=a196735 -->
|
||||
private static void AddStringEnumConverterAttribute(object value, string propertyName)
|
||||
{
|
||||
var prop = value.GetType().GetProperty(propertyName);
|
||||
@@ -101,6 +107,7 @@ public class PatientObservationConverter(Type? valueType) : JsonConverter<Patien
|
||||
/// <param name="serializer">The <see cref="JsonSerializer"/> used to read nested values.</param>
|
||||
/// <returns>A <see cref="PatientObservation"/> instance produced from the JSON.</returns>
|
||||
/// <exception cref="NotImplementedException">Thrown because the method has not been implemented yet.</exception>
|
||||
/// <!-- aidoc:v1 sig=d5b4252 body=bfa6f2f -->
|
||||
public override PatientObservation ReadJson(JsonReader reader, Type objectType, PatientObservation? existingValue,
|
||||
bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <summary>
|
||||
/// Provides JSON conversion for <see cref="PumpObservation"/> instances and supports BSON serialization through the <see cref="IBsonSerializer"/> interface.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=8967a45 -->
|
||||
public class PatientPumpObservationConverter : JsonConverter<PumpObservation>, IBsonSerializer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -21,6 +22,7 @@ public class PatientPumpObservationConverter : JsonConverter<PumpObservation>, I
|
||||
/// <param name="args">The deserialization arguments containing additional settings for the operation.</param>
|
||||
/// <returns>The deserialized object.</returns>
|
||||
/// <exception cref="NotImplementedException">Thrown when the method is invoked, as the deserialization logic has not been implemented.</exception>
|
||||
/// <!-- aidoc:v1 sig=2a74dda body=bfa6f2f -->
|
||||
public object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -34,6 +36,7 @@ public class PatientPumpObservationConverter : JsonConverter<PumpObservation>, I
|
||||
/// <param name="args">The BSON serialization arguments that influence the serialization behavior.</param>
|
||||
/// <param name="value">The object to be serialized into BSON.</param>
|
||||
/// <exception cref="NotImplementedException">Thrown because the method has not been implemented.</exception>
|
||||
/// <!-- aidoc:v1 sig=bd1484e body=bfa6f2f -->
|
||||
public void Serialize(BsonSerializationContext context, BsonSerializationArgs args, object value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -52,6 +55,7 @@ public class PatientPumpObservationConverter : JsonConverter<PumpObservation>, I
|
||||
/// <param name="serializer">The <see cref="JsonSerializer"/> used for deserialization.</param>
|
||||
/// <returns>A <see cref="PumpObservation"/> instance reconstructed from the JSON data.</returns>
|
||||
/// <exception cref="NotImplementedException">Thrown because the method has not been implemented yet.</exception>
|
||||
/// <!-- aidoc:v1 sig=5a89314 body=bfa6f2f -->
|
||||
public override PumpObservation ReadJson(JsonReader reader, Type objectType,
|
||||
PumpObservation? existingValue,
|
||||
bool hasExistingValue, JsonSerializer serializer)
|
||||
@@ -65,6 +69,8 @@ public class PatientPumpObservationConverter : JsonConverter<PumpObservation>, I
|
||||
/// <param name="writer">The JSON writer to which the serialized object is written.</param>
|
||||
/// <param name="value">The object to serialize; if null, the method does nothing.</param>
|
||||
/// <param name="serializer">The JSON serializer used as context for the conversion.</param>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=wrong_param_role
|
||||
/// "The 'serializer' parameter is documented as 'The JSON serializer used as context for the conversion', but it is never referenced anywhere in the method body (the JSON is written via JObject.FromObject and jo.WriteTo, neither of which uses this argument)." -->
|
||||
public new void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
|
||||
{
|
||||
if (value != null)
|
||||
@@ -89,6 +95,7 @@ public class PatientPumpObservationConverter : JsonConverter<PumpObservation>, I
|
||||
/// <param name="value">The <see cref="PumpObservation"/> to serialize, or <see langword="null"/> if no value is available.</param>
|
||||
/// <param name="serializer">The <see cref="JsonSerializer"/> providing serialization context and options.</param>
|
||||
/// <exception cref="NotImplementedException">Always thrown because the method has not been implemented.</exception>
|
||||
/// <!-- aidoc:v1 sig=6f585c5 body=bfa6f2f -->
|
||||
public override void WriteJson(JsonWriter writer, PumpObservation? value, JsonSerializer serializer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -99,6 +106,7 @@ public class PatientPumpObservationConverter : JsonConverter<PumpObservation>, I
|
||||
/// </summary>
|
||||
/// <param name="value">The object instance whose property will be inspected for the attribute.</param>
|
||||
/// <param name="propertyName">The name of the property to which the converter attribute will be added.</param>
|
||||
/// <!-- aidoc:v1 sig=02b15d7 body=a196735 -->
|
||||
private static void AddStringEnumConverterAttribute(object value, string propertyName)
|
||||
{
|
||||
var prop = value.GetType().GetProperty(propertyName);
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <remarks>
|
||||
/// The primary constructor accepts a <see cref="Type"/> that represents the value type associated with this converter.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=b735b04 -->
|
||||
public class PersonConverter(Type valueType) : JsonConverter<Person>, IBsonSerializer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -22,6 +23,7 @@ public class PersonConverter(Type valueType) : JsonConverter<Person>, IBsonSeria
|
||||
/// <param name="args">The BSON deserialization arguments.</param>
|
||||
/// <returns>The deserialized object.</returns>
|
||||
/// <exception cref="NotImplementedException">Always thrown because the method is not yet implemented.</exception>
|
||||
/// <!-- aidoc:v1 sig=2a74dda body=bfa6f2f -->
|
||||
public object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -34,6 +36,7 @@ public class PersonConverter(Type valueType) : JsonConverter<Person>, IBsonSeria
|
||||
/// <param name="args">The BSON serialization arguments containing additional settings for the serialization.</param>
|
||||
/// <param name="value">The object to be serialized to BSON.</param>
|
||||
/// <exception cref="NotImplementedException">Always thrown because the method has not been implemented yet.</exception>
|
||||
/// <!-- aidoc:v1 sig=bd1484e body=bfa6f2f -->
|
||||
public void Serialize(BsonSerializationContext context, BsonSerializationArgs args, object value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -47,6 +50,8 @@ public class PersonConverter(Type valueType) : JsonConverter<Person>, IBsonSeria
|
||||
/// <param name="writer">The <see cref="JsonWriter"/> to which the JSON representation is written.</param>
|
||||
/// <param name="value">The <see cref="Person"/> instance to serialize. If <see langword="null"/>, the method returns without writing anything.</param>
|
||||
/// <param name="serializer">The <see cref="JsonSerializer"/> used during the conversion to a <see cref="JObject"/>.</param>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=wrong_param_role
|
||||
/// "The documentation states the `serializer` parameter is 'used during the conversion to a JObject', but `JObject.FromObject(value)` is invoked without passing `serializer`, so the parameter is unused in the method body." -->
|
||||
public override void WriteJson(JsonWriter writer, Person? value, JsonSerializer serializer)
|
||||
{
|
||||
if (value == null) return;
|
||||
@@ -64,6 +69,7 @@ public class PersonConverter(Type valueType) : JsonConverter<Person>, IBsonSeria
|
||||
/// </summary>
|
||||
/// <param name="value">The object instance whose property's attributes will be inspected and modified.</param>
|
||||
/// <param name="propertyName">The name of the property to which the converter attribute will be added.</param>
|
||||
/// <!-- aidoc:v1 sig=02b15d7 body=f8f9f45 -->
|
||||
private static void AddStringEnumConverterAttribute(object value, string propertyName)
|
||||
{
|
||||
var prop = value.GetType().GetProperty(propertyName);
|
||||
@@ -96,6 +102,7 @@ public class PersonConverter(Type valueType) : JsonConverter<Person>, IBsonSeria
|
||||
/// <param name="serializer">The <see cref="JsonSerializer"/> calling the method.</param>
|
||||
/// <returns>A <see cref="Person"/> instance deserialized from the JSON.</returns>
|
||||
/// <exception cref="NotImplementedException">Always thrown because the method has not been implemented.</exception>
|
||||
/// <!-- aidoc:v1 sig=e413d58 body=bfa6f2f -->
|
||||
public override Person ReadJson(JsonReader reader, Type objectType, Person? existingValue, bool hasExistingValue,
|
||||
JsonSerializer serializer)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <summary>
|
||||
/// Handles errors that occur during RabbitMQ message consumption and publishes them using the configured publisher service.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=5b1d5b6 -->
|
||||
public class RabbitConsumerErrorHandler(IPublisherService publisherService)
|
||||
{
|
||||
private const int MaxRetries = 2;
|
||||
@@ -24,6 +25,7 @@ public class RabbitConsumerErrorHandler(IPublisherService publisherService)
|
||||
/// <param name="message">The deserialized message whose body is inspected or re-serialized for retry handling.</param>
|
||||
/// <param name="receivedInfo">Information about the message receipt, passed to the retry handler.</param>
|
||||
/// <param name="next">The asynchronous delegate representing the next step in the processing pipeline.</param>
|
||||
/// <!-- aidoc:v1 sig=f916bf0 body=5a18c25 -->
|
||||
public async Task HandleAsync<T>(
|
||||
Message<T> message,
|
||||
MessageReceivedInfo receivedInfo,
|
||||
@@ -127,6 +129,7 @@ public class RabbitConsumerErrorHandler(IPublisherService publisherService)
|
||||
/// </summary>
|
||||
/// <param name="properties">The message properties whose headers are inspected for the "retries" entry.</param>
|
||||
/// <returns>The number of retries parsed from the "retries" header, or 0 if the header is absent or not a byte array.</returns>
|
||||
/// <!-- aidoc:v1 sig=d7573fc body=b1a585f -->
|
||||
private int GetRetries(MessageProperties properties)
|
||||
{
|
||||
if (properties.Headers != null &&
|
||||
@@ -148,6 +151,7 @@ public class RabbitConsumerErrorHandler(IPublisherService publisherService)
|
||||
/// <param name="exception">The exception that was raised, whose message is included in the error payload.</param>
|
||||
/// <param name="headers">The headers to associate with the resulting error message.</param>
|
||||
/// <returns>A <see cref="Message{Error}"/> containing the constructed error and the propagated message properties.</returns>
|
||||
/// <!-- aidoc:v1 sig=250e4be body=a4fe29e -->
|
||||
private static Message<Error> CreateErrorMessage(
|
||||
MessageReceivedInfo receivedInfo,
|
||||
MessageProperties originalProperties,
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <remarks>
|
||||
/// This class serves as the RabbitMQ-specific concrete realization of the <see cref="IErrorMessageSerializer"/> contract.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=5b2b904 -->
|
||||
public class RabbitIErrorMessageSerializer : IErrorMessageSerializer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -18,6 +19,7 @@ public class RabbitIErrorMessageSerializer : IErrorMessageSerializer
|
||||
/// </summary>
|
||||
/// <param name="messageBody">The JSON-encoded string to unescape and convert.</param>
|
||||
/// <returns>A UTF-8 encoded byte array of the unescaped string, or <c>null</c> if the deserialized value is <c>null</c>.</returns>
|
||||
/// <!-- aidoc:v1 sig=2d425b0 body=db8f7f7 -->
|
||||
public byte[]? Deserialize(string messageBody)
|
||||
{
|
||||
var unescapedJsonString = JsonConvert.DeserializeObject<string>(messageBody);
|
||||
@@ -30,6 +32,7 @@ public class RabbitIErrorMessageSerializer : IErrorMessageSerializer
|
||||
/// </summary>
|
||||
/// <param name="messageBody">The raw byte array representing the message body to be deserialized.</param>
|
||||
/// <returns>The deserialized JSON string if successful; otherwise, the raw UTF-8 decoded string. Returns <see langword="null"/> if the deserialized JSON value is null.</returns>
|
||||
/// <!-- aidoc:v1 sig=7a0ebce body=0ec9d3f -->
|
||||
public string? Serialize(byte[] messageBody)
|
||||
{
|
||||
var stringifiedMsgBody = Encoding.UTF8.GetString(messageBody);
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <summary>
|
||||
/// Provides static utility methods for working with types.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=9113a6d -->
|
||||
public static class TypesUtils
|
||||
{
|
||||
/// <summary>
|
||||
@@ -15,6 +16,7 @@ public static class TypesUtils
|
||||
/// <param name="device">The specific device identifier used when resolving the driver type.</param>
|
||||
/// <returns>The <see cref="Type"/> of the driver that corresponds to the given device type.</returns>
|
||||
/// <exception cref="AdasException">Thrown when the provided <paramref name="deviceType"/> is not a recognized value.</exception>
|
||||
/// <!-- aidoc:v1 sig=fffff40 body=77d9a24 -->
|
||||
public static Type GetDriver(string deviceType, string device)
|
||||
{
|
||||
return deviceType switch
|
||||
|
||||
Reference in New Issue
Block a user