Commit Graph

309 Commits

Author SHA1 Message Date
46b7ae29cd Update IRecDbContext DbSets and add new entity sets
Changed DbSet properties to get/set in IRecDbContext, renamed Actions to RecActionViews for consistency, and added DbSets for Connections, Endpoints, EndpointAuths, Profiles, and RecActions. Updated RecDbContext implementation accordingly.
2025-12-12 13:42:49 +01:00
84e403f411 Refactor API key auth handling with switch and error check
Refactored the "API Key" authentication logic to use a switch
statement on the API key location, improving code clarity.
Added a default case to throw a DataIntegrityException for
unsupported API key locations, enhancing error handling.
2025-12-12 13:21:09 +01:00
3b77345aee Refactor API key location to use enum instead of string
Changed EndpointAuthApiKeyAddTo from string? to ApiKeyLocation? enum in RecActionDto for type safety. Updated related logic in InvokeRecActionCommandHandler to use the enum, and added the necessary using directive for ReC.Domain.Constants.
2025-12-12 13:17:54 +01:00
6d04a4afd1 Refactor API key location to use enum for type safety
Updated EndpointAuth and RecActionView to use the ApiKeyLocation enum for API key location properties instead of nullable strings. Added necessary using directives for ReC.Domain.Constants to support this change, improving type safety and code clarity.
2025-12-12 13:16:32 +01:00
1f250d55b0 Add ApiKeyLocation enum for API key placement options
Introduced the ApiKeyLocation enum in the ReC.Domain.Constants namespace to specify API key locations, supporting both Header and Query options.
2025-12-12 13:10:09 +01:00
c422de445d Refactor ErrorAction to use enum for type safety
Changed RecActionDto.ErrorAction from string to ErrorAction enum, updating all related logic to use enum values instead of strings. Added necessary using directives. This improves type safety, reduces risk of typos, and enhances maintainability.
2025-12-12 13:04:23 +01:00
f9a73fbe0c Refactor RecAction.ErrorAction to use enum type
Changed ErrorAction property in RecAction from string? to ErrorAction? enum for improved type safety. Added import for ReC.Domain.Constants to support the new type.
2025-12-12 13:02:17 +01:00
282ce3a0b7 Move ErrorAction enum to domain layer namespace
Changed ErrorAction enum namespace from ReC.Application.Common.Constants to ReC.Domain.Constants to better reflect its domain relevance. Removed the file's BOM. Enum members remain unchanged.
2025-12-12 13:00:24 +01:00
26f2da1313 Add ErrorAction enum for error handling actions
Introduced the ErrorAction enum in the ReC.Application.Common.Constants namespace with Stop and Continue values to standardize error response actions across the application.
2025-12-12 12:55:57 +01:00
bc700e2cd2 Refactor HTTP client name constant usage
Replaced the old HttpClientName constant in Constants.cs with a new Http.ClientName in the ReC.Application.Common.Constants namespace. Updated all references and using directives accordingly to improve code organization and maintainability.
2025-12-12 12:54:57 +01:00
ea5389df85 Remove Message property from OutRes and its EF mapping
The Message property was deleted from the OutRes class, and its corresponding Entity Framework mapping was removed from RecDbContext. This cleans up unused fields from both the model and database context configuration.
2025-12-12 12:51:43 +01:00
87e1bb9187 Refactor: centralize HTTP client naming with Constants
Introduced a Constants class to define a unique HttpClientName for HTTP client registration and usage. Updated DependencyInjection and InvokeRecActionCommandHandler to use this centralized name, improving consistency and reducing risk of name collisions.
2025-12-12 12:42:39 +01:00
68cc919bad Handle unsupported auth types with NotImplementedException
Throw NotImplementedException for unsupported authentication types
in InvokeRecActionCommandHandler, including details like ProfileId
and Id in the exception message for easier debugging. This prevents
silent failures when encountering unknown authentication methods.
2025-12-12 12:02:51 +01:00
374365d250 Refactor HttpClient usage and NTLM auth handling
Centralize HttpClient configuration using IHttpClientFactory with a named "Default" client. Move NTLM authentication logic from HttpClientHandler to request-level options, improving testability and aligning with .NET best practices.
2025-12-12 12:01:22 +01:00
8c79b3a156 Add support for multiple HTTP auth methods in REST actions
Expanded InvokeRecActionCommandHandler to support API Key, Bearer/JWT/OAuth2, Basic, and NTLM authentication schemes. Added necessary imports and logic for header/query manipulation and credential handling. Left placeholders for Digest, OAuth 1.0, and AWS Signature. Improves flexibility and robustness of outgoing HTTP requests.
2025-12-12 11:20:02 +01:00
0583d07f26 Add switch for endpoint auth types in action handler
Introduced a switch statement to handle various endpoint authentication types in InvokeRecActionCommandHandler. Cases for common auth methods have been added as placeholders, preparing the codebase for future implementation of specific authentication logic.
2025-12-12 10:50:49 +01:00
fd7744e94e Include EndpointAuth in RecActionView query results
Added .Include(act => act.EndpointAuth) to eagerly load the EndpointAuth navigation property when retrieving RecActionView entities. Also made a minor formatting adjustment to the check for empty action results.
2025-12-12 10:46:20 +01:00
a5aac1d0ec Add EndpointAuth navigation to RecActionView
Added EndpointAuth navigation property to RecActionView with [ForeignKey("EndpointAuthId")], enabling direct access to related authentication data via Entity Framework.
2025-12-12 10:34:26 +01:00
165152b7cf Merge branch 'master' of http://git.dd:3000/AppStd/ReC 2025-12-12 09:18:27 +01:00
f1f9e8d791 Bump version to 1.0.3-beta in ReC.API.csproj
Updated <Version>, <AssemblyVersion>, <FileVersion>, and <InformationalVersion> fields in the project file from 1.0.2-beta to 1.0.3-beta. No other changes were made.
2025-12-12 01:54:43 +01:00
35171add0c Add ErrorAction to RecActionDto and batch error handling
Introduce ErrorAction property to RecActionDto for per-action error handling. Update InvokeRecActionsCommandHandler to check invocation results and use ErrorAction to determine whether to continue or stop on failure, enabling configurable batch processing behavior.

Add ErrorAction to RecActionDto and batch error handling

Introduce ErrorAction property to RecActionDto for per-action error handling. Update InvokeRecActionsCommandHandler to check invocation results and use ErrorAction to determine whether to continue or stop processing on failure. This enables configurable error handling in batch action execution.
2025-12-12 01:52:35 +01:00
030dcf8b58 Add ErrorAction property to RecAction and DB mapping
Added the ErrorAction property to the RecAction class for specifying error handling actions. Updated RecDbContext to map this property to the ERROR_ACTION database column.
2025-12-12 01:47:43 +01:00
71411d4027 Update InvokeRecActionCommand to return success status
Changed InvokeRecActionCommand and its handler to return a boolean indicating success or failure, allowing consumers to check if the action was successful. This improves clarity and error handling in command execution.
2025-12-12 01:43:01 +01:00
da1b05347e Add Status and Message to CreateOutResCommand
CreateOutResCommand now includes optional Status and Message properties to capture additional result details. The HTTP response status code is recorded in Status when creating an output result in InvokeRecActionCommandHandler.
2025-12-12 01:32:09 +01:00
d932fb522c Add Status and Message columns to entity mapping
Added Status and Message properties to the entity configuration in RecDbContext.cs, mapping them to the STATUS and MESSAGE database columns. This allows the entity to store and retrieve these additional fields.
2025-12-12 01:28:29 +01:00
134a808633 Add Status, Message, and Header to OutRes class
Added three new nullable properties—Status (short), Message (string), and Header (string)—to the OutRes class to support additional metadata and state information.
2025-12-12 01:25:29 +01:00
Developer 02
00efb14f2c Merge branch 'feat/client' 2025-12-11 10:49:21 +01:00
fe40cd001f Update RecActionController routes and XML docs
Changed Invoke action to use profileId as a route parameter. Updated Get method XML docs to reflect use of ReadRecActionQuery from query string instead of profileId.
2025-12-10 16:41:51 +01:00
f96b73bf38 Update RecAction route and refactor EnsureEntity logic
Changed the RecActionController Invoke route to remove the {cmd}
parameter, now accepting POST requests at "invoke" only.
Refactored DbModelOptions.EnsureEntity<T> by removing the
entities dictionary conversion logic for virtual and non-virtual
entities.
2025-12-10 16:02:41 +01:00
c8f3b29329 Refactor EnsureEntity<T> for clarity and consistency
Renamed local variable from 'cluster' to 'entities' in EnsureEntity<T> and unified logic for selecting entity options. Improved readability by consistently using entities.TryGetValue and clearer variable naming.
2025-12-10 15:00:44 +01:00
07fca00344 Replace InvalidOperationException with custom config exception
Refactored DbModelOptions and EntityBaseOptions to throw DbModelConfigurationException instead of InvalidOperationException for configuration errors. Added necessary using directives for the new exception type to improve error clarity and specificity.
2025-12-10 14:54:20 +01:00
e4aec494c8 Add DbModelConfigurationException class to exceptions
Introduced DbModelConfigurationException in the ReC.Infrastructure.Exceptions namespace. This custom exception inherits from Exception and includes both a message constructor and a parameterless constructor for flexible error handling related to DB model configuration issues.
2025-12-10 14:53:48 +01:00
009bb623b5 Add EnsureEntity<T> method to DbModelOptions
Introduce EnsureEntity<T>(bool isVirtual) to validate and ensure entity options exist for a given type in either Entities or VirtualEntities. Throws an exception if options are missing.
2025-12-10 14:24:45 +01:00
f8e7f8c974 Switch DbModelOptions to use dictionaries for entities
Changed Entities and VirtualEntities from IEnumerable to Dictionary<string, T> in DbModelOptions, enabling direct access by string keys and improving lookup efficiency.
2025-12-10 13:56:41 +01:00
959b56c4bb Add ColumnNames property to EntityBaseOptions
Added a new ColumnNames property that exposes the column names from the ColumnMappings dictionary as an IEnumerable<string> in the EntityBaseOptions record. This provides convenient access to mapped column names alongside existing property name access.
2025-12-10 13:52:49 +01:00
5a56125444 Add PropertyNames property to EntityBaseOptions
Introduce PropertyNames as a read-only property exposing the keys of ColumnMappings. Refactor EnsureProperties to use PropertyNames for improved clarity and maintainability.
2025-12-10 13:52:16 +01:00
48039b8fd5 Rename ColumnName to ColumnMappings in EntityBaseOptions
Renamed the ColumnName property to ColumnMappings in the EntityBaseOptions record for improved clarity and consistency. Updated all internal references accordingly; no changes to logic or initialization.
2025-12-10 13:46:23 +01:00
31d1d9d171 Add EnsureProperties<T> for attribute-based config validation
Added EnsureProperties<T>() to EntityBaseOptions, enabling automatic validation of required properties marked with MustConfiguredAttribute via reflection. This reduces manual configuration and improves maintainability.
2025-12-10 13:43:58 +01:00
1419455b36 Add MustConfiguredAttribute and update project file
Added MustConfiguredAttribute for property usage in ReC.Domain.Attributes. Removed explicit "Attributes\" folder reference from ReC.Domain.csproj since the folder now contains code.
2025-12-10 13:32:42 +01:00
a6111cdc66 Rename Columns to ColumnName; add Attributes folder
Renamed the Columns property to ColumnName in EntityBaseOptions.cs,
updating all references accordingly. Added an "Attributes" folder
entry to ReC.Domain.csproj for future organization.
2025-12-10 13:30:47 +01:00
3caa6b9bd3 Add params overload for EnsureProperties in EntityBaseOptions
Added a public EnsureProperties method accepting a params string[] in EntityBaseOptions. This provides a more convenient way to ensure multiple properties are configured, internally delegating to the existing IEnumerable-based method.
2025-12-10 13:28:38 +01:00
fb08a45c57 Add EnsureProperties method to EntityBaseOptions
Introduce EnsureProperties to validate required property names
against the Columns dictionary, throwing an exception if any
are missing. This helps enforce configuration completeness.
2025-12-10 13:26:42 +01:00
0588ba33d8 Add DbModelOptions record for entity configuration
Introduced DbModelOptions in ReC.Infrastructure.Options to encapsulate collections of EntityOptions and VirtualEntityOptions, providing a structured way to configure entities and virtual entities. Both properties are initialized to empty collections by default.
2025-12-10 12:42:23 +01:00
535fdbb7b4 Refactor entity options to use shared base class
Introduce EntityBaseOptions with Columns property.
Update EntityOptions and VirtualEntityOptions to inherit from EntityBaseOptions for improved code reuse and consistency.
2025-12-10 12:32:34 +01:00
4206a962ff Refactor option records and improve namespace structure
Renamed Table to TableOptions and moved it, along with EntityOptions and VirtualEntityOptions, to the ReC.Infrastructure.Options.Shared namespace. Split records into separate files for better modularity and updated EntityOptions to reference TableOptions. This enhances code organization and naming consistency.
2025-12-10 12:24:39 +01:00
ae059e4416 Add VirtualEntityOptions and EntityOptions records
Introduced two new record types: VirtualEntityOptions (currently empty) and EntityOptions, which encapsulates a Table instance. These additions lay groundwork for future entity configuration options.
2025-12-10 12:16:50 +01:00
d771dbbc9e Add Table record in ReC.Infrastructure.Options namespace
Introduced a new Table record with Name and optional Schema properties under the ReC.Infrastructure.Options namespace. This addition provides a structured way to represent database table metadata.
2025-12-10 12:10:06 +01:00
73ffaaab08 Remove RecActionView entity and its database mapping
Deleted the RecActionView class, including all properties and data annotations, removing its mapping to the VWREC_ACTION view and related relationships from the codebase.
2025-12-10 12:06:20 +01:00
b79fcf936b Refactor RecAction mapping to Fluent API in DbContext
Moved all RecAction table and column mappings from data annotations in the entity class to Fluent API configuration in RecDbContext. Also consolidated the OutRes relationship setup into the new configuration block, removing redundant mapping code. RecAction is now a plain class without EF attributes.
2025-12-10 12:04:43 +01:00
674c14dd7c Refactor Profile mapping to use Fluent API in DbContext
Moved table and column mapping for Profile from data annotations
in the entity class to Fluent API configuration in RecDbContext.
Removes dependency on DataAnnotations in Profile.cs and
centralizes entity configuration in the DbContext.
2025-12-10 12:02:20 +01:00