Adding
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Models.Requests
|
||||
{
|
||||
public class AccountQueueRequest : IValidatableObject
|
||||
{
|
||||
[Required]
|
||||
[StringLength(16, MinimumLength = 7,
|
||||
ErrorMessage = "The AccountNo field must have a length between 7 and 16 characters")]
|
||||
public string AccountNo { get; set; }
|
||||
|
||||
[StringLength(20, MinimumLength = 1)] public string CaseId { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
var results = new List<ValidationResult>();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(AccountNo))
|
||||
{
|
||||
results.Add(new ValidationResult(
|
||||
"AccountNo (AccountIdentifier) is not valid",
|
||||
new[] { nameof(AccountNo) }));
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user