You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.7 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace DS.WMS.Core.Invoice.Dtos
{
/// <summary>
/// 发票API请求实体
/// </summary>
public class InvoiceAPIRequest
{
/// <summary>
/// 唯一标识由企业自己生成32位随机码【消息体】
/// </summary>
public string senid { get; set; } = Guid.NewGuid().ToString("N");
}
/// <summary>
/// 发票冲红请求
/// </summary>
public class InvoiceReversalRequest : InvoiceAPIRequest, IValidatableObject
{
/// <summary>
/// 发票ID用于获取发票业务号传入发票业务号时此字段可为空
/// </summary>
public long? InvoiceId { get; set; }
/// <summary>
/// 发票业务号
/// </summary>
public string orderNo { get; set; } = string.Empty;
/// <summary>
/// 冲红原因代码00-直接冲红01-开票有误02-销货退回03-服务中止04-销售折让默认值00
/// </summary>
public string chyyDm { get; set; } = "00";
/// <summary>
/// 冲红原因描述
/// </summary>
public string? Reason { get; set; }
/// <summary>
/// 录入方身份0-销方1-购方默认值0
/// </summary>
public string lrfsf { get; set; } = "0";
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (InvoiceId == null && string.IsNullOrEmpty(orderNo))
{
yield return new ValidationResult($"参数:{nameof(InvoiceId)}和{nameof(orderNo)} 必须指定其中一项");
}
}
}
}