49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using System.Runtime.Serialization;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace YLErp.Modules.RiskEngine.Dto
|
|
{
|
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
|
public enum BatchOperationOutcome
|
|
{
|
|
[EnumMember(Value = "AllSucceeded")]
|
|
AllSucceeded,
|
|
[EnumMember(Value = "PartiallySucceeded")]
|
|
PartiallySucceeded,
|
|
[EnumMember(Value = "AllFailed")]
|
|
AllFailed
|
|
}
|
|
|
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
|
public enum BatchOperationItemStatus
|
|
{
|
|
[EnumMember(Value = "Succeeded")]
|
|
Succeeded,
|
|
[EnumMember(Value = "Unchanged")]
|
|
Unchanged,
|
|
[EnumMember(Value = "Failed")]
|
|
Failed
|
|
}
|
|
|
|
public class BatchOperationItemResult
|
|
{
|
|
public long Id { get; set; }
|
|
public BatchOperationItemStatus Status { get; set; }
|
|
public string Code { get; set; }
|
|
public string Message { get; set; }
|
|
public List<long> CascadedApplicationIds { get; set; } = new List<long>();
|
|
}
|
|
|
|
public class BatchOperationResult
|
|
{
|
|
public BatchOperationOutcome Outcome { get; set; }
|
|
public int TotalCount { get; set; }
|
|
public int SucceededCount { get; set; }
|
|
public int UnchangedCount { get; set; }
|
|
public int FailedCount { get; set; }
|
|
public bool HasChanges { get; set; }
|
|
public List<BatchOperationItemResult> Items { get; set; } = new List<BatchOperationItemResult>();
|
|
public List<long> CascadedApplicationIds { get; set; } = new List<long>();
|
|
}
|
|
}
|