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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
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)} 必须指定其中一项" ) ;
}
}
}
}