using System;
namespace GB5Shared.DTO.WorkFlow
{
///
/// Maps to TWORKFLOWWIP — the WIP (form-based approval) staging table.
/// STATUS: 0=Cancelled, 1=Pending, 2=Approved, 3=Rejected, 4=Returned, 5=Withdrawn
/// LASTACTION: 0=Submit, 1=Approve, 2=Reject, 3=Return, 4=Escalate, 5=Cancel
/// SOURCETYPE: 1=API, 2=UI, 3=Background, 4=Import, 5=Other
///
public class WorkflowWipDTO
{
public int WipId { get; set; }
public int EntityId { get; set; }
public int ObjectId { get; set; }
public int TenantId { get; set; }
public int WorkflowInstanceId { get; set; }
public string? DataJson { get; set; }
public string? LoginJson { get; set; }
public byte[]? DataHash { get; set; }
public short ResubmissionCount { get; set; }
public byte? LastAction { get; set; }
public short SortOrder { get; set; }
public byte Status { get; set; }
public short Version { get; set; }
public byte SourceType { get; set; }
public string? ApiEndpoint { get; set; }
public int CreatedById { get; set; }
public DateTime CreatedOn { get; set; }
public int ModifiedById { get; set; }
public DateTime ModifiedOn { get; set; }
}
///
/// Pending WIP dispatch info returned by HandleActionsAsync after final approval.
/// Carries everything the dispatcher needs to replay the original API call.
///
public class WipDispatchInfo
{
public int WipId { get; set; }
public int WorkflowInstanceId { get; set; }
public string? ApiEndpoint { get; set; }
public string? DataJson { get; set; }
///
/// Serialized LoginDTO of the original submitter — stored in TWORKFLOWWIP.LOGINJSON
/// at WIP creation time. The dispatcher sends this as the Login header so the entity
/// saves under the submitter's session context (WorkOUId, BranchId, UserId, etc.)
/// rather than the approver's.
///
public string? LoginJson { get; set; }
}
}