Commit Graph

503 Commits

Author SHA1 Message Date
3cfecbf598 Rename OutResController to ResultController and update docs
Renamed the controller class to ResultController for clarity and added the ReC.Application.Results.Queries using directive. Updated class documentation and parameter descriptions to better reflect the controller's purpose.
2026-01-16 11:17:41 +01:00
4895b9c8f8 Refactor: move OutResults to Results namespace
Refactored all "Result" related command and query classes from ReC.Application.OutResults to ReC.Application.Results. Updated all relevant using statements and reorganized files accordingly. No functional changes; this improves project structure and clarity.
2026-01-16 11:13:06 +01:00
36fe78e152 Remove obsolete CreateResultViewCommand and handler
Deleted the CreateResultViewCommand.cs file, including the obsolete CreateResultViewCommand and CreateResultViewCommandHandler classes. These were previously used for creating ResultView entities, but are now replaced by related procedures or views. All associated code and using directives have been removed.
2026-01-16 11:09:02 +01:00
489180f5a1 Restructure solution folders in ReC.sln
Added "infrastructure", "presentation", and "core" solution folders. Moved projects into these new folders and updated the NestedProjects section to reflect the new organization. Adjusted parent GUIDs accordingly.
2026-01-16 11:07:19 +01:00
b65810bbbb Add XML docs to ResultType enum members
Added summary XML documentation to each member of the ResultType enum in the ReC.Client namespace, clarifying the purpose of Full, OnlyHeader, and OnlyBody options.
2026-01-16 11:05:17 +01:00
278fcfd75b Remove obsolete sync API methods from ReCClient
All synchronous (blocking) HTTP API methods have been removed from the ReCClient class, leaving only their asynchronous counterparts. These sync methods were previously marked as [Obsolete] and simply wrapped the async methods with .GetAwaiter().GetResult(). Additionally, the ToJsonContent method's return type was updated from HttpContent to JsonContent for improved type specificity.
2026-01-16 11:04:11 +01:00
41db75b183 Add TaskSyncExtensions for sync Task execution (.NET FW)
Introduced TaskSyncExtensions class with Sync extension methods to allow synchronous execution of Task and Task<TResult> instances. This enables blocking on async code and is conditionally compiled for .NET Framework builds.
2026-01-16 11:03:53 +01:00
f4a921e268 Adjust BuildQuery param types for .NET Framework compatibility
Use conditional compilation to set BuildQuery's tuple Value type
to object for .NET Framework and object? for other targets,
ensuring compatibility with nullable reference types across
different .NET versions.
2026-01-16 10:58:26 +01:00
cdb52dc6fd Add strongly-typed HTTP API methods to ReCClient
Introduce async/sync methods for all major API controllers in ReCClient, supporting GET, POST, PUT, and DELETE with JSON serialization. Add utility methods for query building and JSON content. Mark sync wrappers as [Obsolete]. Add System.Net.Http.Json dependency and supporting usings. Introduce ResultType enum. This greatly expands ReCClient's API coverage and usability.
2026-01-16 10:54:46 +01:00
f14f6c1f15 Rename GetProfile method to Get in ProfileController
Renamed the GetProfile method to Get in the ProfileController to standardize method naming. No changes were made to the method's functionality or parameters.
2026-01-16 10:48:42 +01:00
6a24719342 Remove obsolete MappingProfile classes from Endpoints/RecActions
Removed AutoMapper MappingProfile classes from ReC.Application.Endpoints and ReC.Application.RecActions. These profiles mapped command objects to DTOs with default values. The change reflects a move toward using procedures or views for these mappings.
2026-01-16 10:40:28 +01:00
631ab8cba5 Remove obsolete OutRes command/query validators
Deleted DeleteOutResCommandValidator and ReadOutResQueryValidator classes, which were marked as obsolete. These validators are no longer needed due to a shift toward using related procedures or views for validation.
2026-01-16 10:37:57 +01:00
872878b9d7 Remove obsolete OutRes and RecAction CQRS classes
Removed deprecated command, query, and mapping classes for OutRes and RecAction entities, including their handlers and AutoMapper profiles. These components were previously marked as obsolete and have been superseded by database procedures or views. This cleanup eliminates redundant code and enforces the use of the updated data access patterns.
2026-01-16 10:36:43 +01:00
5a30b0ece4 Remove ObtainEndpointCommand and its handler
Deleted the ObtainEndpointCommand, its handler, and related using directives. This command was previously used to obtain or create Endpoint entities by URI, but has been removed in favor of using a related procedure or view as indicated by its Obsolete attribute.
2026-01-16 10:36:10 +01:00
37200617ea Remove unused entity-to-DTO mappings from DtoMappingProfile
Cleaned up DtoMappingProfile by removing mappings for several domain entities (OutRes, Connection, Endpoint, EndpointAuth, EndpointParam, Profile, RecAction) to their DTOs. Only view-to-DTO mappings remain. Also removed unused using directives.
2026-01-16 10:35:21 +01:00
8ab66db1f2 Remove obsolete entity DbSets and configs from RecDbContext
Removed all DbSet properties and Fluent API configurations for obsolete domain entities (EndpointParam, OutRes, Connection, Endpoint, EndpointAuth, Profile, RecAction) from RecDbContext. These entities are now accessed via views, further enforcing the transition to view-based data access. Only view-based models remain configured in the context.
2026-01-16 10:29:27 +01:00
cbd52721ac Remove obsolete DbSets from IRecDbContext interface
Removed DbSet properties for entities marked as obsolete in IRecDbContext, including EndpointParam, OutRes, Connection, Endpoint, EndpointAuth, Profile, and RecAction. Retained only DbSets for views and query results to encourage use of views instead of direct entity access. This streamlines the interface and aligns with the intended data access pattern.
2026-01-16 10:24:09 +01:00
3003559d7a Remove obsolete navigation properties from RecActionView
Removed Root, Endpoint, EndpointAuth, and SqlConnection navigation properties from RecActionView, along with their [ForeignKey] and [Obsolete] attributes. This streamlines the data model by retaining only foreign key IDs and related string properties, reducing direct entity navigation in favor of using related procedures or views.
2026-01-16 10:21:50 +01:00
6cabdbb6a3 Remove obsolete entity classes in favor of views
Removed Connection, Endpoint, EndpointAuth, EndpointParam, OutRes, Profile, and RecAction classes, which represented database tables and were marked as obsolete. This cleanup supports the transition to using database views or an updated data access approach. All related code, including attributes and properties, has been deleted.
2026-01-16 10:20:22 +01:00
4dd54e206e Update EndpointAuth references to fully qualified name
Replaced unqualified EndpointAuth with Domain.Entities.EndpointAuth
in DtoMappingProfile and IRecDbContext to improve clarity and
avoid potential naming conflicts.
2026-01-16 10:18:40 +01:00
84cf5c8e4d Add EndpointsController for endpoint CRUD operations
Introduced EndpointsController with POST, PUT, and DELETE API endpoints for managing endpoints. Utilizes MediatR to handle insert, update, and delete procedures, and retrieves configuration values as needed. Includes proper routing and response type annotations.
2026-01-16 10:15:07 +01:00
84d6e7a511 Add EndpointParamsController for CRUD via procedures
Introduced EndpointParamsController to manage endpoint parameter records using stored procedures. The controller supports POST (insert), PUT (update), and DELETE operations, leverages MediatR for command handling, and uses dependency injection for configuration and mediator services. Endpoints are documented and specify response types.
2026-01-16 10:13:33 +01:00
89238cc2d1 Add EndpointAuthController with CRUD endpoints
Introduced EndpointAuthController to manage endpoint authentication records via MediatR and procedure-based commands. Added POST (insert), PUT (update), and DELETE (range delete) endpoints. Controller uses dependency injection and provides XML documentation for each action.
2026-01-16 10:12:11 +01:00
7b177f21c8 Remove ResultViewController and related API endpoints
Removed the entire ResultViewController.cs file, including all endpoints for result view queries and insertions. This eliminates support for fake profile IDs, result type filtering, and all related API logic from the codebase.
2026-01-16 10:08:47 +01:00
2deb235c8d Update Post to use CreatedAtAction with Location header
Refactored the Post method to return a 201 Created response using CreatedAtAction. This change adds a Location header pointing to the Get action with the relevant actionId, and includes both the new record's ID and actionId in the response body. This improves API usability and aligns with RESTful conventions.
2026-01-16 10:07:21 +01:00
c452724c9e Rename controller methods for consistency and clarity
Renamed CreateAction to Create and UpdateAction to Update in RecActionController to improve naming consistency. No changes to method logic or signatures.
2026-01-16 10:02:16 +01:00
13e65774cc Add procedure-based update and delete endpoints to controller
Refactored RecActionController to support update via a new PUT endpoint using UpdateActionProcedure. Changed DELETE endpoints to use DeleteActionProcedure payloads instead of command objects, removing obsolete attributes. Updated using statements for new procedure types and standardized payload handling for update and delete operations.
2026-01-16 10:01:08 +01:00
f2d2dc9a32 Add procedure-based CRUD endpoints to ProfileController
Extended ProfileController with POST, PUT, and DELETE endpoints for profile management using InsertProfileProcedure, UpdateProfileProcedure, and DeleteProfileProcedure. Added necessary using directives and XML documentation for each new endpoint.
2026-01-16 09:57:18 +01:00
459620e1dd Refactor update procedures: rename Guid to Id
Renamed all `Guid` properties and parameters to `Id` in update procedure interfaces, records, and handlers. This clarifies that the identifier is a numeric ID, not a GUID, and improves consistency across the codebase. All related method signatures and usages have been updated accordingly.
2026-01-16 09:53:50 +01:00
df2541108b Add POST/PUT endpoints for RESULT insert and update
Added POST endpoint to insert RESULT records and PUT endpoint to update RESULT records in OutResController. Integrated InsertResultProcedure and UpdateResultProcedure with MediatR, returning appropriate status codes. Updated using directives accordingly.
2026-01-16 09:51:30 +01:00
5dcd5313a5 Refactor EndpointParams procedures to Commands namespace
Moved Delete, Insert, and UpdateEndpointParamsProcedure classes from Common.Procedures to EndpointParams.Commands for better organization. Updated related imports in InsertObjectProcedure.cs and UpdateObjectProcedure.cs to reflect the new namespace. No functional changes to the procedures themselves.
2026-01-16 09:44:46 +01:00
ef9d725f59 Refactor endpoint procedures to Endpoints.Commands namespace
Moved Delete/Insert/UpdateEndpointProcedure classes from Common.Procedures to Endpoints.Commands namespace. Updated using directives accordingly for improved code organization and maintainability. No changes to class logic.
2026-01-16 09:41:19 +01:00
6f4ab073df Move EndpointAuth procedures to dedicated namespace
Refactored Delete/Insert/UpdateEndpointAuthProcedure records into the new ReC.Application.EndpointAuth.Commands namespace for better organization. Updated using statements in related files to ensure compatibility. No functional changes to the procedure records themselves.
2026-01-16 09:38:59 +01:00
f6b95331e1 Refactor procedure classes into feature-based namespaces
Moved Insert, Update, and Delete procedure records for Action, Profile, and Result entities from common namespaces to feature-specific namespaces. Updated all relevant using directives and controller references. No logic changes; this improves code organization and maintainability.
2026-01-16 09:34:41 +01:00
82de285891 Refactor OutResController to use DeleteResultProcedure
Refactored DELETE endpoints in OutResController to use the new DeleteResultProcedure payload instead of DeleteOutResCommand. Updated endpoints to call mediator.ExecuteDeleteProcedure and revised XML docs accordingly. Removed obsolete attributes and command references. The "fake" profile deletion now uses the procedure with the fake profile ID.
2026-01-16 09:18:15 +01:00
Developer 02
cbd86de3e8 Add handling for update and delete exceptions
Enhanced `ExceptionHandlingMiddleware` to handle
`UpdateObjectFailedException` and `DeleteObjectFailedException`.
Logs exception details, including serialized procedure data,
and sets HTTP status to `500 Internal Server Error`.
Improves error differentiation and response for specific failure cases.
2026-01-16 01:10:57 +01:00
Developer 02
a5160b35dd Add HTTP DELETE endpoint to CommonController
A new `DeleteObject` method has been added to the `CommonController` class to handle HTTP DELETE requests. This method is asynchronous and processes a `DeleteObjectProcedure` object passed in the request body using the `mediator.Send` function. The result is returned as an HTTP 200 OK response. The `[HttpDelete]` attribute has been applied to the method to designate it as a DELETE endpoint.
2026-01-16 01:08:30 +01:00
Developer 02
60e1627494 Add UpdateObject endpoint and enhance procedure support
Enhanced `CommonController` to support object operations:
- Added `using` statements for Insert, Update, and Delete procedures.
- Updated constructor to inject `IMediator` for request handling.
- Introduced `UpdateObject` endpoint with HTTP PUT support.
  - Processes `UpdateObjectProcedure` via MediatR.
  - Returns HTTP 200 OK with the result.
2026-01-16 01:08:20 +01:00
Developer 02
b9f08bc21c Add DeleteActionProcedure for ACTION entity deletion
Introduced a new `DeleteActionProcedure` record in the
`ReC.Application.Common.Procedures.DeleteProcedure` namespace.

This record implements the `IDeleteProcedure` interface and includes
the following properties:
- `Start`: Starting GUID/ID (inclusive).
- `End`: Ending GUID/ID (inclusive), defaults to `Start` if 0.
- `Force`: Allows deletion even if dependent RESULT data exists.

Added a `ToObjectProcedure` method to convert `DeleteActionProcedure`
to a `DeleteObjectProcedure` with the entity set to `"ACTION"`.
2026-01-16 01:06:56 +01:00
Developer 02
758616c95e Add DeleteEndpointAuthProcedure for endpoint deletion
Introduce the `DeleteEndpointAuthProcedure` record in the new
`ReC.Application.Common.Procedures.DeleteProcedure` namespace.
This record implements the `IDeleteProcedure` interface and
provides properties for specifying a range of GUID/IDs (`Start`
and `End`) and a `Force` flag to allow deletion despite dependent
data.

Add the `ToObjectProcedure` method to convert the record into a
`DeleteObjectProcedure` with the entity set to `"ENDPOINT_AUTH"`.
2026-01-16 01:06:45 +01:00
Developer 02
7376b49e38 Add DeleteEndpointParamsProcedure record
A new `DeleteEndpointParamsProcedure` record was introduced in the
`ReC.Application.Common.Procedures.DeleteProcedure` namespace. This
record implements the `IDeleteProcedure` interface and provides
properties for specifying a range of GUID/IDs (`Start` and `End`)
and a `Force` flag to allow deletion even with dependent data.

The record includes a `ToObjectProcedure` method to convert its
data into a `DeleteObjectProcedure` instance, setting the entity
to `"ENDPOINT_PARAMS"` and mapping the `Start`, `End`, and `Force`
properties.
2026-01-16 01:06:33 +01:00
Developer 02
b65c354ef0 Add DeleteEndpointProcedure for endpoint deletion
Introduced a new `DeleteEndpointProcedure` record in the
`ReC.Application.Common.Procedures.DeleteProcedure` namespace.

This record implements the `IDeleteProcedure` interface and includes
properties for specifying the start and end GUID/ID range, as well as
a `Force` flag to allow deletion even with dependent data.

Added a `ToObjectProcedure` method to convert the record into a
`DeleteObjectProcedure` with the entity set to "ENDPOINT".
2026-01-16 01:06:22 +01:00
Developer 02
38258a98c1 Add DeleteProfileProcedure for profile deletion logic
Introduce the `DeleteProfileProcedure` record in the new
`ReC.Application.Common.Procedures.DeleteProcedure` namespace.
This record implements the `IDeleteProcedure` interface and
provides properties for specifying a range of GUID/IDs
(`Start`, `End`) and a `Force` flag to allow deletion even
with dependent ACTION data.

Added a `ToObjectProcedure` method to convert
`DeleteProfileProcedure` instances into `DeleteObjectProcedure`
objects, setting the `Entity` to `"PROFILE"`.
2026-01-16 01:06:12 +01:00
Developer 02
7666708ab5 Add DeleteResultProcedure for RESULT entity deletion
Introduced a new `DeleteResultProcedure` record in the
`ReC.Application.Common.Procedures.DeleteProcedure` namespace.

This record implements the `IDeleteProcedure` interface and provides
properties for specifying a range of GUID/IDs (`Start` and `End`)
and a `Force` flag.

Added a `ToObjectProcedure` method to convert the record into a
`DeleteObjectProcedure` with the entity set to "RESULT".
2026-01-16 01:06:00 +01:00
Developer 02
d3b67bc429 Add IDeleteProcedure interface for delete operations
Introduced a new namespace `ReC.Application.Common.Procedures.DeleteProcedure` and added the `IDeleteProcedure` interface. This interface defines a `ToObjectProcedure` method, which returns a `DeleteObjectProcedure` object. These changes aim to standardize and encapsulate delete-related procedures in the application.
2026-01-16 01:05:46 +01:00
Developer 02
97f992aef5 Add DeleteObjectProcedure for entity deletion handling
Introduce `DeleteObjectProcedure` to encapsulate parameters for
delete operations, including entity, ID range, and force flag.
Add `DeleteObjectProcedureExtensions` for convenient invocation
via `ISender`. Implement `DeleteObjectProcedureHandler` to
execute the `[dbo].[PRREC_DELETE_OBJECT]` stored procedure
using dynamic SQL parameters.

Throw `DeleteObjectFailedException` on failure and ensure
`End` defaults to `Start` if unset. Add XML documentation
for improved code clarity. Include necessary `using`
directives for dependencies.
2026-01-16 01:05:28 +01:00
Developer 02
cc6f93ae1c Add DeleteObjectFailedException for delete operation errors
A new `DeleteObjectFailedException` class was introduced in the
`ReC.Application.Common.Exceptions` namespace to handle errors
related to failed delete operations.

This class includes:
- A `Procedure` property of type `DeleteObjectProcedure` to
  provide context about the failed operation.
- Three constructors to support different levels of detail
  (procedure only, procedure with a message, and procedure with
  a message and inner exception).

Additionally, a `using` directive for the
`ReC.Application.Common.Procedures.DeleteProcedure` namespace
was added to support the `DeleteObjectProcedure` type.
2026-01-16 01:05:10 +01:00
Developer 02
402990bd3c Add UpdateResultProcedure record for result updates
Introduced a new `UpdateResultProcedure` record in the
`ReC.Application.Common.Procedures.UpdateProcedure` namespace.
This record implements the `IUpdateProcedure` interface and
includes properties for `ActionId`, `StatusId`, `Header`, and
`Body`.

Added a `ToObjectProcedure` method to convert the record into
an `UpdateObjectProcedure` instance, setting the `Entity` to
"RESULT", and allowing optional tracking of changes via the
`ChangedBy` method.
2026-01-16 00:59:43 +01:00
Developer 02
43cdef4910 Add UpdateProfileProcedure record for profile updates
Introduced a new namespace `ReC.Application.Common.Procedures.UpdateProcedure`.
Added the `UpdateProfileProcedure` record implementing the `IUpdateProcedure` interface.
This record includes several nullable properties such as `Active`, `TypeId`, `Name`, `Description`, and others.
Added the `ToObjectProcedure` method to convert the record into an `UpdateObjectProcedure` instance, setting the entity to "PROFILE" and supporting optional change tracking via `ChangedBy`.
2026-01-16 00:59:33 +01:00
Developer 02
348a55fc60 Add UpdateEndpointProcedure record for endpoint updates
A new `UpdateEndpointProcedure` record was introduced in the
`ReC.Application.Common.Procedures.UpdateProcedure` namespace.
This record implements the `IUpdateProcedure` interface and
includes nullable properties `Active`, `Description`, and `Uri`.

The `ToObjectProcedure` method was added to convert the record
into an `UpdateObjectProcedure` instance, setting the `Entity`
to `"ENDPOINT"`, the `Guid` to the provided parameter, and the
`Endpoint` to the current instance. The method also supports
tracking changes via the optional `changedWho` parameter.
2026-01-16 00:59:23 +01:00