75 lines
1.8 KiB
C#
75 lines
1.8 KiB
C#
namespace PrintService.Models;
|
|
|
|
/// <summary>
|
|
/// Represents a print job in the queue
|
|
/// </summary>
|
|
public class PrintJob
|
|
{
|
|
/// <summary>
|
|
/// Unique identifier for the job
|
|
/// </summary>
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
|
|
/// <summary>
|
|
/// Path to the original capture file
|
|
/// </summary>
|
|
public string SourceFilePath { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Path to the queued file (after being moved with GUID name)
|
|
/// </summary>
|
|
public string QueuedFilePath { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Document type (invoice, order, delivery, etc.)
|
|
/// </summary>
|
|
public string DocumentType { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Optional order number
|
|
/// </summary>
|
|
public string? OrderNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// When the job was created
|
|
/// </summary>
|
|
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
|
|
|
/// <summary>
|
|
/// When the job was last updated
|
|
/// </summary>
|
|
public DateTime UpdatedAt { get; set; } = DateTime.Now;
|
|
|
|
/// <summary>
|
|
/// Current status of the job
|
|
/// </summary>
|
|
public PrintJobStatus Status { get; set; } = PrintJobStatus.Pending;
|
|
|
|
/// <summary>
|
|
/// Number of times this job has been attempted
|
|
/// </summary>
|
|
public int RetryCount { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// Last error message if failed
|
|
/// </summary>
|
|
public string? LastError { get; set; }
|
|
|
|
/// <summary>
|
|
/// Original filename before moving to queue
|
|
/// </summary>
|
|
public string OriginalFilename { get; set; } = string.Empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Status of a print job
|
|
/// </summary>
|
|
public enum PrintJobStatus
|
|
{
|
|
Pending,
|
|
Processing,
|
|
Completed,
|
|
Failed,
|
|
RetryScheduled
|
|
}
|