Commit Graph

736 Commits

Author SHA1 Message Date
ba8ab28b03 Refactor: group Result reference fields into References obj
Refactored InsertObjectProcedureHandler and UpdateObjectProcedureHandler to access RESULT_REFERENCE1-5 via the new Result.References object instead of individual fields. This improves encapsulation and organizes related reference data within the Result model.
2026-04-15 12:54:51 +02:00
4cc8d22756 Update InsertResultCommand Info property to use integer
Changed the Info property in InsertResultCommand initialization from a string ("200") to an integer (200) to match the expected data type. This ensures type consistency in the test setup.
2026-04-15 11:48:38 +02:00
2a4378eb9a Set Info to numeric HTTP status code in result object
Changed the Info property to store the raw (short) HTTP status code
from response.StatusCode instead of using the formatted output from
ResultView.FormatHttpStatusInfo. This provides a simpler, numeric
representation of the HTTP status in the result.
2026-04-15 11:48:20 +02:00
cb5bbfb722 Change Info to short? and update DB param to pRESULT_INFO_ID
Changed UpdateResultDto.Info from string? to short? for type safety. Updated UpdateObjectProcedureHandler to use pRESULT_INFO_ID with SqlDbType.SmallInt, reflecting the new type.
2026-04-15 11:46:40 +02:00
2736a78d4f Change Info from string to short and update parameter name
Changed the Info property in InsertResultCommand from string? to short?.
Renamed the related parameter in InsertObjectProcedureHandler from pRESULT_INFO to pRESULT_INFO_ID and set its type to SqlDbType.SmallInt to match the new property type.
2026-04-15 11:45:46 +02:00
ddb8b2673e Add support for five new RESULT_REFERENCE parameters
Added pRESULT_REFERENCE1 through pRESULT_REFERENCE5 to the stored procedure call, mapping them to the corresponding Reference1–Reference5 properties in request.Result. This allows passing additional reference data with the procedure execution.
2026-04-14 20:43:43 +02:00
a70aee6e28 Add Reference1-5 properties to UpdateResultDto
Added five optional string properties (Reference1 through Reference5) to UpdateResultDto for storing additional reference information related to update results. This enhances the DTO's flexibility for carrying extra context as needed.
2026-04-14 20:43:01 +02:00
f329543793 Add support for five new RESULT_REFERENCE parameters
Added pRESULT_REFERENCE1 through pRESULT_REFERENCE5 to the procedure handler, mapping them from the corresponding Reference1-5 properties in request.Result. This enables passing additional reference data to the stored procedure.
2026-04-14 20:42:41 +02:00
645891150c Add Reference1-5 properties to InsertResultCommand
Added five optional string properties (Reference1-5) to the InsertResultCommand record to support storing additional reference information with each command instance. This enhances flexibility for passing extra data as needed.
2026-04-14 20:41:53 +02:00
95cb34394c Add ProfileTypeName property to RecActionView
Added the ProfileTypeName string property to RecActionView, mapped to the "PROFILE_TYPE" column, to store the profile type name alongside the existing ProfileType property.
2026-04-14 20:40:16 +02:00
83d6832236 Add InfoId and Reference fields to ResultView model
Added InfoId and Reference1–Reference5 properties to the ResultView class, each mapped to corresponding database columns. These fields enable storage and retrieval of additional result-related information and references.
2026-04-14 20:40:00 +02:00
e816340755 Improve HTTP status info formatting in result views
Replaced the simple status code string with ResultView.FormatHttpStatusInfo for the Info field, providing more descriptive HTTP status information. Added the ReC.Domain.Views namespace import to support this change.
2026-04-02 21:02:32 +02:00
64e8e2a5cc Add HTTP status formatting/parsing to ResultView
Added FormatHttpStatusInfo and ParseHttpStatusInfo methods to ResultView for converting between HttpStatusCode values and "statusCode statusName" strings. Included supporting Regex and necessary using directives.
2026-04-02 21:02:15 +02:00
0edf2626a7 Add Info property to InsertResultCommand in test
The InsertResultProcedure_runs_via_mediator test now sets the Info property to "200" when initializing InsertResultCommand, ensuring the command includes this field during testing.
2026-04-02 20:39:05 +02:00
1d16276a8a Add InfoDetail property to InsertResultCommand
Added a nullable string property InfoDetail to InsertResultCommand to allow storing additional detailed information with each result. No other changes were made.
2026-04-02 20:38:55 +02:00
4eae092031 Update result handling and error status in command handler
Removed unused statusCode variable and now store HTTP status code as a string in the Info field. Changed exception handling to set Status to RecStatus.Error instead of RecStatus.Failed.
2026-04-02 20:38:01 +02:00
ce7fe03525 Add InfoDetail property to ResultView model
Added the InfoDetail property to the ResultView class, mapping it to the RESULT_INFO_DETAIL column in the database. This allows for storing and retrieving additional result detail information.
2026-04-02 20:37:46 +02:00
a93780df5c Add Info, InfoDetail, and Error to UpdateResultDto
Extended UpdateResultDto with Info, InfoDetail, and Error fields. Updated UpdateObjectProcedureHandler to pass these new properties as parameters to the stored procedure, enabling richer result and error reporting in database updates.
2026-04-02 20:37:29 +02:00
d7a2a01421 Add pRESULT_INFO_DETAIL param to InsertObjectProcedureHandler
Added support for the pRESULT_INFO_DETAIL parameter in the database command, mapping it from request.Result?.InfoDetail to enable passing detailed result information to the stored procedure.
2026-04-02 20:36:51 +02:00
329e441ede Standardize InsertResultCommand status and info fields
Updated InsertResultCommand usage to replace QuerySuccess with OK and Failed with Error for status reporting. Changed Info to InfoDetail for both preprocessing and postprocessing behaviors to ensure consistent result and error handling.
2026-04-02 20:36:35 +02:00
1ad7ff3b34 Add InfoDetail property to ResultViewDto
Added a nullable string property InfoDetail with a public setter to the ResultViewDto record for storing additional detailed information. No changes were made to the existing Error property.
2026-04-02 20:36:03 +02:00
bcfbd851bd Simplify RecStatus to OK/Error and update extensions
Refactored the RecStatus enum to only include OK and Error values,
removing all HTTP status code mappings and related documentation.
Updated RecStatusExtensions to map HTTP 2xx codes to OK and all
others to Error, and removed obsolete conversion and success logic.
This clarifies the separation between general operation status and
protocol-specific details.
2026-04-02 20:35:48 +02:00
2e157656a7 Update validator registration assembly in DI setup
Changed validator registration to use the assembly containing InsertObjectProcedureValidator instead of AuthScopedValidator, ensuring the correct set of validators are included in the dependency injection container.
2026-03-30 15:36:18 +02:00
8042a6f898 Update project version to 2.1.0-beta
Bump version numbers in ReC.API.csproj from 2.0.2-beta to 2.1.0-beta, including Version, AssemblyVersion, FileVersion, and InformationalVersion fields. No other changes were made.
2026-03-30 14:53:01 +02:00
f25fc627fe Update AutoMapper to version 16.1.1
Upgraded the AutoMapper NuGet package in ReC.Application.csproj from version 15.1.0 to 16.1.1 to ensure compatibility with the latest features and bug fixes. No other dependencies were changed.
2026-03-30 14:48:17 +02:00
d6af24cd91 Remove PlaceholderResolutionException class
Deleted the PlaceholderResolutionException class and its namespace. This exception was previously used for unresolved placeholders due to missing properties. All related properties and custom messages have been removed.
2026-03-30 14:33:23 +02:00
bb5eac023c Change ReplacePlaceholders to return NULL for unresolved
Previously, ReplacePlaceholders threw PlaceholderResolutionException when a placeholder could not be resolved. Now, unresolved placeholders are replaced with "NULL" instead. All exception references and related tests have been updated to reflect this new behavior. Documentation has also been revised accordingly.
2026-03-30 14:33:13 +02:00
77baf395ce Update ReplacePlaceholders mapping to use single argument
Removed src.Profile from ReplacePlaceholders calls in DtoMappingProfile for PreprocessingQuery and PostprocessingQuery mappings, now passing only src as the argument. This simplifies the mapping logic and aligns with the updated method signature.
2026-03-30 14:32:31 +02:00
6c9eab6df6 Refactor ResultViewDto status and add info/error fields
Replaced StatusCode with a RecStatus Status property in ResultViewDto. Added Info and Error string properties to provide additional result details. Imported ReC.Domain.Constants for RecStatus usage.
2026-03-30 13:21:48 +02:00
c64794755d Remove "EXEC" from stored procedure call in builder
Standardize StoredProcedureBuilder usage by omitting the "EXEC" keyword when specifying the procedure name. This ensures consistent and correct invocation of stored procedures.
2026-03-30 13:21:11 +02:00
de2185bf0a Specify byte as underlying type for ResultType enum
Changed ResultType enum declaration to explicitly use byte as its underlying type for improved memory efficiency and clarity.
2026-03-30 13:20:40 +02:00
fde9735b27 Remove redundant Result property validation in InsertObject
Removed the rule requiring Result to have StatusId, Info, or Error set. Now only ResultActionId is required when Result is present.
2026-03-30 13:20:21 +02:00
0342b9e0c6 Unify error status code as RecStatus.Failed
Renamed RecStatus.QueryFailed to RecStatus.Failed and updated all usages and documentation to reflect its broader purpose as a general failure code for any operation, not just SQL queries. Improved consistency in error handling and status reporting across the codebase.
2026-03-30 11:55:58 +02:00
47698b9046 Rename ToStatus to ToRecStatus for HttpStatusCode conversion
Standardize extension method naming by renaming ToStatus to ToRecStatus for converting HttpStatusCode to RecStatus across the codebase. Updated all usages and related tests for consistency and clarity.
2026-03-30 11:40:26 +02:00
a03d21ebc6 Rename StatusExtensions to RecStatusExtensions for clarity
Renamed the StatusExtensions class and related XML documentation references to RecStatusExtensions to better reflect its association with the RecStatus enum and improve code clarity and consistency.
2026-03-30 11:39:37 +02:00
acff0aca89 Rename Status enum to RecStatus across the codebase
Refactored all usages of the Status enum to RecStatus to improve clarity and prevent naming conflicts with other status enums (e.g., HTTP status codes). Updated command handlers, behaviors, data models, and extension methods to use RecStatus, and adjusted related serialization logic accordingly. This makes the domain-specific status handling more explicit and maintainable.
2026-03-30 11:35:22 +02:00
ce0e53baf6 Update test for InsertResultCommand Status property change
Refactored InsertResultProcedure_runs_via_mediator to use the new Status property (set via HttpStatusCode.OK.ToStatus()) instead of the old StatusId integer. Added necessary using directives to support updated types and methods.
2026-03-30 11:33:42 +02:00
620c0eff22 Add ToStatus extension for HttpStatusCode to Status conversion
Introduced a ToStatus extension method in StatusExtensions to enable direct conversion from HttpStatusCode to Status by casting. This simplifies mapping between HTTP status codes and internal Status values.
2026-03-30 11:33:28 +02:00
68f4486fa1 Make Status required in InsertResultCommand
Changed the Status property in InsertResultCommand from nullable to required, ensuring that a Status value must always be provided when creating an instance. This improves data integrity and prevents accidental omission of the Status field.
2026-03-30 11:33:08 +02:00
2b5e63cb45 Update result status handling in InsertResultCommand
Replaced StatusId with Status property in InsertResultCommand, mapping HTTP status codes to application-specific status enums using ToStatus(). Exception handling now sets Status to QueryFailed. Removed usage of StatusId.
2026-03-30 11:22:57 +02:00
e9e697fa0d Update to use Result.Status instead of StatusId in insert proc
Changed the parameter for "pRESULT_STATUS_ID" from request.Result?.StatusId to request.Result?.Status in InsertObjectProcedureHandler. This aligns with updates to the data model or business logic, ensuring the correct status property is used when inserting objects.
2026-03-30 11:22:27 +02:00
606eccb855 Add Status to InsertResultCommand for query outcome reporting
Enhance PostprocessingBehavior and PreprocessingBehavior to set the Status property on InsertResultCommand. Status is now set to QuerySuccess on successful execution and QueryFailed on exceptions, improving clarity of query execution results.
2026-03-30 11:11:51 +02:00
3146acfa45 Refactor InsertResultCommand to use Status enum
Replaced StatusId (short?) with Status (Status?) in InsertResultCommand, moving from a numeric status identifier to a more descriptive or structured status representation from ReC.Domain.Constants.
2026-03-30 11:11:28 +02:00
f363872e7a Refactor ResultView: replace StatusCode with Status object
Replaced the short? StatusCode property in ResultView with a Status object to provide a more descriptive representation of status information. This change improves code clarity and supports richer status handling.
2026-03-30 10:51:58 +02:00
ed4683323d Change Status enum underlying type to short
Explicitly set the Status enum's underlying type to short instead of the default int to optimize memory usage and clarify intent. No other changes were made.
2026-03-30 10:50:33 +02:00
4aeef10ef7 Add StatusExtensions with HTTP status mapping methods
Added StatusExtensions.cs with extension methods for Status and HttpStatusCode:
- ToHttpStatusCode maps Status to nullable HttpStatusCode if possible.
- IsSuccess checks if a Status or HttpStatusCode represents a successful response.
- Handles both direct Status values and those convertible to HTTP codes.
2026-03-30 10:41:39 +02:00
e04e90d8c6 Add Status enum for HTTP and SQL operation status codes
Introduced Status enum in ReC.Domain.Constants to unify status reporting for both HTTP responses and SQL query execution results. The enum includes all standard HTTP status codes and custom codes for SQL query success/failure, with detailed documentation for each value. This standardizes status handling across web and database operations.
2026-03-30 10:41:09 +02:00
93b5f976d3 Refactor stored procedure SQL construction and execution
Centralize stored procedure SQL generation in StoredProcedureBuilder,
allowing handlers to specify procedure name and return variable.
Removes manual SQL string building from DeleteObjectProcedure and
UpdateObjectProcedure handlers, reducing boilerplate and improving
maintainability.
2026-03-30 09:30:07 +02:00
b66a49f74d Refactor: add StoredProcedureBuilder for SQL calls
Introduce StoredProcedureBuilder to centralize and simplify the construction of SQL stored procedure calls and parameter lists. Refactor DeleteObjectProcedureHandler, InsertObjectProcedureHandler, and UpdateObjectProcedureHandler to use this utility, replacing manual StringBuilder and parameter management. Improves code readability, reduces duplication, and standardizes parameter handling, including output parameters.
2026-03-27 15:11:16 +01:00
70dc52139d Refactor SQL param and command construction in procedures
Refactored InsertObject, UpdateObject, and DeleteObject procedure handlers to dynamically build SQL command strings and parameter lists. Introduced local Add functions to include only non-null parameters, improving code clarity and reducing unnecessary SQL parameter passing. The logic for handling stored procedure results and exceptions remains unchanged.
2026-03-27 14:58:56 +01:00