Adding
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using LCU.Library.Internal.LoanRateModels.Enums;
|
||||
namespace LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
|
||||
public class LoadTestInitiateRequest
|
||||
{
|
||||
[Required]
|
||||
public RateTypes? RateType { get; set; }
|
||||
[PropertyListValidation]
|
||||
public Dictionary<string, List<string>> PropertyList { get; set; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
|
||||
public class PropertyListValidation : ValidationAttribute
|
||||
{
|
||||
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
|
||||
{
|
||||
if (!(value is Dictionary<string, List<string>> dictionary))
|
||||
return new ValidationResult("Object is not of proper type");
|
||||
|
||||
if (dictionary.ContainsKey(nameof(RateRequest.RateType)))
|
||||
{
|
||||
return new ValidationResult($"{nameof(RateRequest.RateType)} cannot be declared in the PropertyList.");
|
||||
}
|
||||
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
using LCU.Library.Internal.LoanRateModels.Entities.LoadTestingEntities;
|
||||
namespace LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
|
||||
public class LoadTestProcessRateRequest
|
||||
{
|
||||
public RateProcessingInfo RateProcessingInfo { get; set; }
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
using LCU.Library.Internal.LoanRateModels.Entities.LoadTestingEntities;
|
||||
namespace LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
|
||||
public class LoadTestRateCompletionRequest
|
||||
{
|
||||
public RateProcessingInfo RateProcessingInfo { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user