namespace Admin.NET.Plugin.AiDOP.Entity.DataPlatform;
///
/// MDP 出站回写 Outbox(幂等待推送表)。
/// status: 0待推 1成功 2失败
///
[SugarTable("mdp_outbox", "MDP出站回写Outbox")]
public class MdpOutbox
{
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
public long Id { get; set; }
[SugarColumn(ColumnName = "tenant_id")]
public long TenantId { get; set; }
[SugarColumn(ColumnName = "target_source_code", Length = 100)]
public string TargetSourceCode { get; set; } = string.Empty;
[SugarColumn(ColumnName = "action_code", Length = 100)]
public string ActionCode { get; set; } = string.Empty;
[SugarColumn(ColumnName = "idem_key", Length = 200)]
public string IdemKey { get; set; } = string.Empty;
[SugarColumn(ColumnName = "payload_json", ColumnDataType = "text", IsNullable = true)]
public string? PayloadJson { get; set; }
[SugarColumn(ColumnName = "status")]
public int Status { get; set; }
[SugarColumn(ColumnName = "retry_count")]
public int RetryCount { get; set; }
/// 下次可推时间;null 表示立即可推(WP10 S4b / D12)。
[SugarColumn(ColumnName = "next_retry_time", IsNullable = true)]
public DateTime? NextRetryTime { get; set; }
/// 最近一次错误码(如 SOURCE_ROUTE_UNRESOLVED / PAYLOAD_INVALID)。
[SugarColumn(ColumnName = "last_error_code", Length = 64, IsNullable = true)]
public string? LastErrorCode { get; set; }
[SugarColumn(ColumnName = "response_json", ColumnDataType = "text", IsNullable = true)]
public string? ResponseJson { get; set; }
[SugarColumn(ColumnName = "error_msg", Length = 1000, IsNullable = true)]
public string? ErrorMsg { get; set; }
[SugarColumn(ColumnName = "create_time")]
public DateTime CreateTime { get; set; }
[SugarColumn(ColumnName = "update_time")]
public DateTime UpdateTime { get; set; }
}