using System;
namespace ECMJobRunner.Application.Common.Exceptions
{
///
/// Exception thrown when attempting to execute a job for an inactive profile
/// Extends JobException with profile-specific context
///
public class InactiveProfileException : JobException
{
///
/// Initializes a new instance of InactiveProfileException
///
/// ID of the inactive profile
/// Name of the inactive profile (nullable)
/// Unique batch identifier for tracking
///
/// Use this exception when:
/// - Attempting to trigger DEX job batch for an inactive profile
/// - Attempting to execute individual jobs from an inactive profile
/// - Profile is deactivated during execution
///
public InactiveProfileException(long profileId, string? profileName, string batchId)
: base(
jobName: "Profile Execution",
processName: "Profile Active Status Validation",
batchId: batchId,
reason: "The profile is marked as inactive and cannot be executed",
innerException: null,
("Profile ID", profileId.ToString(), false),
("Profile Name", profileName, true))
{
ProfileId = profileId;
ProfileName = profileName;
}
///
/// Gets the ID of the inactive profile
///
public long ProfileId { get; }
///
/// Gets the name of the inactive profile (nullable)
///
public string? ProfileName { get; }
}
}