Commit Graph

593 Commits

Author SHA1 Message Date
94da75ce37 Add MediatR handler for DeleteProfileProcedure command
Introduce DeleteProfileProcedureHandler using MediatR's IRequestHandler to process DeleteProfileProcedure requests. The handler sends a DeleteObjectProcedure via ISender, replacing the previous ToObjectProcedure method. Also, add necessary using directives and refactor logic to centralize command handling.
2026-03-24 10:14:10 +01:00
9c1ffd7df8 Refactor UpdateEndpointProcedure and add handler
Refactored UpdateEndpointProcedure to implement IUpdateProcedure directly and removed the ToObjectProcedure method. Introduced UpdateEndpointProcedureHandler using MediatR's ISender for command handling, aligning with MediatR patterns and enabling dependency injection.
2026-03-24 10:13:35 +01:00
e31d034266 Refactor InsertEndpointProcedure; add MediatR handler
Refactored InsertEndpointProcedure to remove the ToObjectProcedure method, making it a simple data record. Introduced InsertEndpointProcedureHandler using MediatR's IRequestHandler to handle insert commands asynchronously. Added necessary MediatR using directives.
2026-03-24 10:13:12 +01:00
649d7eff8c Refactor DeleteEndpointProcedure to use MediatR handler
Replaces the ToObjectProcedure method with a dedicated
DeleteEndpointProcedureHandler implementing IRequestHandler.
The handler uses MediatR's ISender to send DeleteObjectProcedure,
improving separation of concerns and aligning with MediatR
request/response patterns.
2026-03-24 10:12:35 +01:00
401d67de4c Refactor UpdateEndpointParamsProcedure to MediatR pattern
Refactored UpdateEndpointParamsProcedure to include all relevant properties and removed the ToObjectProcedure method. Introduced UpdateEndpointParamsProcedureHandler using MediatR's IRequestHandler, delegating update logic via ISender. This improves code structure and maintainability.
2026-03-24 10:11:55 +01:00
ed94415a33 Refactor InsertEndpointParamsProcedure with MediatR handler
Remove ToObjectProcedure method from InsertEndpointParamsProcedure and introduce InsertEndpointParamsProcedureHandler using MediatR's IRequestHandler. This decouples conversion and command logic, aligning with MediatR patterns and improving separation of concerns.
2026-03-24 10:10:14 +01:00
04513a3d08 Refactor endpoint params delete to use MediatR handler
Replaces ToObjectProcedure with DeleteEndpointParamsProcedureHandler using MediatR's request/handler pattern. Improves separation of concerns by delegating deletion logic to the handler and updates imports and namespace accordingly.
2026-03-24 10:09:37 +01:00
d390c3f7b6 Remove DeleteObjectProcedureExtensions and its methods
Deleted the DeleteObjectProcedureExtensions static class and its ExecuteDeleteProcedure extension methods from DeleteObjectProcedure.cs. These methods previously provided convenience for executing delete procedures via ISender. The core DeleteObjectProcedure record and its handler remain unchanged.
2026-03-24 10:08:45 +01:00
a40f20f6d9 Refactor UpdateEndpointAuthProcedure and add handler
Expanded UpdateEndpointAuthProcedure with new properties and removed the ToObjectProcedure method. Introduced UpdateEndpointAuthProcedureHandler using MediatR's ISender for command handling, improving separation of concerns and enabling dependency injection.
2026-03-24 09:59:21 +01:00
ee1f6a8753 Refactor InsertEndpointAuthProcedure handling
Move insert logic from InsertEndpointAuthProcedure to a new InsertEndpointAuthProcedureHandler using MediatR. Remove ToObjectProcedure method and update usings. The record now serves as a pure data structure.
2026-03-24 09:51:59 +01:00
1e35b6e263 Refactor DeleteEndpointAuthProcedure to use MediatR handler
Refactored DeleteEndpointAuthProcedure by removing the ToObjectProcedure method and introducing DeleteEndpointAuthProcedureHandler, which implements IRequestHandler and delegates deletion via MediatR's ISender. Consolidated using directives and namespace declarations.
2026-03-24 09:51:21 +01:00
e152e9a37a Refactor ChangedWho handling in UpdateObjectProcedure
ChangedWho is now initialized directly and no longer settable via a public method. Removed the ChangedBy method and related extension methods. Added a TODO to move ChangedWho assignment to authentication middleware in the future.
2026-03-24 09:48:37 +01:00
554aaa8b6c Refactor InsertObjectProcedure AddedWho handling
Removed AddedBy method and related extension; AddedWho is now set to a default value internally. Added a TODO to move AddedWho assignment to authentication middleware in the future.
2026-03-24 09:47:24 +01:00
329d156d08 Update IUpdateProcedure to use MediatR IRequest<int>
Refactored IUpdateProcedure to inherit from MediatR's IRequest<int> for integration with the MediatR pipeline. Removed the ToObjectProcedure method and added the necessary using directive for MediatR. This simplifies the interface and standardizes request handling.
2026-03-24 09:44:41 +01:00
246362812a Refactor IInsertProcedure for MediatR compatibility
IInsertProcedure now inherits from IRequest<long> to integrate with MediatR's request/response pattern. Removed the ToObjectProcedure method and added the necessary MediatR using directive.
2026-03-24 09:43:57 +01:00
71430918ac Refactor IDeleteProcedure to use MediatR IRequest<int>
IDeleteProcedure now inherits from MediatR's IRequest<int>, aligning it with MediatR request/response patterns. Removed the ToObjectProcedure method from the interface. Added the MediatR using directive. Note: The namespace and using directive are now on the same line, which may need formatting correction.
2026-03-24 09:43:36 +01:00
7a1705365b Add dynamic SQL execution to IRecDbContext interface
Added Database property to IRecDbContext for database operations. Introduced ExecuteDynamicSqlAsync extension method to run arbitrary SQL and return results as JSON. This enables flexible querying and result serialization.
2026-03-24 09:42:59 +01:00
acf136e689 Refactor UpdateProfileProcedure and add MediatR handler
Refactored UpdateProfileProcedure to implement IUpdateProcedure and expanded its properties. Removed ToObjectProcedure method. Introduced UpdateProfileProcedureHandler using MediatR's ISender for command dispatch. Modernized structure to use record types and handler classes.
2026-03-24 09:41:17 +01:00
6b4897702a Refactor DeleteActionProcedure to use MediatR handler
Refactored DeleteActionProcedure to implement IDeleteProcedure directly and removed the ToObjectProcedure method. Introduced DeleteActionProcedureHandler using MediatR's IRequestHandler to delegate deletion logic via ISender. Updated using directives for MediatR integration.
2026-03-19 23:19:07 +01:00
7d4e082958 Refactor InsertActionProcedure to use MediatR handler
Replaces the ToObjectProcedure method with an InsertActionProcedureHandler that implements IRequestHandler using MediatR. The handler maps InsertActionProcedure to InsertObjectProcedure and sends it via ISender. Also updates using statements to include MediatR.
2026-03-19 23:18:57 +01:00
d1dd021952 Refactor UpdateActionProcedure and add handler class
Expanded UpdateActionProcedure with new properties and removed the ToObjectProcedure method. Introduced UpdateActionProcedureHandler using MediatR to handle update logic and delegate to UpdateObjectProcedure. Centralized update logic in the handler for better maintainability.
2026-03-19 23:18:47 +01:00
5afc1791b0 Refactor DeleteResultProcedure to use MediatR handler
Remove ToObjectProcedure method and add DeleteResultProcedureHandler implementing IRequestHandler. The handler sends DeleteObjectProcedure via MediatR, mapping relevant properties. Also update using directives and namespace.
2026-03-19 23:18:38 +01:00
2ec07d7e96 Refactor InsertResultProcedure to use MediatR handler
Refactored InsertResultProcedure by removing its ToObjectProcedure method and introducing InsertResultProcedureHandler, which implements IRequestHandler and delegates object insertion via MediatR's ISender. This shifts conversion logic from the record to the handler and improves separation of concerns.
2026-03-19 23:18:29 +01:00
cbe4f1ba3c Refactor UpdateResultProcedure to use MediatR handler
Refactored UpdateResultProcedure to implement IUpdateProcedure directly and removed the ToObjectProcedure method. Introduced UpdateResultProcedureHandler using MediatR's IRequestHandler pattern, delegating update logic via ISender. This improves code structure and maintainability.
2026-03-19 23:18:17 +01:00
16155da033 Add Info and Error properties to OutResDto
Added two new nullable string properties, Info and Error, to the OutResDto record to support additional informational and error messages in responses.
2026-03-19 18:51:33 +01:00
0aa1414ea6 Add @pRESULT_INFO and @pRESULT_ERROR SQL parameters
Added two new SQL parameters, @pRESULT_INFO and @pRESULT_ERROR, to InsertObjectProcedure.cs. These are set from request.Result.Info and request.Result.Error, or to DBNull.Value if null, to support additional result data in the procedure.
2026-03-19 18:50:47 +01:00
181a9a83fd Add Info and Error properties to InsertResultProcedure
Added nullable string properties Info and Error to the InsertResultProcedure record to allow storing additional information and error messages related to insert operations.
2026-03-19 18:50:34 +01:00
5e3e12bad8 Add Info and Error properties to entity mapping
Added Info and Error properties to the entity configuration, mapping them to the RESULT_INFO and RESULT_ERROR columns in the database using HasColumnName. This allows the entity to store and retrieve additional result information and error details.
2026-03-19 18:49:28 +01:00
6dcc128ad5 Add Info, Error, AddedWho, and ChangedWho to ResultView
Extended ResultView with four new nullable string properties:
Info and Error for additional details and error messages,
and AddedWho and ChangedWho for tracking user metadata.
2026-03-19 18:49:08 +01:00
754ef88644 Bump version to 2.0.2-beta in ReC.API.csproj
Updated project, assembly, and file versions from 2.0.1-beta/2.0.1.0 to 2.0.2-beta/2.0.2.0 to reflect new release. No other changes were made.
2026-03-16 13:46:10 +01:00
95ece6fdcf Remove unused imports from ResultController.cs
Removed unnecessary using statements for ReC.API.Extensions and ReC.API.Models to clean up the code and improve maintainability. No functional changes were made.
2026-03-16 13:44:38 +01:00
87194df697 Refactor and expand REST action authentication support
Refactored authentication logic for REST actions to use a structured switch block, adding explicit support for ApiKey, BearerToken, JwtBearer, OAuth2, BasicAuth, and NTLM authentication types. Introduced dedicated HttpClient/Handler for NTLM with proper disposal. Improved extensibility, clarity, and resource management. Added IOptions and Options usage for configuration.
2026-03-16 13:43:27 +01:00
b38d53248c Force HTTP/1.1 for NTLM when UseHttp1ForNtlm is enabled
Added logic to set HTTP/1.1 and exact version policy for NTLM
authentication requests when the UseHttp1ForNtlm option is true.
This ensures compatibility with NTLM endpoints requiring HTTP/1.1.
2026-03-16 13:41:04 +01:00
56b604bd35 Add UseHttp1ForNtlm option to RecAction config
Added the boolean UseHttp1ForNtlm property to the RecAction section in appsettings.json and RecActionOptions class. This option defaults to false and allows control over using HTTP/1 for NTLM authentication.
2026-03-16 13:38:45 +01:00
f67579dba9 Move AddedWho config to RecActionOptions and refactor usage
Centralize AddedWho under RecAction in appsettings.json and add it to RecActionOptions. Update InvokeRecActionViewCommandHandler to use IOptions<RecActionOptions> for strongly-typed configuration access, replacing previous config-based retrieval. Removes global AddedWho property for improved maintainability.
2026-03-16 13:32:34 +01:00
636397efb8 Remove MaxConcurrentInvocations from RecAction config
Removed the MaxConcurrentInvocations property from the RecActionOptions class and deleted the corresponding setting from the RecAction section in appsettings.json. This makes RecActionOptions an empty class.
2026-03-16 13:28:50 +01:00
ef4d0767e9 Remove FakeProfileId config and related extension method
Removed the GetFakeProfileId extension method and its class from ConfigExtensions.cs, along with the "FakeProfileId" entry from appsettings.json. Also fixed a trailing comma in appsettings.json to ensure valid JSON syntax.
2026-03-16 13:26:08 +01:00
f15725ade2 Support NTLM password substitution in DEBUG mode
In DEBUG builds, replace "%NTLM_PW%" in NTLM auth password with a value from config. This enables dynamic credential testing without hardcoding passwords.
2026-03-16 13:18:24 +01:00
382eef0089 Enable User Secrets in ReC.API.csproj for dev config
Added <UserSecretsId> to the project file to support ASP.NET Core User Secrets, allowing secure storage of sensitive development configuration data.
2026-03-16 12:28:58 +01:00
5d316e43b9 Bump version to 2.0.1-beta in ReC.API.csproj
Updated <Version>, <AssemblyVersion>, <FileVersion>, and <InformationalVersion> fields in the project file from 2.0.0-beta to 2.0.1-beta to reflect a new pre-release build. No other changes were made.
2026-03-03 08:19:31 +01:00
0c8d7f6b3c Add 'Last' option to ReadResultViewQuery for latest result
Added a Last property to ReadResultViewQuery to allow fetching only the most recent ResultView entity. Updated the handler logic to return either the last result or all results based on this property.
2026-03-02 16:17:21 +01:00
0e7870b556 Refactor: remove HttpExtensions and inline HTTP method mapping
Removed HttpExtensions.cs and its extension methods for RestType-to-HttpMethod conversion. Introduced a private static CreateHttpRequestMessage method in InvokeRecActionViewCommandHandler to handle HTTP method mapping and request creation directly, reducing indirection and simplifying dependencies.
2026-03-02 14:31:38 +01:00
ec119a3045 Add options to include Action/Profile in ResultView queries
Added IncludeAction and IncludeProfile properties to ReadResultViewQuery, allowing callers to control eager loading of related Action and Profile entities. Updated handler to conditionally include these navigation properties based on the new flags for more flexible data retrieval.
2026-03-02 13:57:14 +01:00
776813d05d Simplify StringContent assignment in HTTP request
Refactored code to assign StringContent directly to httpReq.Content without a using block. Disposal of StringContent is now handled by HttpRequestMessage, improving code clarity and resource management.
2026-03-02 13:40:43 +01:00
0a3761921d Refactor RecActionView command invocation, remove extension
Removed the ToInvokeCommand extension method and now construct InvokeRecActionViewCommand instances directly in the batch handler. Also added an unused using directive in InvokeBatchRecActionViewsCommand.cs.
2026-03-02 13:11:50 +01:00
23246d4ebf Remove Invoked filter from ReadRecActionViewQuery
Previously, only uninvoked actions were fetched by applying Invoked = false in ReadRecActionViewQuery. Now, the filter is removed to retrieve all actions for the given ProfileId, regardless of their Invoked status.
2026-03-02 10:44:04 +01:00
27d731a5b0 Bump version to 2.0.0-beta in ReC.API.csproj
Updated <Version>, <AssemblyVersion>, <FileVersion>, and <InformationalVersion> fields from 1.0.3-beta to 2.0.0-beta to reflect a major version change, indicating significant updates or breaking changes in the project.
2026-01-22 10:41:26 +01:00
b8f797f14d Make EndpointAuthType non-nullable with default NoAuth
Changed EndpointAuthType in RecActionViewDto from nullable to non-nullable and set its default value to EndpointAuthType.NoAuth to ensure it always has a valid value.
2026-01-22 10:37:37 +01:00
6feef53733 Update namespaces and usings for Insert procedures
Refactored InsertActionProcedure to the RecActions.Commands namespace and updated its usings to import InsertObjectProcedure. Added missing using for RecActions.Commands in InsertObjectProcedure.cs. These changes improve code organization and clarify command responsibilities.
2026-01-22 10:17:08 +01:00
878e096c57 Refactor TypeId to use RestType enum in InsertActionProcedure
Changed TypeId from byte? to RestType? in InsertActionProcedure for stronger typing. Updated InsertObjectProcedureHandler to cast RestType to byte? when creating SQL parameters. Added using directive for ReC.Domain.Constants to support the new enum type.
2026-01-22 09:55:35 +01:00