Commit Graph

408 Commits

Author SHA1 Message Date
e8fa149532 Move InsertObjectResult mapping to Fluent API
Removed [Column] attribute from InsertObjectResult and configured column mapping for NewObjectId in RecDbContext using the Fluent API. This centralizes entity mapping logic in the DbContext.
2026-01-12 14:20:41 +01:00
aaa7beb92a Add RecResults DbSet for InsertObjectResult entities
Added RecResults DbSet to IRecDbContext and RecDbContext to support managing InsertObjectResult entities. Updated IRecDbContext to include the new DbSet and ensured SaveChangesAsync is defined. Enables querying and persisting InsertObjectResult via EF Core.
2026-01-12 14:19:19 +01:00
5cce52ec27 Add ProfileViews and RecResultViews to IRecDbContext
Updated IRecDbContext to include DbSet properties for ProfileView and ResultView entities, enabling management of these collections within the context.
2026-01-12 14:17:34 +01:00
3f36f048b2 Add InsertObjectResult class for object insert results
Introduced InsertObjectResult in ReC.Domain.QueryOutput with a required NewObjectId property mapped to the "oGUID" column. This class will be used to represent the result of object insert operations. Added necessary using directive for data annotations.
2026-01-12 14:17:04 +01:00
92e8d9e778 Move query result classes to QueryOutput namespace
BodyQueryResult and HeaderQueryResult were relocated from ReC.Domain.Entities to ReC.Domain.QueryOutput. Updated all references in IRecDbContext and RecDbContext to use the new namespace.
2026-01-12 14:11:05 +01:00
2d04670fef Set default Entity to "ACTION" in InsertObject
Added XML summary to Entity property describing valid values.
Changed default value from null to "ACTION" for clarity.
2026-01-12 14:08:03 +01:00
c0085b4c18 Add InsertObject record for MediatR-based insert requests
Introduced InsertObject record in ReC.Application.Common.Procedures namespace. This record implements MediatR's IRequest<long> and includes a non-nullable Entity property to support object insertion operations.
2026-01-12 13:54:04 +01:00
59ea5e3e67 Update action invocation logic and remove EndpointAuth include
Changed invocation filter to use Results.Any() instead of Root.OutRes.
Removed eager loading of EndpointAuth from the query.
2026-01-12 13:26:54 +01:00
a9f2c4c2f7 Add Action and Profile relationships to Result entity
Added navigation properties and foreign key relationships from Result to Action (one-to-many) and Profile (many-to-one) entities using ActionId and ProfileId. This enhances entity associations in the data model.
2026-01-12 13:03:56 +01:00
001f4bf2c5 Configure one-to-many relationship for Profile-Actions
Added entity mapping to establish a one-to-many relationship between profiles and actions, with actions referencing their parent profile via the ProfileId foreign key.
2026-01-12 12:54:00 +01:00
bfe6c12ee0 Annotate ProfileView and add Actions property
ProfileView is now mapped to the VWREC_PROFILE table using the
[Table] attribute. Added an Actions property to support related
RecActionView collections.
2026-01-12 12:50:05 +01:00
e1260e49f0 Add one-to-many Action-Results relationship mapping
Added entity configuration to define a one-to-many relationship between Actions and Results. Each Action can have multiple Results, and each Result references its parent Action via the ActionId foreign key.
2026-01-12 12:47:21 +01:00
8b86eca838 Add obsolete navigation props to RecActionView class
Added Results, Root, Endpoint, EndpointAuth, and SqlConnection navigation properties to RecActionView, all marked as [Obsolete] to guide usage toward related procedures or views. Foreign key attributes applied where relevant.
2026-01-12 12:39:53 +01:00
fb12cb6c98 Refactor ResultView logic under OutResults namespace
Moved ReadResultViewQuery and its handler from ResultViews to OutResults namespace. Merged ResultView mapping profile into OutResults.MappingProfiles and removed the old MappingProfile class. Updated controller references accordingly for improved organization.
2026-01-12 11:32:39 +01:00
2635bfb223 Move CreateResultViewCommand to OutResults.Commands
Relocated CreateResultViewCommand and its handler from ResultViews.Commands to OutResults.Commands. Updated all namespace references and using directives accordingly. Modified the project file to include the new folder structure. No functional changes to the command or handler logic.
2026-01-12 11:30:46 +01:00
5245cd04ff Refactor: move RecActionViewQuery and MappingProfile
Moved ReadRecActionViewQuery and MappingProfile from RecActionViews to RecActions namespace. Updated all references and using directives accordingly. This organizational change consolidates related queries and mapping profiles for improved clarity and maintainability.
2026-01-12 11:27:51 +01:00
9d5334e7dc Move RecActionView commands to RecActions namespace
Refactored InvokeBatchRecActionViewsCommand and InvokeRecActionViewCommand to ReC.Application.RecActions.Commands. Updated related handlers, records, and extension methods to use the new namespace. Removed obsolete using statement in RecActionController. No functional changes; organizational update only.
2026-01-12 11:21:26 +01:00
e5bb61376a Mark ObtainEndpointCommand and mapping as obsolete
Mark ObtainEndpointCommand, its handler, and related mapping
profile as [Obsolete] with guidance to use the new procedure
or view-based approach. This deprecates the old command and
mapping logic in favor of updated patterns.
2026-01-12 11:07:17 +01:00
d3aa8c715b Mark fake OutRes endpoints and queries as [Obsolete]
Added [Obsolete] attribute to "fake" Get methods in OutResController, as well as to ReadOutResQuery, ReadOutResHandler, and ReadOutResQueryValidator. These components are now deprecated in favor of related procedures or views. No functional changes were made.
2026-01-12 11:02:27 +01:00
6720e66b23 Mark DeleteOutResCommand and related classes as obsolete
Added the [Obsolete("Use the related procedure or view.")] attribute to DeleteOutResCommand, its handler, and its validator to indicate these should no longer be used and to guide consumers toward the recommended procedure or view.
2026-01-12 11:00:21 +01:00
71470fc21d Mark CreateOutResCommandHandler and MappingProfiles obsolete
Both CreateOutResCommandHandler and the MappingProfiles constructor are now marked with [Obsolete] attributes, warning developers to use the related procedure or view instead. This signals that these components are deprecated and may be removed in the future.
2026-01-12 10:59:24 +01:00
9191ec4179 Update [Obsolete] messages to mention procedures or views
Updated [Obsolete] attribute messages across several commands,
handlers, and the mapping profile to clarify that related
procedures or views should be used instead. Added [Obsolete]
to CreateOutResCommand. No functional changes made.
2026-01-12 10:52:41 +01:00
e0d83c0a14 Mark RecAction commands and endpoints as obsolete
Added [Obsolete("Use the related procedure.")] to RecAction creation and deletion commands, handlers, mapping profile, and related controller endpoints to indicate deprecation. No functional changes were made.
2026-01-12 10:50:39 +01:00
03bcfb6fc9 refactor(ProfileView): move to Views directory 2026-01-12 10:36:39 +01:00
284ced6059 refactor(ResultView): move to Views directory 2026-01-12 10:34:27 +01:00
88c6e6d214 refactor(RecActionView): move to Views directory 2026-01-12 10:33:59 +01:00
6263848a0a Update DigitalData.Core.Infrastructure to v2.6.1
Upgraded the DigitalData.Core.Infrastructure NuGet package from version 2.6.0 to 2.6.1 in ReC.Infrastructure.csproj to include the latest fixes and improvements.
2026-01-12 10:26:23 +01:00
83f173fdc4 Update DigitalData.Core package versions in csproj files
Upgraded DigitalData.Core.Abstraction.Application to v1.6.0 in ReC.Application.csproj and DigitalData.Core.Infrastructure to v2.6.0 in ReC.Infrastructure.csproj. No other changes made.
2025-12-19 11:01:05 +01:00
7c687c0541 Remove Root property from ResultView entity
Removed the Root navigation property and its [ForeignKey("Id")] attribute from the ResultView class, as it is no longer needed. No other changes were made to the class structure.
2025-12-17 12:50:48 +01:00
48e9812224 Add handler for CreateResultViewCommand with repository
Added CreateResultViewCommandHandler to process creation of ResultView entities using IRepository<ResultView>. Also updated using directives to include necessary repository and entity namespaces.
2025-12-17 11:55:23 +01:00
1199c61ae8 Add AuthScopedFilter to set AddedWho via middleware
Introduce AuthScopedFilter to automatically set the AddedWho property on IAuthScoped commands using configuration, and register it globally for all controllers. Remove manual AddedWho assignment from ResultViewController. Make AddedWho nullable in AuthScope and IAuthScoped.
2025-12-17 11:52:59 +01:00
a55b51e504 Set AddedWho from config in Create; make property mutable
Changed AuthScope.AddedWho to be mutable (get; set;). In ResultViewController, set AddedWho from configuration in the Create action and throw an error if missing. Ensures AddedWho is always set and configuration issues are clearly reported.
2025-12-17 11:51:48 +01:00
752f781f54 Add AuthScopedValidator and register FluentValidation
Introduced AuthScopedValidator to enforce non-empty AddedWho on IAuthScoped entities with a clear error message. Registered all validators from the assembly in DI to enable automatic validation for authentication-scoped entities.
2025-12-17 11:37:58 +01:00
9b800dce20 Add POST endpoint to create ResultView in controller
Added a new HTTP POST action to ResultViewController that accepts a CreateResultViewCommand in the request body. On success, it returns a 201 Created response with a reference to the Get action for the created resource. This enables clients to create new ResultView entries via the API.
2025-12-17 11:17:14 +01:00
0fa1a418de Refactor validation behavior and update result view command
Refactored ValidationBehavior to use C# 12 primary constructors and file-scoped namespaces, simplifying the Handle method logic. Updated CreateResultViewCommand to implement IAuthScoped and IRequest, replaced AddedWho with a non-serialized Scope property, and added necessary usings and namespace.
2025-12-17 11:16:48 +01:00
cc54539aba Refactor scope handling with new IScoped and AuthScope
Introduce IScoped<TScope> interface for unified scope access and add AuthScope record. Remove legacy IScopedRequest interfaces to streamline scope management across the application.
2025-12-17 11:16:22 +01:00
ac4c4cb69a Add generic scoped request interfaces for MediatR support
Introduced IScopedRequestBase<TScope>, IScopedRequest<TScope>, and IScopedRequest<TScope, TResponse> interfaces to enable requests with scope information. These interfaces extend MediatR's IRequest types and enforce non-nullable scope types for improved request handling.
2025-12-17 10:41:04 +01:00
73ccb9e43b Add AutoMapper profile for CreateResultViewCommand mapping
Introduced a MappingProfile in ReC.Application.ResultViews to map CreateResultViewCommand to ResultView, setting AddedWhen to DateTime.UtcNow during mapping. Included necessary using directives.
2025-12-17 10:26:29 +01:00
b6ab59ae4a Add CreateResultViewCommand class for result view creation
Introduced CreateResultViewCommand in the ReC.Application.ResultViews.Commands namespace. This class includes properties for ActionId, StatusCode, Header, Body, and AddedWho, and will be used as a command or DTO for creating ResultView entities.
2025-12-17 10:13:33 +01:00
868e11ff62 Annotate ProfileView with table mapping attribute
Added [Table("VWREC_PROFILE", Schema = "dbo")] to ProfileView to specify its database table mapping. Included necessary using directive for DataAnnotations.Schema.
2025-12-17 09:39:25 +01:00
38d819adac Map ResultView to VWREC_RESULT with Table attribute
Explicitly map ResultView entity to "VWREC_RESULT" in the "dbo" schema using the [Table] attribute to ensure correct Entity Framework mapping.
2025-12-17 09:38:32 +01:00
9b3bb925f9 Refactor ResultType enum location and naming for clarity
Move ResultType enum to ReC.API.Models/ResultType.cs and update its values from Header/Body to OnlyHeader/OnlyBody for improved clarity. Update all controller usages and documentation to reflect these changes.
2025-12-17 09:35:24 +01:00
a92d57d9cf Return 404 for null body/header in result controllers
Previously, OutResController and ResultViewController returned HTTP 200 OK with an empty object when the response body or header was null. Now, they return HTTP 404 Not Found in these cases, providing more accurate HTTP status codes for missing resources. Non-null bodies or headers continue to return HTTP 200 OK with the deserialized content.
2025-12-17 09:31:58 +01:00
39fcee2b50 Add ResultViewController for output result retrieval
Introduce ResultViewController with endpoints to fetch output results by query, for fake/test profiles, and by action ID. Supports returning full, header, or body parts of results via a new ViewResultType enum. Utilizes MediatR and configuration injection for flexible and testable result access. Includes XML docs for improved API clarity.
2025-12-16 12:51:17 +01:00
d0597e28e8 Mark OutResController as obsolete with deprecation notice
Added [Obsolete] attribute to OutResController, indicating it is deprecated and will be removed in future versions. Developers are advised to use ResultViewController instead.
2025-12-15 17:13:05 +01:00
d8d77652ac Implement ReadResultViewQuery handler with filtering
Added ReadResultViewQueryHandler to support querying ResultView entities with optional filters (Id, ActionId, ProfileId). Integrated repository and AutoMapper, included error handling for no results, and improved using directives.
2025-12-15 17:11:23 +01:00
62612897bd Add ReadResultViewQuery and clean up DTO namespace
Introduced ReadResultViewQuery for querying result views with optional filters (Id, ActionId, ProfileId). Cleaned up ResultViewDto.cs by removing an unused using directive and reformatting the namespace declaration. Added necessary usings to support the new query.
2025-12-15 17:05:49 +01:00
99c50fb348 Make ResultViewDto immutable; add Root property
Refactored ResultViewDto to use init-only properties for immutability. Added a new Root property of type OutResDto?. Included a using directive for ReC.Domain.Entities to support the new property.
2025-12-15 17:02:11 +01:00
8aaf11f39d Add Root navigation property to ResultView with FK
Added OutRes? Root navigation property to ResultView, annotated with [ForeignKey("Id")], to establish an optional relationship to the OutRes entity. Also added the necessary using directive for DataAnnotations.Schema.
2025-12-15 17:01:35 +01:00
152189fefd Refactor: Rename RecResultViewDto to ResultViewDto
Replaced all usage of RecResultViewDto with ResultViewDto for improved naming consistency. Updated AutoMapper profile to map ResultView to ResultViewDto. Removed RecResultViewDto.cs and added ResultViewDto.cs with the same properties. No functional changes.
2025-12-15 16:57:05 +01:00