ReC/src/ReC.Domain/Entities/RecActionView.cs
TekH 4b9f375646 Refactor to use RecActionView instead of RecAction
Replaced `RecAction` with `RecActionView` across the codebase to align with the `VWREC_ACTION` database view. Updated mappings, interfaces, and repository registrations accordingly.

- Updated `DtoMappingProfile` to map `RecActionView` to `RecActionDto`.
- Modified `IRecDbContext` to use `DbSet<RecActionView>`.
- Refactored `ReadRecActionQueryHandler` to use `IRepository<RecActionView>`.
- Removed the `RecAction` class entirely.
- Updated `DependencyInjection` to register `RecActionView`.
- Adjusted `RecDbContext` to replace `RecAction` with `RecActionView` and configure it as a keyless entity.
- Introduced the `RecActionView` class, mirroring the structure of the removed `RecAction` class, with nullable properties for schema flexibility.
2025-12-01 13:32:57 +01:00

117 lines
3.3 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ReC.Domain.Entities;
/// <summary>
/// Represents the VWREC_ACTION view from the database.
///
/// All properties are defined as nullable to provide flexibility in case the underlying view
/// changes in production (e.g., columns added, removed, or modified). This approach prevents
/// runtime mapping errors and ensures the application can handle schema changes without
/// requiring immediate code updates.
/// </summary>
[Table("VWREC_ACTION", Schema = "dbo")]
public class RecActionView
{
[Column("ACTION_ID")]
public required long Id { get; set; }
[Column("PROFILE_ID")]
public long? ProfileId { get; set; }
[Column("PROFILE_NAME")]
[MaxLength(100)]
public string? ProfileName { get; set; }
[Column("PROFILE_TYPE")]
[MaxLength(20)]
public string? ProfileType { get; set; }
[Column("PROFILE_SEQUENCE")]
public byte? ProfileSequence { get; set; }
[Column("ENDPOINT_ID")]
public long? EndpointId { get; set; }
[Column("ENDPOINT_URI")]
[MaxLength(4000)]
public string? EndpointUri { get; set; }
[Column("ENDPOINT_AUTH_ID")]
public long? EndpointAuthId { get; set; }
[Column("ENDPOINT_AUTH_TYPE")]
[MaxLength(50)]
public string? EndpointAuthType { get; set; }
[Column("ENDPOINT_AUTH_API_KEY")]
[MaxLength(300)]
public string? EndpointAuthApiKey { get; set; }
[Column("ENDPOINT_AUTH_API_VALUE")]
[MaxLength(300)]
public string? EndpointAuthApiValue { get; set; }
[Column("ENDPOINT_AUTH_API_KEY_ADD_TO")]
[MaxLength(20)]
public string? EndpointAuthApiKeyAddTo { get; set; }
[Column("ENDPOINT_AUTH_TOKEN")]
[MaxLength(300)]
public string? EndpointAuthToken { get; set; }
[Column("ENDPOINT_AUTH_USERNAME")]
[MaxLength(200)]
public string? EndpointAuthUsername { get; set; }
[Column("ENDPOINT_AUTH_PASSWORD")]
[MaxLength(200)]
public string? EndpointAuthPassword { get; set; }
[Column("ENDPOINT_AUTH_DOMAIN")]
[MaxLength(100)]
public string? EndpointAuthDomain { get; set; }
[Column("ENDPOINT_AUTH_WORKSTATION")]
[MaxLength(100)]
public string? EndpointAuthWorkstation { get; set; }
[Column("ENDPOINT_PARAMS_ID")]
public short? EndpointParamsId { get; set; }
[Column("SQL_CONNECTION_ID")]
public short? SqlConnectionId { get; set; }
[Column("SQL_CONNECTION_SERVER")]
[MaxLength(150)]
public string? SqlConnectionServer { get; set; }
[Column("SQL_CONNECTION_DB")]
[MaxLength(100)]
public string? SqlConnectionDb { get; set; }
[Column("SQL_CONNECTION_USERNAME")]
[MaxLength(100)]
public string? SqlConnectionUsername { get; set; }
[Column("SQL_CONNECTION_PASSWORD")]
[MaxLength(100)]
public string? SqlConnectionPassword { get; set; }
[Column("REST_TYPE")]
[MaxLength(20)]
public string? RestType { get; set; }
[Column("PREPROCESSING_QUERY")]
public string? PreprocessingQuery { get; set; }
[Column("HEADER_QUERY")]
public string? HeaderQuery { get; set; }
[Column("BODY_QUERY")]
public string? BodyQuery { get; set; }
[Column("POSTPROCESSING_QUERY")]
public string? PostprocessingQuery { get; set; }
}