Files
ECMJobRunner/ECMJobRunner.Domain/Entities/ProfileSqlJob.cs
TekH ce47653831 Refactor Profile entity and update property constraints
Renamed `Profile` to `CfgProfile` across the codebase for clarity and consistency. Updated property constraints in `CfgProfile.cs`, `ProfileHistory.cs`, and `ProfileSqlJob.cs` to include maximum length validations. Changed navigation properties in `CfgProfile.cs` to use `IEnumerable` and made them nullable. Updated `ForeignKey` attributes in `ProfileHistory.cs` and `ProfileSqlJob.cs` to reference `CfgProfile`. Improved property descriptions for better documentation.
2026-07-09 13:23:46 +02:00

112 lines
2.9 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ECMJobRunner.Domain.Entities
{
/// <summary>
/// SQL Job Configuration for Profile
/// Represents individual SQL jobs within a job runner profile
/// </summary>
[Table("TBJR_CFG_PROFILE_SQLJOB", Schema = "dbo")]
public class ProfileSqlJob
{
/// <summary>
/// Primary Key
/// </summary>
[Key]
[Column("PK_TBJR_CFG_PROFILE_SQLJOB_ID")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
/// <summary>
/// Foreign Key to Profile
/// </summary>
[Required]
[Column("FK_TBJR_CFG_PROFILE_ID")]
[ForeignKey(nameof(CfgProfile))]
public long ProfileId { get; set; }
/// <summary>
/// Active / Inactive switch
/// </summary>
[Required]
[Column("ACTIVE")]
public bool Active { get; set; } = true;
/// <summary>
/// Sequence order within the profile
/// </summary>
[Required]
[Column("SEQUENCE")]
public short Sequence { get; set; } = 0;
/// <summary>
/// Optional name (max 150 chars)
/// </summary>
[Column("NAME")]
[MaxLength(150)]
public string? Name { get; set; }
/// <summary>
/// SQL Check Query
/// </summary>
[Column("SQL_CHECK_QUERY")]
public string? SqlCheckQuery { get; set; }
/// <summary>
/// SQL Main Query
/// </summary>
[Column("SQL_MAIN_QUERY")]
public string? SqlMainQuery { get; set; }
/// <summary>
/// API Command
/// </summary>
[Column("API_COMMAND")]
public string? ApiCommand { get; set; }
/// <summary>
/// Optional description (max 500 chars)
/// </summary>
[Column("COMMENT")]
[MaxLength(500)]
public string? Comment { get; set; }
/// <summary>
/// Created by (max 50 chars)
/// </summary>
[Required]
[Column("ADDED_WHO")]
[MaxLength(50)]
public string AddedWho { get; set; } = "DEFAULT";
/// <summary>
/// Created at
/// </summary>
[Required]
[Column("ADDED_WHEN")]
public DateTime AddedWhen { get; set; } = DateTime.Now;
/// <summary>
/// Modified by (max 50 chars)
/// </summary>
[Column("CHANGED_WHO")]
[MaxLength(50)]
public string? ChangedWho { get; set; }
/// <summary>
/// Modified at
/// </summary>
[Column("CHANGED_WHEN")]
public DateTime? ChangedWhen { get; set; }
// Navigation properties
/// <summary>
/// Associated Profile
/// </summary>
public virtual CfgProfile? CfgProfile { get; set; }
}
}