WIP: AI Validator
This commit is contained in:
21
DiunaBI.Infrastructure/Plugins/BaseDataValidator.cs
Normal file
21
DiunaBI.Infrastructure/Plugins/BaseDataValidator.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using DiunaBI.Domain.Entities;
|
||||
using DiunaBI.Infrastructure.Interfaces;
|
||||
|
||||
namespace DiunaBI.Infrastructure.Plugins;
|
||||
|
||||
public abstract class BaseDataValidator : IDataValidator
|
||||
{
|
||||
public abstract string ValidatorType { get; }
|
||||
|
||||
public virtual bool CanValidate(string validatorType) => ValidatorType == validatorType;
|
||||
|
||||
public abstract void Validate(Layer validationWorker);
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to get record value by code from layer records
|
||||
/// </summary>
|
||||
protected string? GetRecordValue(ICollection<Record> records, string code)
|
||||
{
|
||||
return records.FirstOrDefault(x => x.Code == code)?.Desc1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user