using System.Collections.Generic; 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; } /// 操作影响到的应用 ID(不代表应用状态发生变化) public List AffectedApplicationIds { get; set; } = new List(); /// 操作后不再包含任何启用规则的应用 ID public List CausedNoAvailableRuleApplicationIds { get; set; } = new List(); /// 旧版级联字段,解耦后始终为空,仅为兼容旧客户端保留 public List CascadedApplicationIds { get; set; } = new List(); } 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 Items { get; set; } = new List(); /// 所有请求项影响到的应用 ID 去重并集 public List AffectedApplicationIds { get; set; } = new List(); /// 操作后不再包含任何启用规则的应用 ID 去重并集 public List CausedNoAvailableRuleApplicationIds { get; set; } = new List(); /// 旧版级联字段,解耦后始终为空,仅为兼容旧客户端保留 public List CascadedApplicationIds { get; set; } = new List(); } }