diff --git a/ECMJobRunner.Domain/Entities/Profile.cs b/ECMJobRunner.Domain/Entities/CfgProfile.cs similarity index 86% rename from ECMJobRunner.Domain/Entities/Profile.cs rename to ECMJobRunner.Domain/Entities/CfgProfile.cs index ee8f851..21f8acd 100644 --- a/ECMJobRunner.Domain/Entities/Profile.cs +++ b/ECMJobRunner.Domain/Entities/CfgProfile.cs @@ -11,7 +11,7 @@ namespace ECMJobRunner.Domain.Entities /// Type: 0 = ADSync; 1 = GraphQL; 2 = SQL-Job; 3 = SQL and REST-Job /// [Table("TBJR_CFG_PROFILE", Schema = "dbo")] - public class Profile + public class CfgProfile { /// /// Primary Key @@ -29,7 +29,7 @@ namespace ECMJobRunner.Domain.Entities public bool Active { get; set; } = true; /// - /// Optional profile name + /// Profile name (max 150 chars) /// [Required] [Column("PROFILE_NAME")] @@ -44,7 +44,7 @@ namespace ECMJobRunner.Domain.Entities public byte TypeId { get; set; } /// - /// Schedule in Cron format + /// Schedule in Cron format (max 150 chars) /// [Required] [Column("SCHEDULE")] @@ -52,14 +52,14 @@ namespace ECMJobRunner.Domain.Entities public string Schedule { get; set; } = "0 30 4 ? * MON-SAT"; /// - /// Optional description + /// Optional description (max 500 chars) /// [Column("COMMENT")] [MaxLength(500)] public string? Comment { get; set; } /// - /// Created by + /// Created by (max 50 chars) /// [Required] [Column("ADDED_WHO")] @@ -74,7 +74,7 @@ namespace ECMJobRunner.Domain.Entities public DateTime AddedWhen { get; set; } = DateTime.Now; /// - /// Modified by + /// Modified by (max 50 chars) /// [Column("CHANGED_WHO")] [MaxLength(50)] @@ -91,11 +91,11 @@ namespace ECMJobRunner.Domain.Entities /// /// SQL Jobs associated with this profile /// - public virtual ICollection SqlJobs { get; set; } = new List(); + public virtual IEnumerable? SqlJobs { get; set; } /// /// Profile execution history /// - public virtual ICollection ProfileHistories { get; set; } = new List(); + public virtual IEnumerable? ProfileHistories { get; set; } } } diff --git a/ECMJobRunner.Domain/Entities/ProfileHistory.cs b/ECMJobRunner.Domain/Entities/ProfileHistory.cs index ca8acdc..7dd3304 100644 --- a/ECMJobRunner.Domain/Entities/ProfileHistory.cs +++ b/ECMJobRunner.Domain/Entities/ProfileHistory.cs @@ -25,7 +25,7 @@ namespace ECMJobRunner.Domain.Entities /// [Required] [Column("FK_TBJR_CFG_PROFILE_ID")] - [ForeignKey(nameof(Profile))] + [ForeignKey(nameof(CfgProfile))] public long ProfileId { get; set; } /// @@ -43,7 +43,7 @@ namespace ECMJobRunner.Domain.Entities public string ResultText { get; set; } = string.Empty; /// - /// Created by + /// Created by (max 50 chars) /// [Required] [Column("ADDED_WHO")] @@ -58,7 +58,7 @@ namespace ECMJobRunner.Domain.Entities public DateTime AddedWhen { get; set; } = DateTime.Now; /// - /// Modified by + /// Modified by (max 50 chars) /// [Column("CHANGED_WHO")] [MaxLength(50)] @@ -75,6 +75,6 @@ namespace ECMJobRunner.Domain.Entities /// /// Associated Profile /// - public virtual Profile Profile { get; set; } = null!; + public virtual CfgProfile? CfgProfile { get; set; } } } diff --git a/ECMJobRunner.Domain/Entities/ProfileSqlJob.cs b/ECMJobRunner.Domain/Entities/ProfileSqlJob.cs index bc167b4..254ff36 100644 --- a/ECMJobRunner.Domain/Entities/ProfileSqlJob.cs +++ b/ECMJobRunner.Domain/Entities/ProfileSqlJob.cs @@ -24,7 +24,7 @@ namespace ECMJobRunner.Domain.Entities /// [Required] [Column("FK_TBJR_CFG_PROFILE_ID")] - [ForeignKey(nameof(Profile))] + [ForeignKey(nameof(CfgProfile))] public long ProfileId { get; set; } /// @@ -42,7 +42,7 @@ namespace ECMJobRunner.Domain.Entities public short Sequence { get; set; } = 0; /// - /// Optional name + /// Optional name (max 150 chars) /// [Column("NAME")] [MaxLength(150)] @@ -67,14 +67,14 @@ namespace ECMJobRunner.Domain.Entities public string? ApiCommand { get; set; } /// - /// Optional description + /// Optional description (max 500 chars) /// [Column("COMMENT")] [MaxLength(500)] public string? Comment { get; set; } /// - /// Created by + /// Created by (max 50 chars) /// [Required] [Column("ADDED_WHO")] @@ -89,7 +89,7 @@ namespace ECMJobRunner.Domain.Entities public DateTime AddedWhen { get; set; } = DateTime.Now; /// - /// Modified by + /// Modified by (max 50 chars) /// [Column("CHANGED_WHO")] [MaxLength(50)] @@ -106,6 +106,6 @@ namespace ECMJobRunner.Domain.Entities /// /// Associated Profile /// - public virtual Profile Profile { get; set; } = null!; + public virtual CfgProfile? CfgProfile { get; set; } } }