using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace ECMJobRunner.Domain.Entities { /// /// Job Runner Configuration Profile Entity /// Represents a job runner profile configuration /// Type: 0 = ADSync; 1 = GraphQL; 2 = SQL-Job; 3 = SQL and REST-Job /// [Table("TBJR_CFG_PROFILE", Schema = "dbo")] public class Profile { /// /// Primary Key /// [Key] [Column("PK_TBJR_CFG_PROFILE_ID")] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public long Id { get; set; } /// /// Active / Inactive switch /// [Required] [Column("ACTIVE")] public bool Active { get; set; } = true; /// /// Optional profile name /// [Required] [Column("PROFILE_NAME")] [MaxLength(150)] public string ProfileName { get; set; } = null!; /// /// Profile type: 0 = ADSync; 1 = GraphQL; 2 = SQL-Job; 3 = SQL and REST-Job /// [Required] [Column("TYPE_ID")] public byte TypeId { get; set; } /// /// Schedule in Cron format /// [Required] [Column("SCHEDULE")] [MaxLength(150)] public string Schedule { get; set; } = "0 30 4 ? * MON-SAT"; /// /// Optional description /// [Column("COMMENT")] [MaxLength(500)] public string? Comment { get; set; } /// /// Created by /// [Required] [Column("ADDED_WHO")] [MaxLength(50)] public string AddedWho { get; set; } = "DEFAULT"; /// /// Created at /// [Required] [Column("ADDED_WHEN")] public DateTime AddedWhen { get; set; } = DateTime.Now; /// /// Modified by /// [Column("CHANGED_WHO")] [MaxLength(50)] public string? ChangedWho { get; set; } /// /// Modified at /// [Column("CHANGED_WHEN")] public DateTime? ChangedWhen { get; set; } // Navigation properties /// /// SQL Jobs associated with this profile /// public virtual ICollection SqlJobs { get; set; } = new List(); /// /// Profile execution history /// public virtual ICollection ProfileHistories { get; set; } = new List(); } }