Commit Graph

358 Commits

Author SHA1 Message Date
5a4b8427be Rename RecResultView entity to ResultView throughout codebase
Replaced RecResultView with ResultView, updating all references in DbContext, entity mapping, and AutoMapper profiles. Added the new ResultView class and removed the old RecResultView class. No changes to properties or structure.
2025-12-15 16:56:37 +01:00
e4a644a636 Add mappings for RecResultView and ProfileView DTOs
Added AutoMapper profile mappings for RecResultView to RecResultViewDto and ProfileView to ProfileViewDto to enable automatic entity-to-DTO conversions.
2025-12-15 16:55:45 +01:00
25c6c41b26 Add RecResultViewDto for result view data representation
Introduced RecResultViewDto in the ReC.Application.Common.Dto namespace. This DTO encapsulates properties for result entity view data, including related action and profile details, status, content, and audit information.
2025-12-15 16:53:25 +01:00
c672a10c97 Add navigation properties to RecResultView class
Added Action and Profile navigation properties to RecResultView, enabling direct access to related RecActionView and ProfileView data for improved object relationships and easier data retrieval in views or APIs.
2025-12-15 16:45:46 +01:00
1e21218f31 Make RecResultView properties nullable for flexibility
Changed ActionId, ProfileId, StatusCode, AddedWho, and AddedWhen
to nullable types in RecResultView to better support optional or
missing data scenarios. This improves compatibility with cases
where these fields may not always have values.
2025-12-15 16:43:39 +01:00
68e7ee54f9 Rename StatusId/Status to StatusCode/StatusName for clarity
Renamed the StatusId property to StatusCode and Status to StatusName in RecResultView. Updated RecDbContext mappings accordingly to maintain consistency and improve code clarity.
2025-12-15 16:42:01 +01:00
2a749267b3 Rename ResultHeader/ResultBody to Header/Body in RecResultView
Renamed the ResultHeader and ResultBody properties in the RecResultView class to Header and Body. Updated the RecDbContext entity configuration to map these new property names to the existing RESULT_HEADER and RESULT_BODY database columns. No changes were made to the database schema.
2025-12-15 16:35:15 +01:00
edc1de2034 Add RecResultView entity and DbSets to RecDbContext
Added DbSet properties for RecResultView and OutRes to RecDbContext. Configured entity mapping for RecResultView to the VWREC_RESULT view, including key and property-to-column mappings. This enables querying RecResultView and OutRes through the context.
2025-12-15 16:33:57 +01:00
ae79a60605 Add RecResultView entity for recommendation results
Introduced the RecResultView class in the ReC.Domain.Entities namespace. This class encapsulates properties related to recommendation results, including identifiers, status, result details, and audit metadata such as who added or changed the result and when.
2025-12-15 16:33:41 +01:00
6b8286a386 Move logging config to appsettings.Logging.json
Extracted "Logging" and "NLog" sections from appsettings.json into a new appsettings.Logging.json file. No changes were made to the logging settings themselves; this improves configuration separation and maintainability.
2025-12-15 16:15:01 +01:00
1fabc29e4f Auto-load appsettings.*.json files at startup
Dynamically adds all appsettings.*.json files in the root directory to the configuration, excluding appsettings.Development.json and appsettings.migration.json. This streamlines configuration management by automatically including relevant environment or custom config files.
2025-12-15 15:51:31 +01:00
56fb34d987 Update Status property mapping to STATUS_ID column
Changed the database column mapping for the Status property from "STATUS" to "STATUS_ID" to ensure correct association with the updated schema.
2025-12-15 15:31:30 +01:00
47ddde239e Update ProfileType mapping to PROFILE_TYPE_ID column
Changed the entity configuration to map the ProfileType property to the "PROFILE_TYPE_ID" column instead of "PROFILE_TYPE" for consistency with database schema.
2025-12-15 15:23:32 +01:00
5a4d2d8553 Update profile type fields to use ProfileType enum
Replaced byte/byte? with the strongly-typed ProfileType/ProfileType? enum for profile type fields in ProfileView and RecActionView. Added the necessary using directive for ReC.Domain.Constants. This improves type safety and code readability.
2025-12-15 15:07:47 +01:00
4e209e29fc Refactor ReadRecActionViewQuery for optional ProfileId
Refactored ReadRecActionViewQuery to remove base class inheritance and make ProfileId optional. Simplified query construction and filtering logic in the handler to conditionally filter by ProfileId only when provided. Removed unused constructors and methods for a cleaner API.
2025-12-15 15:07:26 +01:00
78aaea67e6 Refactor InvokeBatchRecActionViewsCommand structure
Decouple InvokeBatchRecActionViewsCommand from ReadRecActionQueryBase, making it a plain IRequest with an explicit ProfileId property. Update the extension and handler to use the new structure, improving clarity and separation of concerns.
2025-12-15 15:06:46 +01:00
98261f4e21 Refactor ProfileType to enum in RecActionViewDto
Changed ProfileType from string? to ProfileType? enum for improved type safety. Updated URI scheme assignment to use ToUriBuilderScheme(), centralizing scheme mapping logic.
2025-12-15 15:05:56 +01:00
aab8174500 Add ProfileType enum and extension for URI scheme
Introduced the ProfileType enum with Http and Https values in the ReC.Domain.Constants namespace. Added ProfileTypeExtensions with a ToUriBuilderScheme method to convert enum values to their lowercase string representations for URI building.
2025-12-15 15:05:10 +01:00
fb6d6af12b Change ProfileType to byte? in RecActionView
Updated the ProfileType property in RecActionView from string? to byte? to improve type safety and performance by using a numeric value instead of a string.
2025-12-15 14:37:57 +01:00
f82f4d2c65 Refactor RestType enum: remove Invalid, use byte
RestType now inherits from byte for efficiency. The Invalid value has been removed from the enum, and the IsValid extension method was updated to reflect this change by only checking for None.
2025-12-15 14:35:26 +01:00
90ee3f6a5d Explicitly set ErrorAction enum underlying type to byte
Changed ErrorAction enum declaration to use byte as its underlying type for improved memory efficiency and clarity.
2025-12-15 14:28:13 +01:00
a24ec1ab3e Set ApiKeyLocation enum underlying type to byte
Changed ApiKeyLocation enum to use byte as its underlying type instead of the default int, reducing memory usage and improving clarity for serialization scenarios.
2025-12-15 14:27:45 +01:00
b8c30d520e Set EndpointAuthType enum underlying type to byte
Explicitly define EndpointAuthType as a byte-based enum for improved memory efficiency and better interoperability with systems requiring a specific underlying type.
2025-12-15 14:22:13 +01:00
f69f323542 Make ProfileView string properties nullable
Changed several ProfileView properties (Type, Mandantor, ProfileName, LogLevel, Language, AddedWho) from non-nullable strings with default values to nullable strings. This allows these fields to be null instead of defaulting to an empty string.
2025-12-15 14:03:15 +01:00
3621820060 Refactor RecActionView Profile property; add ProfileViewDto
Changed RecActionView.Profile to use ProfileView type instead of Profile entity. Added new ProfileViewDto class to represent profile data as a DTO, including related properties and audit fields.
2025-12-15 14:01:11 +01:00
0e0f27c124 Rename ProfileGuid to Id in ProfileView and DbContext
Renamed the ProfileGuid property to Id in the ProfileView record.
Updated all DbContext mappings and primary key definitions to use
Id, while maintaining the mapping to the PROFILE_GUID column in
the database view.
2025-12-15 13:51:16 +01:00
5404530785 Add ProfileView entity mapped to VWREC_PROFILE view
Introduced the ProfileView entity as a record to represent data from the VWREC_PROFILE database view. Registered ProfileView in RecDbContext and configured its property mappings and primary key in OnModelCreating. This enables querying profile data via EF Core.
2025-12-15 13:51:00 +01:00
289b6109e4 Refactor DeleteRecActionsCommand to use RecAction entity
Switched from using RecActionDto to RecAction entity in the
DeleteRecActionsCommandHandler and updated repository types
and using statements accordingly. This aligns the handler
with domain-driven design and improves consistency.
2025-12-15 13:24:11 +01:00
679c065aaa Refactor CreateRecAction to use domain entities
Switched from using RecActionDto to RecAction domain entity in the CreateRecActionCommandHandler and updated relevant imports. This aligns the command handler with domain-driven design principles.
2025-12-15 13:23:56 +01:00
a02cac8778 Refactor handler to use AutoMapper and entity repository
Updated ObtainEndpointCommandHandler to depend on IRepository<Endpoint> and IMapper. Now maps Endpoint entities to EndpointDto using AutoMapper before returning, ensuring proper separation of concerns and DTO exposure.
2025-12-15 13:08:21 +01:00
42fd176fad Refactor RestType null check with pattern matching
Refactored the null check for action.RestType to use pattern matching, assigning it to a local variable restType if not null. Now throws DataIntegrityException if RestType is null, and uses restType for creating the HttpRequestMessage. This improves code clarity and ensures RestType is non-null in subsequent logic.
2025-12-15 12:53:43 +01:00
e529027587 Refactor HTTP method handling to use RestType enum
Replaced string-based HTTP method mapping with a strongly-typed RestType enum for improved type safety. Updated the ToHttpMethod extension to accept RestType, validate its value, and convert it to the appropriate HttpMethod. This reduces errors from invalid or misspelled method names.
2025-12-15 12:48:10 +01:00
cc2adab5e5 Rename ToHttpMethod to ToHttpMethodName in RestTypeExtensions
Renamed the extension method ToHttpMethod to ToHttpMethodName in the RestTypeExtensions class for improved clarity. The method's functionality remains unchanged; it still returns the uppercase string representation of the RestType enum value.
2025-12-15 12:47:59 +01:00
a0233fd876 Update RecActionViewDto: new props, type changes, renames
Renamed ProfileSequence to Sequence. Added display name properties for enums/types (e.g., EndpointAuthTypeName, RestTypeName, ErrorActionName). Added EndpointAuthApiKey. Changed RestType to enum and ErrorAction to nullable, with corresponding name properties.
2025-12-15 12:37:33 +01:00
0afe9870c0 Update RecActionView model and mapping for enums and names
Refactored RecActionView to use enum types for EndpointAuthType, ApiKeyLocation, and RestType, and added properties for their display names. Introduced ErrorAction and its display name. Updated RecDbContext mapping to treat RecActionView as a view with a key, map new enum ID and name fields, and align property mappings with the database view structure. This enhances clarity and supports both ID and human-readable values in the model.
2025-12-15 12:01:39 +01:00
784b4b1f05 Refactor to use DTOs instead of domain entities
Replaced references to ReC.Domain.Entities with ReC.Application.Common.Dto across multiple files to use DTOs in the application layer. Updated MappingProfile.cs namespace to ReC.Application.RecActionViews and adjusted using statements accordingly. These changes improve separation of concerns and ensure commands and mappings operate on DTOs rather than domain entities.
2025-12-15 11:58:43 +01:00
1634b4b7b1 Add RestType enum and extension methods for HTTP verbs
Introduced RestType enum in ReC.Domain.Constants to represent HTTP methods, including support for None and Invalid values. Added RestTypeExtensions with ToHttpMethod and IsValid methods to facilitate HTTP method handling and validation.
2025-12-15 11:40:44 +01:00
576b2d59d9 Update IRecDbContext to use domain model DbSet types
Changed DbSet properties in IRecDbContext from DTO types to their corresponding domain model classes for Connections, Endpoints, EndpointAuths, Profiles, and RecActions. This aligns the interface with the domain model and removes reliance on DTOs.
2025-12-15 11:30:48 +01:00
3da16ba640 Introduce DTOs and refactor app layer to use them
Added DTO classes for Connection, Endpoint, EndpointAuth, EndpointParam, Profile, and RecAction. Updated AutoMapper profiles, DbContext, and command handlers to use DTOs instead of domain entities. This decouples the application layer from the domain model, improving maintainability and flexibility. Cleaned up some using directives and file headers.
2025-12-12 15:16:38 +01:00
71a0220c3f Refactor: replace RecActionDto with RecActionViewDto
Standardize usage of RecActionViewDto across the codebase:
- Update pipeline behaviors, mapping profiles, and commands to use RecActionViewDto.
- Remove RecActionDto and introduce RecActionViewDto with equivalent properties and methods.
- Adjust query handlers and related interfaces to work with RecActionViewDto.
This clarifies DTO usage and aligns the model with domain intent.
2025-12-12 15:04:43 +01:00
f53603083a Refactor batch invocation to use RecActionViews
Replaced all batch RecAction logic with RecActionViews equivalents. Updated controller methods to call InvokeBatchRecActionView instead of InvokeBatchRecAction. Removed InvokeBatchRecActionsCommand and its handler, and added InvokeBatchRecActionViewsCommand with similar logic for RecActionViews. This shifts batch processing from RecActions to RecActionViews across the codebase.
2025-12-12 15:00:26 +01:00
92e7d44d3b Rename InvokeRecActionCommand to InvokeRecActionViewCommand
Refactored the RecAction invocation logic by renaming and moving InvokeRecActionCommand.cs to InvokeRecActionViewCommand.cs. Updated all class, record, and extension method names accordingly. The command handling logic remains unchanged, but all references and namespaces now reflect the new naming. Removed the old InvokeRecActionCommand.cs file.
2025-12-12 14:58:33 +01:00
f8211e9e9d Refactor RecAction query to use ReadRecActionViewQuery
Replaced ReadRecActionQuery and its handler with ReadRecActionViewQuery and ReadRecActionViewQueryHandler. Updated controller methods to use the new query type. This change clarifies and consolidates RecAction view query logic, improving code organization and domain alignment.
2025-12-12 14:52:11 +01:00
1782844543 Refactor RecAction commands to new namespace
Moved CreateRecActionCommand and DeleteRecActionsCommand (and their handlers) from ReCActionViews.Commands to ReCActions.Commands. Updated all references in controller and mapping profile. Removed old files to improve code organization. No changes to command logic.
2025-12-12 14:47:48 +01:00
2aa7cabcbd Refactor RecActions to RecActionViews namespaces
Renamed command and query files, namespaces, and usings from RecActions to RecActionViews for improved clarity and organization. Updated controller and mapping profile references accordingly. No changes to business logic or handler implementations.
2025-12-12 14:43:32 +01:00
28f35101f9 Refactor auth type to enum in RecActionDto and handler
Changed EndpointAuthType from string to enum in RecActionDto. Updated InvokeRecActionCommandHandler to use enum values in switch statements for improved type safety and maintainability.
2025-12-12 14:00:09 +01:00
f8c5502905 Refactor auth type properties to use strong enum type
Changed Type in EndpointAuth and EndpointAuthType in RecActionView from string? to EndpointAuthType? for improved type safety and clarity. This enforces the use of a specific enum for authentication types instead of plain strings.
2025-12-12 13:58:39 +01:00
961b87de3d Add EndpointAuthType enum for endpoint authentication types
Introduced the EndpointAuthType enum in the ReC.Domain.Constants namespace to represent various endpoint authentication methods, including NoAuth, ApiKey, BearerToken, JwtBearer, BasicAuth, DigestAuth, OAuth1, OAuth2, AwsSignature, and NtlmAuth. Each type is assigned a unique integer value for clear identification.
2025-12-12 13:57:52 +01:00
6b036f4f91 Add EF Core data annotations for table and FK mapping
Added [Table] and [ForeignKey] attributes to entity classes to explicitly map them to database tables/views and define relationships. Updated using directives as needed. Improves entity mapping clarity and robustness against schema changes.
2025-12-12 13:55:22 +01:00
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